hellosign / hellosign-ruby-sdk

A Ruby SDK for HelloSign's API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client.get_embedded_sign_url ignores test_mode

JasperLab opened this issue · comments

Perhaps a noob user error. I am trying to follow the quick start example using my trial account and display embedded signature iframe on my web page following this guide:

https://app.hellosign.com/api/documentation#QuickStart

I successfully pass steps 1 and 2, but step 3 returns

Request URI: https://api.hellosign.com/v3/embedded/sign_url/29a1dde12cc9a390219992f12408292a32aadfc1
Message: {"error":{"error_msg":"Signature not found","error_name":"bad_request"}}

When I check the API console in my account, it seems that the client.get_embedded_sign_url seems to execute against the live, not test environment of my account. I've tried to add test_mode=1 to the client.get_embedded_sign_url call to no avail.

Your help would be greatly appreciated as it would allow me to continue evaluation without switching to the paid account.

EDIT #1:
I also tried the non-embedded example using client.get_signature_request: it worked perfectly. Unfortunately, it is the embedded flow that I am very interested in.

EDIT #2:
I just tried the curl example for getting the embedded URL: same result. I also tried to add -F 'test_mode=1' with no results. Therefore, the issue is most likely with the API endpoint itself.

User error, please ignore.

@vivanov26 Glad to see that you were able to resolve this! If you run into any other issues, please feel free to write into apisupport@hellosign.com as well.

I can't resolve this yet, I'm having the same Bad request response. What should I do?
Thanks

Hello, It would have been nice to share your solution. Others can be in this situation.
You don't need to set the test_mode for the endpoint get_embedded_sign_url because it is not a paid endpoint.
The issue can come from the signature_id itself. You can easily be confused between the signature_request_id and the signature_id. Working example.

response = HelloSign.create_embedded_signature_request(......)

signature_body = HelloSign.get_signature_request signature_request_id: response.signature_request_id

signature_id = signature_body.signatures.first.signature_id

HelloSign.get_embedded_sign_url(signature_id: signature_id).sign_url