I am developing a Zapier workflow that locates a specific client and retrieves their folder from Google Drive. The workflow’s objective is to obtain a PDF file from the Google Drive folder and upload it to HelloSign for the client. While testing on my local system works fine, running the same code in Zapier yields an error: “OSError: [Errno 30] Read-only file system” when attempting to execute the line “with open(‘Document.pdf’, ‘wb’) as file”. This seems to be due to Zapier’s restrictions on file creation. Below is the code snippet causing the issue:
result = {'response_code': ''}
api_key = 'your_api_key_here'
api_url = f'https://{api_key}:@api.hellosign.com/v3/signature_request/send'
data = requests.get(input['pdf_url'])
with open('Document.pdf', 'wb') as file:
file.write(data.content)
documents = {'File': data.content}
params = {
'test_mode': 1,
'title': "HelloSign Test",
'subject': "Document Ready",
'message': 'Hello! Please sign the attached document.',
'signing_redirect_url': 'https://www.example.com/',
'signers[0][name]': input['client_name'],
'signers[0][email_address]': input['client_email']
}
response = requests.post(url=api_url, files=documents, params=params)
result['response_code'] = response.status_code
What methods can I use to access the PDF without the open()
function so I can forward it to HelloSign?