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

OData Query

ShivaniParihar
Participant
0 Kudos
688

Hello team,

We're trying to build OData query to Get all email marketing permissions for records who have explicitly given their permission on a particular day and records originating from a specific Origin - SAP_C4C_BUPA in this case.

1. I constructed the query for the part "Get all email marketing permissions for records who have explicitly given their permission on a particular day" as follows -

/sap/opu/odata/sap/API_MKT_CONTACT_SRV;v=3/MarketingPermissions?$filter=CommunicationMedium eq 'EMAIL' and PermissionIsImplicit eq false and LastChangeDateTime gt datetimeoffset'2021-12-22T00:00:00.001'&$top=5000

2. For the part records originating from a specific Origin - SAP_C4C_BUPA, I'm struggling to develop a query. I can get a particular ID with ID Origin as below, but not records with a specific ID Origin -

/sap/opu/odata/sap/API_MKT_CONTACT_SRV;v=0003/ContactOriginData(ContactID='C98979992 ',ContactOrigin='SAP_C4C_BUPA')?$expand=MarketingPermissions

In summary, I'm looking to build a single query to get all email marketing permissions for records who have explicitly given their permission on a particular day and records originating from a specific Origin - SAP_C4C_BUPA in this case.

I tried achieving this using the below query but it is not working -

/sap/opu/odata/sap/API_MKT_CONTACT_SRV;v=0003/ContactOriginData(ContactOrigin='SAP_C4C_BUPA')?$expand=MarketingPermissions($filter=CommunicationMedium eq 'EMAIL' and PermissionIsImplicit eq false and LastChangeDateTime gt datetimeoffset'2021-12-22T00:00:00.001')

Can you help me please.

Thanks,
Pushpak

Accepted Solutions (1)

Accepted Solutions (1)

former_member599277
Contributor
0 Kudos

Dear Pushpak,

I checked your requirement and as mentioned in the below KBA

2633494 - odata v2 version is not supporting filter option on the expanded entities

Even our Contact API is using Version 2 and so it wont support filter options on expanded entities , we can only filter on target entities

To use Contact Origin without Contact ID , we have to use filter as below

/sap/opu/odata/sap/API_MKT_CONTACT_SRV;v=0004/ContactOriginData?$top=20&$expand=MarketingPermissions&$filter=ContactOrigin eq 'SAP_C4C_BUPA'

but filter on expanded entity permission is not supported.

Hope this clarifies your query.

Regards,
Saravana.

Answers (0)