Marked as obsolete (ref: https://xmatters.atlassian.net/browse/DOC-10377)
This article describes how web service requests from the Integration Agent to a hosted xMatters instance may fail due to a 202 response, and provides instructions for updating integration scripts to handle 202 responses.
Many integration scripts and Integration Agent utility scripts do not include logic to handle 202 responses. This can cause the script to stop processing the current notification request, even though the request has been accepted by xMatters and notifications can be expected to succeed.
Requests that may fail due to this condition include:
A 202 response does not signify that the request has failed; rather, it indicates the request content has been accepted for processing, and processing is not yet complete. Incorrect handing of the 202 response by the integration service can cause the following undesirable consequences:
- Subsequent processing of the notification request (such as an annotation being sent to the management system) may be abandoned.
- The client may be concerned about resulting error messages in the Integration Agent log files.
In most integrations, the code that handles sending requests to xMatters is encapsulated in the
XMRESTAPI functions. The exception is the
submitApxml function, which is typically found in the main integration scripts rather than the
Therefore, you will usually need to modify the
XMRESTAPI script file and the main integration files to resolve the problem.
To update the
XMRESTAPI functions to handle 202 responses:
- Back up
<IAHome>\lib\integrationservices\xmrestapi.jsand then open it with a text editor.
- Search for:
- On a separate line, append:
- Next, search for:
- Replace it with:
To update the main integration scripts to handle 202 responses:
- Search the integration script files for any instance of "XMRESTAPI.RESPONSE_SUCCESS".
- Typically, the code will be very similar to:
- Back up any such script files and open them with a text editor.
- Append "|| (response.status == XMRESTAPI.RESPONSE_SUCCESS_ACCEPTED)"
- For example, replace:
- For example, replace:
- Search for and update any other instances of the above code (typically there will be just one).
- Save the files and restart the Integration Agent.
xMatters internal reference:
DTN-6369 Originally by Jeremy Brown