cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Offers which are Active

deanmg1
Participant
0 Likes
604

Hi,

We need to find a way to search Offers via the available API's which are in the Active state

This is available on the UI, in the Offer App, see below image:

Seemingly none of the API's cater for this 'Active' flag

Note: this is not purely a Status (Internal or External), it seems to be based on specific criteria of the Offer. Such as dates of validity, status and content availability

Filtering using dates only gets very tricky, we have hundreds of thousands of available offers which start and end on different dates

Anyone know exactly what the "Active" on the UI calls to get those offers?

Or better yet, how to get Active only Offers via the APIs?

  • API_MKT_OFFER_SRV
  • CUAN_OFFER_IMPORT_SRV
  • CUAN_OFFER_DISCOVERY_SRV

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member226
Employee
Employee

Hi,

You can use following URL to get the "active" offers as of today:

https://<SMC_HOST>:<PORT>/sap/opu/odata/sap/API_MKT_OFFER_SRV/Offers?$top=100&$inlinecount=allpages&... eq '01' and OfferEndDateTime ge datetimeoffset'2021-09-06T00:00:00.0000000Z'

deanmg1
Participant
0 Likes

Thanks

I forgot about the GE operator.

This API requires the TOP parameter... but I don't see much documented around paging on this API

I'm trying to get to OfferContentUUID is as few calls as possible....

former_member226
Employee
Employee
0 Likes

Almost all the APIs in SMC would need $top param to avoid any performance-related timeout issues. In general, SMC follows OData V2 protocol therefore you can refer to http://www.odata.org/documentation/odata-version-2-0/uri-conventions/ to understand how to use various params in APIs. Specifically for paging, you can use $top & $skip.

Following URL will give you OfferContentUUID in a single call for all the active offers.

https://<SMC_Host>:<SMC_Port>/sap/opu/odata/sap/API_MKT_OFFER_SRV/Offers?$top=1000&$inlinecount=allp... eq '01' and OfferEndDateTime ge datetimeoffset'2021-09-04T00:00:00.0000000Z'&$expand=OfferContents&$select=OfferContents/MarketingOfferContentUUID

deanmg1
Participant

Thanks Saurabh,

There is however still a difference. The Is_Active flag seems to consider more than simply the date and status

As an example, using the dates on the UI returns roughly 13500 offers. Then selecting Active = 8500

As you can see, there is a material difference and we are using this to build recommendation models. So any data saving makes a massive difference

I'm going to do VLOOKUPS on the extracted data to see if I can find the differences in the data. There is nothing documented on the Active button and exactly what it considers data wise

Cheers

former_member226
Employee
Employee
0 Likes

hmmm... Then if you findout something intersting with VLookUp then please also let us know and it will help others in future.