Standard Responses

The Metadata Push API uses a standard response format. Below are the HTTP response and examples.

Response Codes

HTTP Status Code Description
200 Success
400 Bad Request
401 Authorization Error
500 Internal Server Error

Every error response message contains an errorCode field. See the error codes page for a complete list of error codes and descriptions.

Response Description

Below are the JSON fields included in the response.

Field Datatype Required Description
messageId String Yes The messageId string that matches the one sent in the request.
status Object Yes The status object contains success/error status and any error messages.

Status

Field Datatype Required Description
success Boolean Yes True if the client successfully processes the entire request. False otherwise.
message String No Status message describing the response
errors Array No List of errors associated with objects sent in the request object. See the Error Codes List.
Required only in case there is a failure.

Error

Field Datatype Required Description
objectCode String No The object code for which the validation error occurs.
Required in case of any validation errors for the object, such as a missing field or an invalid field value.
errorMessage String Yes Error message describing the cause of the failure.
errorCode Integer Yes Error code for the failure. See the Error Codes List.

Examples

Success

Http Status Code: 200
{ 
    "messageId": "4ssafea795-7ae1-45c3-8d31-07788ebd2484", 
    "status": { 
        "success": true, 
        "message": "message received successfully"
    }
}

Validation Error 

Http Status Code: 400
{     
    "messageId": "4ssafea795-7ae1-45c3-8d31-07788ebd2484",     
    "status": {
         "success": false,
         "message": "Validation failed due to missing fields.",
         "errors":[{
             "objectCode":  "HTPKG",
             "errorCode": "4005",
             "errorMessage": "required field {field} missing"
         }]
    } 
}

Authorization Error

Http Status Code: 401
{
  "messageId": "4ssafea795-7ae1-45c3-8d31-07788ebd2484",
  "status": {
    "success": false,
    "message": "Invalid Credentials",
    "errors": [
      {
        "errorCode": "4001",
        "errorMessage": "Authentication failed. Invalid credentials provided."
      }
    ]
  }
}

Internal Server Error

Http Status Code: 500
{
     "messageId": "4ssafea795-7ae1-45c3-8d31-07788ebd2484",
     "status":{
             "success": false,
             "message": "Internal Server Error",
             "errors":[
                {
                     "errorCode": "4099",
                     "errorMessage": ""An unexpected error occurred."
                }
             ]
     }
 }