Attach a PDF
Upload and attach a PDF document to be signed.
Send request
- POST https://api.zigned.io/rest/v2/agreements/[id]/file
- Content-type: application/json
Request body
fileFile
The PDF-file to attach. Maximum size is 5MB
Code example
const fetch = require('node-fetch');
let url = 'https://api.zigned.io/rest/v2/agreements/4004f451-26bf-48c9-b77b-528312be5a32/file';
let options = {
method: 'POST',
headers: {'x-zigned-api-key': 'Your API key'},
body: '{"file":"File"}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Success response
Description
The agreement is returned in draft with the file attached
Details
- HTTP Status: 201
- Mime type: application/json
Response body
idString
The unique ID of the agreement
statusEnumeration
Status of the agreement.
Possible values:
- draft
- pending
- fulfilled
test_modeBoolean
Indicates if the agreement is for testing purposes
issuerString | Null
Issuer of the agreement
sign_intentsArray | Null
Sign Intents of the agreement.
original_documentObject | Null
Original document to be signed.
signed_documentObject | Null
The signed and finished document.
created_atDateTime
The UTC date of when the agreement was created
updated_atDateTime
The UTC date of when the agreement was last updated
Code Example
{
"id": "bc08cbbd-d565-4d07-b219-71cb607a2216",
"status": "draft",
"test_mode": false,
"issuer": "Example AB",
"sign_intents": [],
"original_document": {
"id": "7c7cfbc0-32c5-4a2b-8cd0-4e39585f9f03",
"filename": "example.pdf",
"mime_type": "application/pdf",
"url": "www.zigned.se",
"compatibility_check": "successful",
"created_at": "Tue, 11 Jan 2022 15:59:53 GMT",
"updated_at": "Tue, 11 Jan 2022 15:59:53 GMT"
},
"signed_document": {},
"created_at": "Tue, 11 Jan 2022 15:59:53 GMT",
"updated_at": "Tue, 11 Jan 2022 15:59:53 GMT"
}
Error responses
Description
No file was found in the request body.
Details
- HTTP Status: 400
- Mime type: application/json
- Message: You need to provide a file to upload
Code Example
{
"status": 400,
"message": "You need to provide a file to upload"
}
Description
The file attempted to be uploaded and attached was not a valid PDF document.
Details
- HTTP Status: 400
- Mime type: application/json
- Message: The file must be a pdf
Code Example
{
"status": 400,
"message": "The file must be a pdf"
}
Description
The file did not pass the compatibility check and therefore could not be attached to the agreement.
Details
- HTTP Status: 400
- Mime type: application/json
- Message: The file provided can not be signed. This might be due to encryption or password protection.
Code Example
{
"status": 400,
"message": "The file provided can not be signed. This might be due to encryption or password protection."
}