Request/Response

Top-level overview of Request and Response objects/codes used within CargoDocs API

Request Type

CargoDocs API HTTPS request support is limited to a subset of RFC 2616 for Sandbox, UAT, and Production APIs. Here are the API method types currently available within the API.

Request TypeDescription
GETMost common and widely used methods within API. CargoDocs methods use GET to retrieves relevant details within the system.
POSTCommon search and set methods within CargoDocs API are handled through POST. /parcels/${parcelId}/actions is one of an example of POST.

Response Codes

CargoDocs uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • 200 OK indicates a successful transaction.
  • 403 Forbidden relates to Acces Denied Config Issue.
  • 401 Unauthorized occurs when invalid credentials are provided.
  • 400 Bad Request is for invalid data passed onto the request.
  • 500 Internal Server Error occurs when anything goes wrong in CargoDocs API.
  • 503 Service Unavailable is a default HTTP response in case of a non-responsive service.

📘

Response Error Object

A typical Error response object looks like:

{
"errorMessage": "Unauthorized user access"
}

❗️

Graceful Error Handling

Our libraries raise exceptions for many reasons, such as parameters issues, authentication errors, and network unavailability. We recommend writing code that gracefully handles all possible API exceptions.

🚧

Additional HTTP Response Codes

Other standard HTTP errors may be generated by our stack and not directly from our API. Here are the categories of possible Standard HTTP response codes.

1xx: Communication transfer protocol-level information.
Informational

2xx: This indicates that the client's request was accepted successfully.
Success

3xx: Indicates that the client must take some additional action to complete their request.
Redirection

4xx: This category of error status codes points to the clients.
Client Error

5xx: This category of error is related to server exceptions due to internal incapability to perform the request. The user is advised to contact essCert Support.
Server Code

For more information please refer https://developer.mozilla.org/en-US/docs/Web/HTTP/Status