Response Codes
The Digipost API can return the following HTTP response codes:
- 200 OK
- 201 Created – A (message) resource has been created on the server-side.
- 400 Bad Request – This can mean:
- One of the required HTTP headers is missing.
- The X-Content-SHA256 hash in the header does not match the content of the request.
- The date specified in the header is not in the correct format or the date specified deviates from the date/time on the Digipost server by more than five minutes.
- Subject is blank.
- The message-id has been previously used.
- The document/file type is not supported.
- The XML does not validate according to the XSD.
- 403 Forbidden – This can mean:
- You have not uploaded a certificate for your organisation.
- The signature is incorrect.
- You are not authorized to access the requested resource.
- 404 Not Found – If you are trying to create a message resource, this means the person you wish to send to is not a Digipost user or has deactivated their Digipost account. Otherwise, it is a normal «not found» error.
- 409 Conflict – You have attempted to send the actual file content even though the message status is not NOT_COMPLETE.
- 500 Internal Server Error – This is an error in the Digipost solution.
Most messages from Digipost with include an explanation of the error that occurred. It is therefore very helpful to read these error descriptions. We recommend that you log the error messages that you receive, since this will make troubleshooting much less painful.