How to Subscribe a Profile to a Subscription
This guide will show you how to subscribe a Profile to a Subscription inside a Folder for email communications, by specifying the Email Keyspace and corresponding Profile Key (email address).
To subscribe a Profile to a Subscription we'll need the following.
Valid Section from the APSIS One account
Valid Folder from the Section
Valid Subscription from the Folder
The Email Keyspace
A Profile Key for the Email Keyspace, an email address.
Ready?
Start by fetching the Section:
Per region host names
APSIS One API is provided under different host names depending on your region. For EU use https://api.apsis.one/, for APAC call https://api-apac.apsis.one/.
curl --request GET \ --url https://api.apsis.one/audience/sections \ --header 'authorization: Bearer '
A successful call will return the following JSON object.
{ "items": [ { "discriminator": "usercreated.sections.apsis_data-huid9arn25", "name": "APSIS Data", "description": null } ] }
Then fetch the Folder from the Section.
curl --request GET \ --url https://api.apsis.one/audience/sections/usercreated.sections.apsis_data-huid9arn25/consent-lists \ --header 'authorization: Bearer '
A successful call with the full Folder will look like this.
{ "items": [ { "discriminator": "usercreated.targets.all_profiles-5dwg9vo4f1", "name": "All Profiles", "description": null } ] }
Proceed to get the Subscriptions from a Folder you got previously from the Section.
curl --request GET \ --url https://api.apsis.one/audience/sections/usercreated.sections.apsis_data-huid9arn25/consent-lists/usercreated.targets.all_profiles-w6k6v1vnxu/topics \ --header 'authorization: Bearer '
A successful call will return the following JSON object.
{ "items": [ { "discriminator": "usercreated.topics.jeans-zz8xl5pcnp", "name": "Jeans", "description": null }, { "discriminator": "usercreated.topics.jacket-ishl98sfdi", "name": "Jacket", "description": null }, { "discriminator": "usercreated.topics.sweater-ufm96dn2e8", "name": "Sweater", "description": null }, { "discriminator": "usercreated.topics.accessories-djf83475r7", "name": "Accessories", "description": null } ] }
The next step is to associate the Profile with the Subscription. This Subscription, of course, from the Folder in the Section we're working with.
For this example, we'll use:
The standard Email Keyspace:
com.apsis1.keyspaces.email
The Profile Key:
andy@apsis.com
curl --request POST \ --url https://api.apsis.one/audience/keyspaces/keyspace/profiles/andy%40apsis.com/sections/usercreated.sections.apsis_data-huid9arn25/subscriptions \ --header 'authorization: Bearer ' \ --data '{"consent_list_discriminator":"usercreated.targets.all_profiles-5dwg9vo4f1","topic_discriminator":"usercreated.topics.jeans-zz8xl5pcnp"}'
A successful call with return a HTTP 201 Created
status code with the following JSON object.
{ "id": "dXNlcmNyZWF0ZWQudGFyZ2V0cy5hcHNpc19kYXRhLWplZjZwM2M2M2NfdXNlcmNyZWF0ZWQudG9waWNzLnRlc3QtbzVubTZwdjcycQ==", "consent_list_discriminator": "usercreated.targets.all_profiles-5dwg9vo4f1", "topic_discriminator": "usercreated.topics.jeans-zz8xl5pcnp" }