Set up API to subscribe to service via email form | Community
Skip to main content
filipe23353816
Level 2
March 20, 2023
Solved

Set up API to subscribe to service via email form

  • March 20, 2023
  • 1 reply
  • 2386 views

Hi,

How could I set up an API call from our website where we have a signup form with email address and then match the email address with a profile and subscribe the profile to a specific service? Or if a profile is not found on the email a new profile is created.

Is this possible? I tried to check the documentation but had a hard time understanding the logic.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SatheeskannaK

Hi @filipe23353816,

 

I believe the below steps/process helps addresses your need.

 

Step1:
Setup filter with email address

https://experienceleague.adobe.com/docs/campaign-standard/using/developing/adding-or-extending-a-resource/configuring-filter-definition.html?lang=en

 

Step2:

Make a GET call on the email address
GET https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/byEmail?email=<<email_address>>

Retrieve the subscriptions URL from the response.

 

Step3:

If you don't find the record with the email address for the GET request made previously create the profile and subscribe to the service by following steps 4, 5, &6 else jump to step 7.

 

Step4:

To create a profile

POST https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/

 

Step5:

GET call on the email address
GET https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/byEmail?email=<<email_address>>

Retrieve the subscriptions URL from the response.

 

Step6:

Perform a POST request on the subscriptions URL with the desired service Primary Key inside the payload.

POST https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

-d '{"service":{"PKey":"<PKEY>"}}

 

Step7:

If the profile found with the email address perform a GET request on the subscriptions URL received from step 2.

GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

It returns the list of services to which the profile subscribed.

 

Step8:

If you don't see the subscription service for the profile create a subscription for the service.

Perform a POST request on the subscriptions URL with the desired service Primary Key inside the payload.

POST https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

-d '{"service":{"PKey":"<PKEY>"}}

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
March 20, 2023

Hi @filipe23353816,

 

I believe the below steps/process helps addresses your need.

 

Step1:
Setup filter with email address

https://experienceleague.adobe.com/docs/campaign-standard/using/developing/adding-or-extending-a-resource/configuring-filter-definition.html?lang=en

 

Step2:

Make a GET call on the email address
GET https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/byEmail?email=<<email_address>>

Retrieve the subscriptions URL from the response.

 

Step3:

If you don't find the record with the email address for the GET request made previously create the profile and subscribe to the service by following steps 4, 5, &6 else jump to step 7.

 

Step4:

To create a profile

POST https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/

 

Step5:

GET call on the email address
GET https://mc.adobe.io/<<ORGANIZATION>>/campaign/profileAndServicesExt/profile/byEmail?email=<<email_address>>

Retrieve the subscriptions URL from the response.

 

Step6:

Perform a POST request on the subscriptions URL with the desired service Primary Key inside the payload.

POST https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

-d '{"service":{"PKey":"<PKEY>"}}

 

Step7:

If the profile found with the email address perform a GET request on the subscriptions URL received from step 2.

GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

It returns the list of services to which the profile subscribed.

 

Step8:

If you don't see the subscription service for the profile create a subscription for the service.

Perform a POST request on the subscriptions URL with the desired service Primary Key inside the payload.

POST https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions

-d '{"service":{"PKey":"<PKEY>"}}

Thanks, Sathees
filipe23353816
Level 2
June 12, 2023

Hi,

What constitutes the <ORGANIZATION> and <PKEY> and how can I find these values?

SatheeskannaK
Community Advisor
Community Advisor
June 12, 2023

@filipe23353816 , You can find these from Adobe I/O Consle (https://developer.adobe.com/console/home)

Thanks, Sathees