Sending document metadata only using JSON
If a POST /documents
or PATCH /documents
call needs to specify document metadata only, it can be executed using a request body
that is formatted as JSON. In this case, you do not need to use a FormData object. This
applies to the POST /documents
and PATCH /documents
endpoints in both ClaimCenter and ContactManager.
For example, the following creates a "Property Assessment Report.pdf" document for claim cc:102. The document already exists in the Document Management System with id "doc:11-31", which means the POST specifies document metadata only. In this case, the document metadata can be sent in the request body as JSON.
POST /claim/v1/claims/cc:102/documents
{
"data": {
"attributes": {
"docUID": "doc:11-31",
"name": "Property Assessment Report",
"status": {
"code": "draft"
},
"type": {
"code": "letter_received"
}
}
}
}