+

Search Tips | Advanced Search

REST API error handling

The REST API reports errors by returning an appropriate HTTP response code, for example 404 (Not Found), and a JSON response. Any HTTP response code that is not in the range 200 - 299 is considered an error.


The error response format

The response is in JSON format in UTF-8 encoding. It contains nested JSON objects:

Errors with queue sharing groups

In a queue sharing group, it is possible to specify an optional query parameter of commandScope for certain commands. This parameter allows the command to be propagated to other queue managers in the queue sharing group. Any one of these commands can fail independently, resulting in some commands succeeding and some commands failing for the queue sharing group.

In cases where a command partially fails, an HTTP error code of 500 is returned. For each queue manager that generated a failure, information on that failure is returned as an element in the error JSON array. For each queue manager that successfully ran the command, the name of the queue manager is returned as an element in a success JSON array.


Examples


Errors with MFT requests

If MFT REST API services are not enabled, and you invoke the MFT REST API, you receive the following exception:
{"error": [{
  "action": "Enable the Managed File Transfer REST API and resubmit the request.",
  "completionCode": 0,
  "explanation": "Managed File Transfer REST calls are not permitted as the service is disabled.",
  "message": "MQWB0400E: Managed File Transfer REST API is not enabled.",
  "msgId": "MQWB0400E",
  "reasonCode": 0,
  "type": "rest"
}]}
If MFT REST API services are enabled and the coordination queue manager is not set in the mqwebuser.xml file, you receive the following exception:
{"error": [{
  "action": "Set the coordination queue manager name and restart the mqweb server.",
  "completionCode": 0,
  "explanation": "Coordination queue manager name must be set before using Managed File Transfer REST services.",
  "message": "MQWB0402E: Coordination queue manager name is not set.",
  "msgId": "MQWB0402E",
  "reasonCode": 0,
  "type": "rest"
}]}