Reputation: 745
This is the example adobe have in their documentation.
I have tried with Guzzle:
$client->request('POST', 'transientDocuments', [
'multipart' => [
[
'name' => 'test',
'contents' => fopen('pdfs/test.pdf', 'r'),
'filename' => 'file.pdf',
'headers' => [
'Content-Type' => 'multipart/form-data',
'Content-Transfer-Encoding' => "binary",
]
],
]
]);
fopen
returns resource(13) of type (stream)
But every time I get {"code":"NO_FILE_CONTENT","message":"Must provide file body"}
.
Upvotes: 2
Views: 1419
Reputation: 169
You should write code to satisfy the following request shown in image below.
When u log in with your e-sign account you will be redirected to one of the hosts (like api.in1.echosign.com
). You need to put File
as form-data parameter key and your file as value. You get Mime-Type
based on file extension. In response you will get TransientDocumentId
which can be used for the creating and sending agreements etc.
Upvotes: 1
Reputation: 1
Was stuck with the same but realised that the parameters name and filename to be enclosed in double quotes. 'name' => '"File"', 'filename' => '"file.pdf"',
PS. my code is in .Net, not php
Upvotes: 0