POSTing documents
Use the following endpoints to POST documents for your respective InsuranceSuite application:
- ClaimCenter:
- POST
/claim/v1/claims/{claimId}/documents
- POST
- PolicyCenter:
- POST
/account/v1/accounts/{accountId}/documents - POST
/job/v1/jobs/{jobId}/documents - POST
/policy/v1/policies/{policyId}/documents
- POST
- BillingCenter:
- POST
/billing/v1/accounts/{accountId}/documents - POST
/billing/v1/accounts/{accountId}/policies/{policyId}/documents - POST
/billing/v1/producers/{producerId}/documents
- POST
- ContactManager:
- POST
/contact/v1/contacts/{contactId}/documents: In ContactManager, documents can be posted only to contacts with the "vendor" tag.
- POST
FormData objects
For most Cloud API endpoints, the request has a body with a single string of JSON text.
However, this format is not sufficiently robust for documents. When working with documents,
the caller application typically sends two sets of data: the document metadata and the
document contents. This is accomplished using FormData objects.
FormData is an industry-standard interface that constructs an object as a set
of key/value pairs. When a caller application is constructing a POST
/documents call, the request has a FormData object with the following
keys:
metadata, whose value is a JSON string identifying the document metadatacontent, whose value is the contents of the document (and whose format varies based on the document type)
Minimum creation criteria
When POSTing a document, the
metadata JSON must include the following fields:
namestatus(a typecode from theDocumentStatusTypetypelist)type(a typecode from theDocumentTypetypelist)
content value is not required. In some use cases, it can be
omitted.Use cases for POSTing document information
There are several ways that a caller application can POST document information:
- You can POST information about a document that is not yet in the document management system.
- You can POST information about a document that is already in the document management system but is not yet known to your InsuranceSuite application.
- You can POST information about a document that will never be in the document management system (such as a physical piece of paper that must be tracked by InsuranceSuite).
POSTing a document that is not yet in the document management system
You can POST a document that is not yet in the document management system. In this approach:
- You provide both document content and document metadata.
- The InsuranceSuite application adds the document to the document management system through its own integration point.
- The integration point is responsible for storing values created by the document
management system in the document metadata (such as the document's
docUID).
The following is an example of POSTing a "billingerror.pdf" file in BillingCenter for account bc:10. This file does not yet exist in the document management system:
POST /billing/v1/accounts/bc:10/documentsMETADATA:
{
"data": {
"attributes": {
"name": "Billing error",
"status": {
"code": "draft"
},
"type": {
"code": "billingerror"
}
}
}
}
CONTENTS:
<contents of "billingerror.pdf" file>POSTing a document that is already in the document management system
You can POST a document that is already in the document management system. In this approach:
- You must know the ID assigned to the document in the document management system.
- You provide document metadata only. The metadata must specify the ID from
the document management system in the
docUIDfield. - The integration point links the new document metadata to the document in the document management system.
The following is an example of POSTing a "Property Assessment Report.pdf" file in ClaimCenter for claim cc:102. This file does exist in the document management system with id "doc:11-31":
POST /claim/v1/claims/cc:102/documentsRequest body
METADATA:
{
"data": {
"attributes": {
"docUID": "doc:11-31",
"name": "Property Assessment Report",
"status": {
"code": "draft"
},
"type": {
"code": "letter_received"
}
}
}
}
CONTENTS:
<no content specified>
If a POST /documents call needs to specify document metadata only,
it can be executed using a request body that is formatted as JSON (as opposed to
FormData). For more information, see Sending document metadata only using JSON.
POSTing a document that will never be in the document management system
You can POST information about a document that will never be in the document management system (such as a physical piece of paper that must be tracked by InsuranceSuite). In this approach:
- You provide document metadata only.
- There is no information stored in the document management system.
The following is an example of POSTing a "Printout of email from auto dealership" document in PolicyCenter for claim pc:10. This a physical piece of paper that PolicyCenter must track:
POST /account/v1/accounts/pc:10/documentsRequest body
METADATA:
{
"data": {
"attributes": {
"name": "Printout of email from auto dealership",
"status": {
"code": "final"
},
"type": {
"code": "letter_received"
}
}
}
}
CONTENTS:
<no content specified>
If a POST /documents call needs to specify document metadata only, it can
be executed using a request body that is formatted as JSON (as opposed to FormData). For
more information, see Sending document metadata only using JSON.
Errors to avoid when POSTing documents
When POSTing documents, note the following guidelines:
- Sending the
contentFormData parameter without themetadataFormData parameter results in an error. - Uploading documents of an unsupported MIME type results in an error.
- When working with the
docUIDandpendingDocUIDfields, avoid the following to prevent errors:- Including both the
docUIDand thependingDocUIDin a document's metadata - Including the
docUIDproperty or thependingDocUIDproperty when including thecontentparameter in the post - Setting the
dmsproperty totrueand including thependingDocUIDfield - Setting the
statustofinaland including thependingDocUIDfield
- Including both the
POSTing documents using Postman
About this task
From Postman, you can POST documents using FormData objects. When doing so, both the metadata and content must be stored in separate files referenced by the Postman call.
/documents endpoint supports the ability to receive the
metadata as either a string or a file. However, there is a known issue with Postman which
prevents the sending of metadata as a string. When using Postman, the metadata can be sent
only as file. This is described in the following procedure. (Client applications other than
Postman may support both string and file.)