You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
Add get_url param to GET /signature_request/files/:signature_request_id #17
Add get_url param to GET /signature_request/files/:signature_request_id
Endpoint:
GET /signature_request/files/[:signature_request_id]
The API documentation for this endpoint includes a parameter called:
get_url
It is marked optional. It is a boolean. It goes on to say....."If true, the response will contain a url link to the file instead. Links are only available for PDFs and have a TTL of 3 days. (default = false)"
r = requests.get(buildTheRequest)
urlOfDocument = r.text
urlOfDocument = urlOfDocument.replace("\","")
print(urlOfDocument)
#Create a substring from : to the end. But chop off : AND } and convert to a number and then do the convert call
getUTC = urlOfDocument.split(':')[3]
getUTC = getUTC[:-1]
#Figure out the UTC expires at value
print(convertUTCtoLocal(getUTC))
def convertUTCtoLocal(utcValue):
if utcValue != None:
print('nonempty time value given')
return time.strftime("%Z - %Y/%m/%d, %H:%M:%S", time.localtime(float(utcValue)))
else:
return "Empty time value given"
This does not work with or without filename="test.pdf" in the pass. I do think that filename is acting like it is required and that might be another issue with this fix. However, no combination that I can find is working to show that this fix is working for me.
Activity
alexmac05 commentedon Dec 9, 2017
Workaround:
current_signatureRequestID = 'XXXXXXXXXXXXXXXXXX'
buildTheRequest = 'https://' + apikey + ':@api.hellosign.com/v3/signature_request/files/'
+ current_signatureRequestID + "?get_url=True"
r = requests.get(buildTheRequest)
urlOfDocument = r.text
urlOfDocument = urlOfDocument.replace("\","")
print(urlOfDocument)
#Create a substring from : to the end. But chop off : AND } and convert to a number and then do the convert call
getUTC = urlOfDocument.split(':')[3]
getUTC = getUTC[:-1]
getURL = urlOfDocument.split('"')[3]
print(getURL)
#Figure out the UTC expires at value
print(convertUTCtoLocal(getUTC))
def convertUTCtoLocal(utcValue):
if utcValue != None:
print('nonempty time value given')
return time.strftime("%Z - %Y/%m/%d, %H:%M:%S", time.localtime(float(utcValue)))
else:
return "Empty time value given"
jameschristopher commentedon Feb 9, 2018
This works for me
oconnor-sn commentedon Dec 16, 2019
Can this be closed, due to merge of PR 51
alexmac05 commentedon Dec 24, 2019
@oconnor-sn and @neillom Testing this is not showing it working.
Example:
This does not work with or without filename="test.pdf" in the pass. I do think that filename is acting like it is required and that might be another issue with this fix. However, no combination that I can find is working to show that this fix is working for me.
To see it working in curl you can run this:
curl 'https://api.hellosign.com/v3/signature_request/files/Signature_Request_ID?get_url=1'
-u 'API_KEY:'
that will return a ULR where you will need to change some of the slashes around to get it to display the file:
results
{"file_url":"https://s3.amazonaws.com/hellofax_uploads/super_groups/2019/12/23/45e55ebbf2de5e181e272577b7ea67d674f86592/merged-tamperproofed.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUMSXJYX53PFVNTGX%2F20191224%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191224T002810Z&X-Amz-SignedHeaders=host&X-Amz-Expires=259200&X-Amz-Signature=XXXXXXXXXXXXXXXXXXXXXXXX","expires_at":1577406490}
Change that to:
{"file_url":"https://s3.amazonaws.com/hellofax_uploads/super_groups/2019/12/23/45e55ebbf2de5e181e272577b7ea67d674f86592/merged-tamperproofed.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUMSXJYX53PFVNTGX%2F20191224%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191224T002810Z&X-Amz-SignedHeaders=host&X-Amz-Expires=259200&X-Amz-Signature=XXXXXXXXXXXXXXXXXXXXXXXX","expires_at":1577406490}
alexmac05 commentedon Dec 24, 2019
This works in Python SDK version 3.8.9 and here is the syntax:
urlResponse = client.get_signature_request_file(
signature_request_id='Signature_REQUEST_ID_HERE',
response_type="url",
)