Create a document from a template
curl --request POST \
--url https://deployed.workauthor.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerEmail": "<string>",
"coAuthorEmail": "<string>",
"documentName": "<string>",
"externalId": "<string>",
"templateId": "<string>",
"templateFields": {
"TextLong": "<string>",
"TextShort": "<string>",
"Number": 123,
"CustomLookup": "<string>",
"Address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateProvinceRegion": "<string>",
"zipPostalCode": "<string>",
"country": "<string>"
}
},
"eventNotification": {
"webhookUrl": "<string>",
"events": []
}
}
'import requests
url = "https://deployed.workauthor.com/api/v1/documents"
payload = {
"ownerEmail": "<string>",
"coAuthorEmail": "<string>",
"documentName": "<string>",
"externalId": "<string>",
"templateId": "<string>",
"templateFields": {
"TextLong": "<string>",
"TextShort": "<string>",
"Number": 123,
"CustomLookup": "<string>",
"Address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateProvinceRegion": "<string>",
"zipPostalCode": "<string>",
"country": "<string>"
}
},
"eventNotification": {
"webhookUrl": "<string>",
"events": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ownerEmail: '<string>',
coAuthorEmail: '<string>',
documentName: '<string>',
externalId: '<string>',
templateId: '<string>',
templateFields: {
TextLong: '<string>',
TextShort: '<string>',
Number: 123,
CustomLookup: '<string>',
Address: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
stateProvinceRegion: '<string>',
zipPostalCode: '<string>',
country: '<string>'
}
},
eventNotification: {webhookUrl: '<string>', events: []}
})
};
fetch('https://deployed.workauthor.com/api/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"url": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}Create a document from a template
Create a document from templateId and templateFields, with owner, co-author, name, externalId and an optional per-document eventNotification. Returns 201 with id and url.
POST
/
api
/
v1
/
documents
Create a document from a template
curl --request POST \
--url https://deployed.workauthor.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerEmail": "<string>",
"coAuthorEmail": "<string>",
"documentName": "<string>",
"externalId": "<string>",
"templateId": "<string>",
"templateFields": {
"TextLong": "<string>",
"TextShort": "<string>",
"Number": 123,
"CustomLookup": "<string>",
"Address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateProvinceRegion": "<string>",
"zipPostalCode": "<string>",
"country": "<string>"
}
},
"eventNotification": {
"webhookUrl": "<string>",
"events": []
}
}
'import requests
url = "https://deployed.workauthor.com/api/v1/documents"
payload = {
"ownerEmail": "<string>",
"coAuthorEmail": "<string>",
"documentName": "<string>",
"externalId": "<string>",
"templateId": "<string>",
"templateFields": {
"TextLong": "<string>",
"TextShort": "<string>",
"Number": 123,
"CustomLookup": "<string>",
"Address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateProvinceRegion": "<string>",
"zipPostalCode": "<string>",
"country": "<string>"
}
},
"eventNotification": {
"webhookUrl": "<string>",
"events": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ownerEmail: '<string>',
coAuthorEmail: '<string>',
documentName: '<string>',
externalId: '<string>',
templateId: '<string>',
templateFields: {
TextLong: '<string>',
TextShort: '<string>',
Number: 123,
CustomLookup: '<string>',
Address: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
stateProvinceRegion: '<string>',
zipPostalCode: '<string>',
country: '<string>'
}
},
eventNotification: {webhookUrl: '<string>', events: []}
})
};
fetch('https://deployed.workauthor.com/api/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"url": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"code": "<string>",
"description": "<string>",
"type": 123
}
],
"traceId": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Maximum string length:
200Maximum string length:
64Entity data must be passed in as keys on this object, matching the entity names and types for the template.
The entity names and types can be fetched from 'Get template' endpoint.
The structures for each entity type are listed as properties below.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I