File upload via Document Webhooks

Uploading a file to a document storage provider is a two-step process that requires two separate API endpoints. Adobe Workfront begins the upload process by calling /uploadInit . This endpoint returns a document ID which is then passed to /upload when uploading the document bytes. Depending on the underlying document storage system, it might be necessary to create a zero-length document, then update the contents of the document later.

Added to version 1.1 of this spec, the document ID and document version ID can be used to retrieve extra information from Workfront.

Example: If the document management system wants extra information about the document, the webhook implementation code could use the document ID to retrieve that information using Workfront’s RESTful API. As a good practice, this information could come from custom data fields on the document and it’s containing task, issue, or project.

POST Method

URL

POST /uploadInit

Query Parameters

Name
Description
parentId
The parent folder ID, as referenced by the webhook provider.
filename
The name of the document
documentId
The Workfront document ID (added in version 1.1)
documentVersionId
The Workfront document version ID (added in version 1.1)

Response

The metadata for the file, as defined by the /metadata endpoint. This includes the document ID used by the provider.

Example:

https://www.acme.com/api/uploadInit?parentId=12345&filename=new-file.png&documentId=511ea6e000023edb38d2effb2f4e6e3b&documentVersionId=511ea6e000023edb38d2e ffb2f4e6e3b

PUT Method

Uploads the bytes of a document to the webhook provider.

URL

PUT /upload

Query Parameters

Name
Description
id
The document ID, which was just created.

Request Body

The raw content bytes for the document.

Response

{
result: "success"
}

or

{
result: "fail"
}

Example

https://www.acme.com/api/upload?id=1234 [document bytes included in update stream]

response

{
result:"success"
}
recommendation-more-help
5f00cc6b-2202-40d6-bcd0-3ee0c2316b43