Consents can be obtained programmatically via API using the endpoint /v1/settings/groups/{id}/optins.
Recovering group consents
Use the GET method with the endpoint /v1/settings/groups/{id}/optins to obtain all the consents for the group informed in the API call.
To obtain the identifier of the desired group, it is possible to obtain it via the endpoint /v1/settings/groups.
In response to the API call, a list of the various consents is sent. It is possible to filter on a specific channel by indicating the desired channel in the API call.
The consent identifier (id field in the endpoint response /v1/settings/groups/{id}/optins) will be requested in the following endpoints:
-
/v1/campaignsfor the creation of a Marketing campaign i.e. that requires the use of consent -
/v1/listsfor the creation of a contact list
Conclusion
Consents can be retrieved programmatically via API at any time.