AsynchronousRequestsManagementAPI
AsynchronousRequestsManagementAPI
This guide is for a customer developer intending to implement the Asynchronous Requests Management API in a
client application to:
• Monitor job requests that are running asynchronously and initiated by APIs like the Contract Line Items Import
API and the Contract Workspace State Change API.
• Get the status of an ongoing job request and download the error files for failed job requests.
Prerequisites
• To create an application and request access to use the SAP Ariba APIs relevant to this feature, you must have
access to the SAP Ariba developer portal. For details refer to Steps to Start Using the SAP Ariba APIs in Help
for the SAP Ariba Developer Portal.
• All queries made to this API must be authenticated using OAuth authentication. For details refer to SAP Ariba
Developer Portal Authentication in Help for the SAP Ariba Developer Portal.
• User whose credentials are passed in the API call must be the initiator of the job or must have permissions to
view the job.
Restrictions
The size of the error file that can be downloaded using the API cannot exceed 2 MB.
Endpoint Description
GET /jobs/{jobId} Queries the status of the asynchronous job request initiated by
an API for the specified job ID.
GET /jobs/{jobId}/errors Downloads the error file generated for the specified job ID.
1. The client application queries the status of the asynchronous job request initiated by an API for the specified
job ID using the GET /jobs/{jobId} endpoint.
2. If the job request for the specified job ID has failed, an error file is available. The client application downloads
the error file using the GET /jobs/{jobId}/errors endpoint by providing the job ID.
Prerequisites
To get the status of an asynchronous job, you must have the ID of the job.
An asynchronous job request initiated by an API runs as an independent process in the background. To track
the progress of such job requests, you can use the Asynchronous Requests Management API. The GET /jobs/
{jobId} endpoint enables you to get the current status of any asynchronous job request.
Note
In the sample URLs in this topic, replace {{runtime_url}} with the desired runtime URL from the
Environment Details table on the SAP Ariba developer portal discovery page for this API.
Procedure
Example
GET {{runtime_url}}/jobs/QHFHUUF6BMJDIXFxSA?
user=myUser&passwordAdapter=myPassword&realm=mySite
Where,
• user, is the unique name of the user on whose behalf the API call is invoked. This is a required parameter.
• passwordAdapter, is the password adapter for authenticating the user on whose behalf the request was
initiated. This is a required parameter.
• realm, is the SAP Ariba Contracts site to which the API request is sent. This is a required parameter.
You can append the job ID in the URL or pass it like a parameter as a path variable.
Results
If the request is successful, the API returns the status of the job request corresponding to the specified job ID
along with other related details such as the submit time, start time, complete time, and the user who created the
asynchronous job request. For more information about the response codes returned by the API, see Response
Codes Returned by Asynchronous Job Requests API [page 7].
Prerequisites
To download the error file for a failed job request, you must have the ID of the job.
Context
The GET /jobs/{jobId}/errors endpoint of the Asynchronous Requests Management API enables you to
download the error file of a failed job request. You can download the error file in the available file format.
Note
In the sample URLs in this topic, replace {{runtime_url}} with the desired runtime URL from the
Environment Details table on the SAP Ariba developer portal discovery page for this API.
Procedure
Example
GET {{runtime_url}}/jobs/QHFHUUF6BMJDIXFxSA/errors?
user=myUser&passwordAdapter=myPassword&realm=mySite
Where,
• user, is the unique name of the user on whose behalf the API call is invoked. This is a required parameter.
• passwordAdapter, is the password adapter for authenticating the user on whose behalf the request was
initiated. This is a required parameter.
• realm, is the SAP Ariba Contracts site to which the API request is sent. This is a required parameter.
You can append the job ID in the URL or pass it like a parameter as a path variable.
• If the response code is 200, the API returns the error file in the available file format, which specifies the reason
for the incomplete job request.
• If the response code is 204, the API doesn't return any error file, which indicates that either the job request was
successfully completed or there is no error file associated with the specified job ID.
If the request is unsuccessful, the API returns a appropriate response code. For more information about the
different response codes returned by the API, see Response Codes Returned by Asynchronous Job Requests API
[page 7].
200 Success.
403 User does not have the required permissions to access the
content.
Access to this API is available to you as a subscriber to this solution as part of the SAP Cloud Service Level
Agreement. However, it is not considered part of the solution. Use of this API is purely optional and is subject to
restrictions stated in the documentation, including the Terms of Use and the documentation found at the SAP
Ariba developer portal (see https://developer.ariba.com/api ). If you wish to connect a third-party service using
this API, first confirm that the company is participating in the SAP partner program and is authorized to provide a
Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:
• Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your agreements
with SAP) to this:
• The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
• SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.
• Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering an SAP-hosted Web site. By using such links,
you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this information.
Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax and
phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of example
code unless damages have been caused by SAP's gross negligence or willful misconduct.
Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities, genders,
and abilities.