cancel
Showing results for 
Search instead for 
Did you mean: 

startDate in Positions API

PerforsN
Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Pandiri_Naveen_
Employee
Employee

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>
PerforsN
Participant
0 Kudos

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

PerforsN
Participant
0 Kudos

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