Uploading Documents to the Database
Description
This web service uploads document information. The documents can be of video, text or any other type.
Definition
POST https://<domain>/services/apexrest/peer/v1/document/*
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
accountId* | String | This is the account ID of the user. |
uploadDoc_DocType* | String |
|
uploadDoc* | Boolean | This is the Boolean variable which is representing the uploaded resource, of the document type |
uploadVideo* | Boolean | This is the Boolean variable which is representing the uploaded resource, of the video type . |
result_Status* | String | This is the status of the document upload. |
uploadVideo_VidRetries* | Integer | This is an integer value that indicates the number of times the video has been uploaded. |
Error messages
When you post a web service, you can receive the possible error messages as shown in the table below:
Error Code | Reason | HTTP Status Code |
---|---|---|
ACCOUNT_NOT_FOUND | You will receive this error if the requested account is not found | 400 |
ALL_DOCUMENTS_UPLOADED | You will receive this error if the required documents are already uploaded | 400 |
SIGNED | You will receive this error if the required documents are already signed | 400 |
NO VIDEO UPLOAD REQUIRED | You will receive this error if the video upload is not required by the user | 400 |
NO SUCH RECORD EXISTS | You will receive this error if the documents that you are looking for does not exist | 400 |
<exception message> | You will receive this error if there is any run time exception | 500 |
Sample Request
The sample request to be sent is as shown below:
https://na11.salesforce.com/services/apexrest/peer/v1/document
{ "accountId":"001G000001Phdoe", "uploadDoc_DocType":"a3XG000000093Wg", "uploadDoc":"false", "uploadVideo":"true", "resultStatus":"uploaded", "uploadVideo_VidRetries":1 }
Sample Response
The sample response that you will receive is as shown below:
{ "status":"SUCCESS", "response":[ ], "errorCode":"NO_ERROR", "content":[ ] }