Kyle
Kyle

Reputation: 745

Adobe Sign API - /transientDocyments

This is the example adobe have in their documentation. enter image description here

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

Answers (2)

Saurabh Bhurle
Saurabh Bhurle

Reputation: 169

You should write code to satisfy the following request shown in image below.

Request of creating TransientDocument Explanation

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

jan
jan

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

Related Questions