on 05-11-2022 7:57 AM
Hi,
I'm working on a python wrapper to work with the SAP Commissions API. I ran into a challenge with the Positions API, specifically the List query parameter startDate and endDate.
No matter how I format the date, the below request always fails with a 404, not fond.
GET https://{domainName}/api/v2/positions?startDate=2020-01-01&endDate=2200-01-01
I've tried combinations of startDate and endDate, leaving one out, nothing seems to work.
Hi Niels,
Below is the sample that should work.
GET https://{domainName}/api/v2/positions?$filter=effectiveStartDate eq 2020-01-01 and effectiveEndDate eq 2200-01-01<br>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Big thank you goes to Aditya Raj from SAP Sales Cloud Support.
As it turns out the date format in the List endpoint is different from the Get Versions endpoint.
# List positions based on versions from Jan 1st 2020
GET https://{domainName}/api/v2/positions?startDate=2020/01/01
# Get position versions from Jan 1st 2020 and onward
GET https://{domainName}/api/v2/positions({UUID})?startDate=2020-01-01
yoganandamuthaiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi naveen.pandiri
I'm sorry to say that it doesn't. According to the docs, the startDate and endDate parameters should allow the retrieval of a position version other then the version for today's date.
For example, a position with two versions:
[
{
"name": "First Version",
"effectiveStartDate": "2020-01-01",
"effectiveEndDate": "2020-01-31",
},
{
"name": "Second Version",
"effectiveStartDate": "2020-02-01",
"effectiveEndDate": "2200-01-01",
}
]
the following command does not return any positions (assuming the above is the only position).
GET https://{domainName}/api/v2/positions?$filter=effectiveStartDate eq 2020-01-01 and effectiveEndDate eq 2020-01-31
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.