The Spanish version is the authoritative reference. View in Spanish
Method for marking documents as received (ConfirmReceivedDocument)
This method allows you to mark documents as received for the company using the POST ConfirmReceivedDocument service.
Using this method, you can mark one or several of the documents received for the company, using the unique ID (globalDocumentId) of each document received via the GetReceivedDocument method.
To connect to this functionality, you must enter the URL according to the environment you want to use:
https://developers.gosocket.net/api/v1/Document/ConfirmReceivedDocumenthttps://developers-sbx.gosocket.net/api/v1/Document/ConfirmReceivedDocumentNote: This method must be activated through your assigned consultant.
How does the ConfirmReceivedDocument method work?
To make the request, the method has one parameter of array type, in which the parameter only contains the array of documents to confirm, without specifying a name for the parameter, as shown below:
| ConfirmReceivedDocument (request) | ||
|---|---|---|
| Type | Description | Example values |
| Array | List of Ids (globalDocumentId) of the documents to be marked as received or downloaded | Can be 1 or n [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" ] |
Request example
The identifiers (globalDocumentId) in these examples are fictitious; replace them with the real values obtained with the GetReceivedDocument method.
POST https://developers-sbx.gosocket.net/api/v1/Document/ConfirmReceivedDocument
[
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
]Note: Remember that before using the method, you must authenticate in the Authorization tab.
For this method we use the Body tab, select raw, and verify or select JSON in Postman.
- Select the method type. In this case, you must select POST.
- Enter the method URL.
- Enter the parameter shown in the previous table with its corresponding value.
- Press Send.
Response example
{
"ErrorMessage": null,
"IsValid": true,
"StatusCode": "200",
"StatusDescription": null,
"StatusMessage": "OK",
"XmlBase64Bytes": null,
"XmlBytes": null,
"XmlDocumentKey": null,
"XmlFileName": null,
"ResponseType": null,
"OtherData": {
"00000000-0000-0000-0000-000000000001": "OK",
"00000000-0000-0000-0000-000000000002": "OK"
},
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"Timestamp": null,
"Response": null,
"TaxDocument": null
}To correctly interpret the API response, take into account the following criteria:
| ConfirmReceivedDocument (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| ErrorMessage | String | Description of the error in case the request runs with errors or an exception is detected. | |
| IsValid | Boolean | Indicates whether the process ran correctly | true: The process ran correctly. false: The process ran with errors. |
| StatusCode | String | Response code or process status. | Example: 200: The request ran correctly 500: The process ran with errors |
| StatusMessage | String | Description of the process execution status | Examples: OK La información recibida no tiene el formato correcto |
| OtherData | Array | List of documents to mark as received or downloaded, with the corresponding response for each one | Examples: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: OK Document with GlobalDocumentId 00000000-0000-0000-0000-000000000001 not found. Document with GlobalDocumentId 00000000-0000-0000-0000-000000000002 downloaded |
| GlobalDocumentId | String | Document identification in Gosocket. | 00000000-0000-0000-0000-000000000000 |
Note: Response parameters not specified in the table always come back empty or null because this is a batch or bulk process.
Characteristics of the ConfirmReceivedDocument method
You can mark 1 or n documents as received.
- This method must be used together with the GetReceivedDocument method, in order to get the Ids (globalDocumentId) of the documents to mark as received.
- When the request is made for a valid document, the process response in OtherData will be "OK".
- When the request is made several times for the same document, the process response in OtherData will be: "Document with GlobalDocumentId 00000000-0000-0000-0000-000000000002 downloaded."
- When the request is made with an Id that does not exist, the process response in OtherData will be: "Document with GlobalDocumentId 00000000-0000-0000-0000-000000000001 not found".