Generating Transaction URL with Python script using API request
Tuesday, December 7, 2021 at 05:26pmGood day everyone,
Here in our Security Information area, we're trying to automatize the generation of new URLs with Python. Right now, we're sending the PUT request successfully but the response we get from OneSpan API doesn't show the information we need to continue the process. You can see the code's part we generated to request the API and the HTTP response below:
Code:
r = requests.put('https://idvgl001-dealflo.prod.na1.tid.onespan.cloud/api/secure/transaction/' , data=body_request , headers={'Content-Type': 'application/json','Authorization': 'Bearer ' + token})
print(r)
Response:
<Response [200]>
Could you indicate us how we can obtain the transaction ID and URL we're generating with this method, please? Maybe, a configuration is missing in the script or something like that.
Thank you in advance.
Reply to: Generating Transaction URL with Python script using API request
Thursday, December 9, 2021 at 08:32amI see, could you please try to print the content of the response instead?
print(r.text)
Duo
Reply to: Generating Transaction URL with Python script using API request
Wednesday, December 8, 2021 at 10:54amHi juan.angel,
Thanks for your post!
(1)Could you kindly remove the "/secure/" part from the URL and let us know if that solves the issue?
(2)An expected response should include the transaction ID as well as access tokens for signers, with which you'll be able to build the signing link with below formula:
transaction_url = baseUrl +"/"+ branding_id +"/#/esign/" + transaction.id + "?access_token=" + token.token;
In your case, the final output should look like below:
https://idvgl001-dealflo.prod.na1.tid.onespan.cloud/api/transaction/dealflo/#/esign/{{transactionID}}?access_token={{accessToken}}
Duo
Reply to: Generating Transaction URL with Python script using API request
Thursday, December 9, 2021 at 08:05amHi Duo, thanks for your response.
I tested the script without the "/secure" part, but i got the same response: <Response [200]>. How you can see, the http response is 200, so the request is working correctly. However, the returned data is limited. Could you indicate me wheter the print function is properly used or it's written in the right way, please?
We appreciate any help you could bring us to solve this issue.
Reply to: Generating Transaction URL with Python script using API request
Thursday, December 9, 2021 at 08:52amHi Duo, I already get the response we need. Thank you!