Retrieving the IDs of Projects Created or Modified During a Specified Time Period by Using the Sourcing Project Management API
This procedure describes how buyers using SAP Ariba Sourcing solutions can use the Sourcing Project Management API to retrieve the list of project IDs of projects created, modified, or both created and modified within a specified time period.
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.
Context
Procedure
|
When You Want to Retrieve Sourcing Projects... |
Send a Request with the $filterQuery Parameter... |
Example |
|---|---|---|
|
Created within a specified time period |
$filter=(createDateFrom gt dateTime and createDateTo lt otherDateTime) |
GET {{runtime_URL}}/projects?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite&$filter=(createDateFrom gt 1691677865000 and createDateTo lt 1691764282000)
|
|
Modified within a specified time period |
$filter=(modificationDateFrom gt dateTime and modificationDateTo lt otherDateTime) |
GET {{runtime_URL}}/projects?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite&$filter=(modificationDateFrom gt 1691677865000 and modificationDateTo lt 1691764282000)
|
|
Created and modified within specified time periods |
$filter=((createDateFrom gt dateTime and createDateTo lt otherDateTime) and (modificationDateFrom gt dateTime and modificationDateTo lt otherDateTime)) |
GET {{runtime_URL}}/projects?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite&$filter=((createDateFrom gt 1691677865000 and createDateTo lt 1691764282000) and (modificationDateFrom gt 1691677865000 and modificationDateTo lt 1691764282000))
|
-
dateTime is the start date and time stamp in milliseconds in the Unix epoch time format for created date (createDateFrom) or modified date (modificationDateFrom)
-
otherDateTime is the end date and time stamp in milliseconds in the Unix epoch time format for created date (createDateTo) or modified date (modificationDateTo)
-
user: It is the ID of the user for whom the Sourcing Project Management API will perform the action.
-
passwordAdapter: It is the password for authenticating the user, such as PasswordAdapter1.
-
realm: It is your site name.
-
$select: Specify attributes to return in the response. If no attribute is specified, all attributes are returned.
You can specify a list of attributes, delimited by commas.
Valid values: internalId (the parent project ID), createDate, lastModified.
Example: $select=internalId,createDate
-
$top: Specify the maximum number of projects to return. For example, if $top=10 and the results set contains 100 records, the response will contain the first 10 records.
-
$skip: Specify the number of projects to skip. If no number is specified, no projects are skipped and the response starts with the first project.
For example, if $top=10 and the results set contains 100 records, the response will contain the first 10 records. To retrieve the next set of records in the results set, submit a new query with $skip=10. For the following page, $skip=20 and so on. If $top=10 and $skip=30, the query directly loads the fourth page of results.
The Sourcing Project Management API returns a list of project IDs (internalId), created dates, and last modified dates for projects available within the specified time period.
Example:
{
[
{
"internalId": "WS23304765",
"createDate": "Thu Aug 10 13:29:12 PDT 2023",
"lastModified": "2023-08-10T20:30:18.579+0000"
},
...,
{
"internalId": "WS23271668",
"createDate": "Tue Aug 08 01:40:06 PDT 2023",
"lastModified": "2023-08-08T08:40:12.887+0000"
}
],
}
To troubleshoot your queries to the Sourcing Project Management API, refer to Error Messages Returned by the Sourcing Project Management API.