Get subscriptions from the API and withdraw consents

Hi

I'm wondering where in the WebAPI I can find these subscriptions for the GDPR page? I think they are added in the shipment type table? I did find them here though:

https://community.superoffice.com/documentation/sdk/SO.NetServer.Web.Services/html/Reference-MDOProviders-shipmenttype.htm

But is this the place you want us to retrieve them from? And what if they are changed or new ones are added, do you have a webhook to listen for these changes?

 

And I see that we are suppose to use these constants for updating consents on a person, 61A, 61B, 61F etc. These are global constants right? Though if a person withdraw consents, is this the correct way of doing it?

PUT /api/v1/person/{id}/consent/EMARKETING?source=API&legalBase=Withdrawn&comment=OurApp

There are no constant for Withdrawn?

Thanks for any replies!

RE: Get subscriptions from the API and withdraw consents

Hi Stian,

Yes, the person webhooks do support notification when a person consent change.

Get the Purpose items (use the Key to get STORE or EMARKETING):

GET /api/v1/List/ConsentPurpose/Items​


Get the Source items (use key to get USER, EMAIL,REQUEST,CHAT,WEBFORM,...):

GET /api/v1/List/ConsentSource/Items
 
Get the LegalBase items (use key to get 61A-61F,WITHDRAW) :
 
GET /api/v1/List/LegalBase/Items​
 
Get the ShipmentType (use name to Invitations, News, Promotions, ...):
 
GET /api/v1/List/ShipmentType/Items
 
Get person IDs who have EMARKETING consent:

@query = consentperson.person_id
@filter = consentperson.consentpurpose_id eq 2
GET /api/v1/archive/dynamic?$select={{query}}&$filter={{filter}}
Authorization: Bearer {{token}}
Content-Type: application/json
Accept: application/json​
Determine if certain people have EMARKETING consent:
 
@query = consentperson.person_id
@filter = consentperson.person_id in (5,7,17) and consentperson.consentpurpose_id eq 2 and 

GET /api/v1/archive/dynamic?$select={{query}}&$filter={{filter}}
Authorization: Bearer {{token}}
Content-Type: application/json
Accept: application/json​
 
Alternatively:
 
@filter1 = consentPerson/person/personId in (7,17) 
@select1 = consentPerson/person/personId,active,key,name,consentPerson/comment
GET /api/v1/Archive/ConsentPurpose?$select={{select1}}&filter={{filter1}}
Authorization: Bearer {{token}}
Content-Type: application/json
Accept: application/json
 
 
Af: Tony Yates 1. dec 2020

RE: Get subscriptions from the API and withdraw consents

Thank you very much for the reply!

Is there some documentation for the specific entities? So that I can select more fields from the persons also when using that dynamic endpoint? I guess that the query:

v1/archive/dynamic?$select=consentperson.person_id&$filter=consentperson.consentpurpose_id eq 2

Retrieves all person that has given an emarketing consent, could you also select legalbase, emails, mobilephones, fullname etc too? I couldn't manage to create such a query. That would simplify some logic we have in our app.

Af: Stian Prestholdt 1. dec 2020

RE: Get subscriptions from the API and withdraw consents

Hi Stian,

Using the dynamic provider is the closest you can get to issuing raw sql queries to the database. All of the available fields you use to construct the query are not from pre-defined archive providers, which have their own "available (supported) columns" definitions. With the dynamic archive provider you must use what's referred to as DotSyntax, a query-like construct where you specify fields directly from the database. 

Here is a link to the docs about how to use the DotSyntax query syntax. Although this info resides in the Customer Service docs, it's the same content that matters.

Here is a link the database reference guide, and list of tables.

Couple [advanced] Examples:

Hope this helps!

Af: Tony Yates 3. dec 2020