NAV Navbar
Logo
shell

alt text

Introduction

Welcome to the Adobe Campaign Standard API!

Our API is aimed at letting you create integrations for Adobe Campaign Standard and build your own ecosystem by interfacing Adobe Campaign Standard with the panel of technologies that you use.

With the Adobe Campaign Standard API, you get access to the following functionalities:

The APIs we provide use standard concepts with a REST interface and JSON payloads.

All the endpoints are described extensively in this documentation with the general notions you should know for manipulating the API, the complete API reference, code examples and quick start guides.

If anything is missing or seems incorrect, please ask the community.

Recommendations

All the examples work with Postman but feel free to use your favorite REST client.

Let’s start with the API

Authentication

To use the Campaign Standard API, you need an Adobe I/O account. This is a mandatory first step to go forward and discover the API features.

Consult AdobeIO configuration section.

Retrieving Profiles

Simple GET example to retrieve the first 10 email values:

$curl 
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServices/profile/email?_lineCount=10"

The above command returns the following JSON:

{
  "content": [
    "amy.dakota@mail.com",
    "kristen.smith@mail.com",
    "omalley@mail.com",
    "xander.harrys@mail.com",
    "jane.summer@mail.com",
    "gloria.boston@mail.com",
    "edward.snow@mail.com",
    "dorian.simons@mail.com",
    "peter.paolini@mail.com",
    "mingam+test08@adobe.com"
  ],
  "next": {
    "href": "/profileAndServices/profile/email?_lineCount=10&_
    lineStart=@Qy2MRJCS67PFf8soTf4BzF7BXsq1Gbkp_e5lLj1TbE7HJKqc"
  }
}

The “next” node returns the URL that gives you access to the 10 next email values. To know more about pagination , go to:

Here is a simple GET example to retrieve the first 10 email values.

To know more about the GET operation, consult the Basics operation section.

To know more about the metadata of the profile API, consult the Metadata mechanism section.

Updating Profiles

$curl 
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io//campaign/profileAndServices/profile/byEmail?email=amy.dakota@mail.com"

The profile phone field is empty.

curl 
-X PATCH \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
-d "{"phone":{"3301020304"}" \
"https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile/@_jKvoiXy0cwpwubaOvcBhots0PUNfzWuzD8RSsDs1
uvDiF0QzM1rwIraB7PHEdyEgPjl_5AOtO82WWAiCFlhbydsdAw"

The patch operation on the PKey of the profile with the email ‘amy.dakota@mail.com’ adds the phone number value.

In this second example, we want to update the phone field in a profile with an email value equals to “amy.dakota@mail.com”.

The first step is to retrieve the profile. To accomplish this GET operation, we use the filter “byEMail”. To know more about filters and how to use them, read the filters section.

Then, in a second operation, we will apply the PATCH operation on the profile with the completed phone number in the payload.

The PKey value of the profile must be integrated in the URL.

The PATCH pattern is:

http://../{apiName}/{resourceName}/{PkeyValue}

To know more about PATCH, read the Basics operation section.

To check if the PATCH operation has updated the profile, we can perform a final GET operation.

Global Concepts

Url Patterns

Collections of resources are available using the following URL type:

https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/

Individual resources from a collection are available using the following URL type:

https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/{resourceID}

Resources Representation

$ curl 
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServices/profile/PostalAddress.xml?_lineCount=1"

Returns the following XML node:

<content>
    <content addrDefined="false" addrErrorCount="0" addrQuality="0"
    line1="Amy DAKOTA" line6="PARIS" serialized="Amy DAKOTA&#10;&#10;&#10;&#10;&#10;PARIS"/>
    <next href="/profileAndServices/profile/postalAddress?_lineCount=1&amp;_lineStart=@RwtyJ5tzTrzmA4FWiWBJfsA2HL6rFByrI3oF888fsu5_-rBv"/>
</content>

All API resources are available in JSON and XML with an URL extension or inside an HTTP Accept Header.

Without extension in the URL, the json format is the default one.

EndPoints

The available endpoints for Adobe Campaign REST API are:

For profileAndServices and profileAndServicesExt APIs , we have two major endpoints:

Get / Post / Patch / Delete

Sample GET request on a collection

$ curl  
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/

Sample GET request on a record

$ curl  
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/[$Pkey]

Sample POST request

$ curl 
-X POST \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
-d '{"field":"value"}' \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/

Sample PATCH request

$ curl 
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
-x PATCH \
-data '{"field":"value"}' \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/[$Pkey]

Sample DELETE request

curl 
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
-x DELETE \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/{resourceName}/[$Pkey]

Counting

To count all the profiles that have an email value equaling to “toto@mail.com”, perform a GET operation with a filter:

$ curl 
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServicesExt/profile/byEmail/email='toto@mail.com'

It returns the collection and the count URL. Perform now a GET operation on the count URL:

$curl 
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServicesExt/profile/byEmail/_count?email=toto@mail.com&_lineStart=@W6ccO_RJ3iFc90mlPmuxV23z9Kf6oJKcb_XmTQXu9ZDj8Mrz"

It returns the count value:

{
  "count": 10
}

The Adobe Campaign REST API can count the number of records.

Counting is often used with filters. Consult the filter section to know more about filters.

Pagination

For example, this curl command will return only two records:

$ curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServices/profile?_lineCount=2"

Adobe Campaign REST API gives ability to limit the number of lines in a list. The _lineCount parameter must be used.

Sorting

$ curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServices/profile/email?_order=email&_lineCount=10"

Returns the first ten emails in the database alphabetically ordered:

{
  "content": [
    "adam@email.com",
    "allison.durance@example.com",
    "allison.durance@example.com",
    "amy.dakota@mail.com",
    "andrea.johnson@mail.com",
    "andrea.xiuxiu@testoutlook.com",
    "audrey.davis@mail.com",
    "babel_martin@testlaposte.net",
    "barbara.cooper@mail.com",
    "bette.grant@mail.com"
  ],
  "next": {
    "href": "/profileAndServices/profile/email?_order=email&_lineCount=10&_lineStart=@Qy2MRJCS67PFf8soTf4BzF7BXsq1Gbkp_e5lLj1TbE7HJKqc"
  }
}

Returns the email in the database in a descending alpha order:

$curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
"https://mc.adobe.io/{tenant}/campaign/profileAndServices/profile/email?_order=email%20desc"
{
  "content": [
    "tombinder@example.com",
    "tombinder@example.com",
    "timross@example.com",
    "massardi+test03@adobe.com",
    "massardi+test02@adobe.com",
    "massardi+test01@adobe.com",
    "john.smith@example.com",
    "jody.lucassen@example.com",
    "jade.connor@email.com",
    "dannymars@example.com",
    "clarke.mack@example.com",
    "clara.smith@example.com",
    "allison.durance@example.com"
  ]
}

Sorting is available for SQL fields only. Reports to the Reference section to know the list of SQL fields for each resource.

Sorting is also available on every property. A specific flag is available in the resource metadata to know whether or not the property can be ordered. Read the Metadata section.

Sorting is available in ascending or descending order. The ‘%20desc’ or ‘%20asc’ parameter needs to be added in the URL.

Filtering

This two GET operations show how to retrieve the ‘byText’ filter metadata for the ‘profiles’ resource:

$ curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/resourceType/profile \

Returns the URL where the filters are described, then perform the second GET on this URL:

$ curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/resourceType/@eRLFwi-4R1EiyZSdN1WNdM1Xg_ Vd8p0YpAQJkPZbqczGmkFjbqyE8lPqsdG_lE5M0J-AQB10O5X2INB6jOShlWwE_4Kb-XT62GHjsSpZj4_DwQ/filters/

Returns the list of filters for the profile resource and the metadata associated to each filter:

{
    "birthday": { },
    "byEmail": { },
    "byKeysProfile": { },
    "byText": { },
    "profile": { },
    "subscribers": { }
}

Filters are available for each resource.

To identify the filters associated to the resource, you need to perform a GET request on the resource metadata (See metadata). This operation returns the URL where all of the filters are defined for a given resource.

To identify the metadata of the filter and to determine the way to use it, you have to perform a GET request on the previous returned URL.

If you want to add a custom filter, you have to create and customize it in the Adobe Campaign Standard interface. This custom filter will have the same behavior as the out of the box filters.

For each filter, the same metadata structure is available:


























Metadata mechanism

All of the resources have available metadata accessible with the keyword ‘resourceType’ in a GET operation.

This operation retrieves profile metadata:

GET /profileAndServices/resourceType/profile

$ curl
-X GET \
-H "Authorization: Bearer <Access-Token>" \
-H "Cache-Control: no-cache" \
-H "X-Api-Key: <API_KEY>" \
https://mc.adobe.io/{tenant}/campaign/profileAndServices/resourceType/profile \

This JSON gives the complete description of the profile resource

{
"PKey": "yydqXKJxpCCSqfoUYSgU5JqCwCT8h39m1zPO3ygC93A",
"apiName": "resourceType",
"compatibleResources": {},
"content": {},
"data": "/profileAndServices/profile/",
"filters": {},
"help": "Identified profiles",
"href": "/profileAndServices/profile/metadata",
"label": "Profiles",
"mandatory": false,
"name": "profile",
"pkgStatus": "never",
"readOnly": false,
"schema": "nms:recipient",
"type": "item”
}

In the content node, each field of the profile resource is described. For example, the email field:

"email": {
      "PKey": "@vCTlznJfcV7qup-eGkA9hX6fkJ0e9L6jMGNixfphqFYVLKr4qCvdVJjHREoVxY7Kf-Gi-G07JNMqnemCxJJ3Ym8sn88_QWsTXC57uoW8B91v0Htqo7V105ux76Sa9opG2oLFxQ",
      "apiName": "email",
      "category": "03_emails",
      "dataPolicy": "email",
      "desc": "",
      "displayFormat": "",
      "help": "",
      "label": "Email",
      "lazyLoaded": false,
      "length": "128",
      "mandatory": false,
      "metadata": "attribute",
      "privacy": "firstParty",
      "queryable": true,
      "readOnly": false,
      "resName": "",
      "resType": "string",
      "sortable": true,
      "type": "string"
    }

The content node: this is the list of the fields with their characteristics. See profiles API reference to view the complete table.

The data node returns the URL to retrieve the associated data.

The filters node returns the URL to retrieve the associated filters. See [Filters]

All other fields are descriptive or internal.

For each field in the content node, we can find the following fields:

If type is completed with the value “link” or “collection”, the resTarget value is the name of the resource targeted by the link.

If type is completed with the value “enumeration”, a values field is added and each enumeration value are detailed in the values node.

AdobeIO configuration

You must purchase or create a digital signing certificate for your organization before the generation of your API key. You can also use Self-Signed Certificate.

A certificate defines a public key and a private key. In order to make calls to the Adobe Campaign Standard API, you package your API client credentials in a JSON Web Token (JWT) and sign it with the private key.

Adobe uses the public key to authenticate the request.

Follow the next steps to configure your authentication.

Generating private/public keys

Open a terminal window and run the command lines to generate the keys:

openssl req -nodes -text -x509 -newkey rsa:2048 -keyout secret.pem -out certificate.pem -days 356

openssl pkcs8 -topk8 -inform PEM -outform DER -in secret.pem -nocrypt > secret.key

Follow the instructions in the terminal window. At the end of the procedure, two files are created: secret.key and certificate.pem

Configuring keys on AdobeIO

To add, replace or remove your certificates, use the Adobe I/O portal to create or update your API Key.

alt text

Write down the technical info as they’ll be required to get an authentication token, useful ones are:

alt text

Creating a JSON Web Token

To authorize access to the Adobe Campaign API, you must use your API client credentials (API key and secret, API client account ID, and organization ID) to create a JSON Web Token (JWT), and sign it with your private key. The JWT encodes all of the identity and security information that is needed by Adobe to verify your identity and grant you access to the API.

Creation tools

Most modern languages have JWT libraries available. We recommend that you use one of these libraries (or other JWT-compatible libraries) before trying to hand-craft the JWT. Other JWT tools are publicly available, such as the JWT decoder, a handy web-based decoder for Atlassian Connect JWTs.

Building a JWT

Your JWT must contain the following claims pattern:

{
       "exp" : expiry_time,
       "iss" : org_id,
       "sub" : tech_acct,
       "aud" : "https://" + ims_host + "/c/" + api_key,
       "https://" + ims_host + "/s/" + "ent_campaign_sdk" : True
}

The following is a sample payload to be signed and encoded.

{
  "sub": "12345667EDBA435@techacct.adobe.com",
  "iss": "8765432DEAB65@AdobeOrg",
  "exp": 1473901205,
  "aud": "https://ims-na1.adobelogin.com/c/1234-5678-9876-5433",
  "https://ims-na1.adobelogin.com/s/ent_campaign_sdk": true
}





















Sign and encode your JWT

The JWT must be signed and base-64 encoded for inclusion in the access request. The JWT libraries provide functions to perform these tasks.

Generating the access token

To obtain an access token for Campaign, this POST operation based on the JWT allows to receive the access token in the response.

curl 
-X POST https://ims-na1.adobelogin.com/ims/exchange/jwt/ \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cache-Control : no-cache" \
-d "client_id=api_key&client_secret=client_secret&jwt_token=jwt_token" \

If the request is successful, we extract the access token from the body of the response.

This access token value must be used in the header of all your requests.

API Reference

Profiles

Name Type Sortable Queryable
PKey string False False
age integer False True
birthDate date False True
blackList boolean False True
blackListEmail boolean False True
blackListFax boolean False True
blackListMobile boolean False True
blackListPhone boolean False True
blackListPostalMail boolean False True
created date False True
cryptedId string False False
domain string False True
email string False True
emailFormat enumeration False True
fax string False True
firstName string False True
gender enumeration False True
lastModified date False True
lastName string False True
location item False True
middleName string False True
mobilePhone string False True
phone string False True
postalAddress item False True
salutation string False True
subscriptions collection True True
thumbnail string False True
title string False False

Filters associated with Profile Resource:

Services

Name Type Sortable Queryable
geoUnit link False True
orgUnit link False True
PKey string False False
appSubscriptions collection False True
builtIn boolean True True
created date True True
desc string True True
end date True True
history collection False True
isTemplate boolean True True
label string True True
lastModified date True True
limitedDuration boolean True True
mainDate date False True
messageType enumeration True True
mobileApps collection False True
mode enumeration True True
name string True True
publicLabel string True True
start date True True
subScenarioEventType string False True
subscriptions collection False True
targetResource string True True
thumbnail string True True
title string False True
unsubScenarioEventType string False True
validityDuration number True True

Filters associated with Service Resource:

Transactional Messages API

Introduction

Once you have created an event, you will have to integrate the triggering of this event into your website.

For example, you want a “Cart abandonment” event to be triggered whenever one of your clients leaves your website before purchasing the products in their cart. To do this, your website web developer must use a REST API.

Calling the event

Call up URL

The POST operation is carried out on an https://mc.adobe.io/{tenant}/campaign/mcCompanyName/EVTcartAbandonment type URL.

The API name is made as follows: “mcCompanyName”.

There are two ways to find the API name “mcCompanyName”:

For example, for an Adobe instance, the parameter value will have “Adobe” as a value. The API will therefore use an https://mc.adobe.io/{tenant}/campaign/mcAdobe/EVTcartAbandonment type URL.

The URL must also contain the ID of the event type in question, in our case: “EVTcartAbandonment”.

Call content

The event content depends on the event type and must conform to the custom resource defined for this type. The API preview button in the resource definition screen provides a call sample. For more on this, refer to the Event configuration section.

Example

Sample event sent by the POST method:

POST mcAdobe/EVTcartAbandonment HTTP/1.1
Authorization: Basic bWNQdXNoOnBhc3N3b3Jk
Content-Type: application/json;charset=utf-8
Content-Length:79

{
"email":"test@example.com",
"expiration":"2016-12-31 23:59:59",
"ctx":
{
  "cartAmount": "$ 125",
  "lastProduct": "Leather motorbike jacket",
  "firstName": "Jack"
}
}

Sample reply to the POST operation:

{
"PKey":"aXe86Qkq_-OqaAnWN6Q96mOfd0TuO9nxAT09PkAuxEU",
"ctx":
{
  "cartAmount": "",
  "lastProduct": "",
  "firstName": ""
},
"email":"",
"eventHistoId":1000,
"expiration":"",
"href":"mcAdobe/EVTcartAbandonment/aXe86Qkq_-OqaAnWN6Q96mOfd0TuO9nxAT09PkAuxEU",
"serverUrl":" https://adobe.com ",
"status":"pending",
"type":""
}

Your query must contain a “Content-Type: application/json” header, as in the example below.

In this reply, the “eventHistoId”, which has a value of “1000” here, corresponds to the ID that allows you to recover information regarding your event.

Event status

Sample reply to the GET operation:

{
"PKey":"aXe86Qkq_-OqaAnWN6Q96n5cVF3EUeDktt8rD5W1RPk",
"ctx":
{
  "cartAmount": "",
  "lastProduct": "",
  "firstName": ""
},
"email":"test@example.com",
"eventHistoId":1000,
"expiration":"2016-12-31 23:59:59.000Z",
"serverUrl":"",
"status":"pending",
"type":"EVTcartAbandonment"
}

The GET operation is carried out on an

https://mc.adobe.io/{tenant}/campaign/mcCompanyName/EVTcartAbandonment/aXe86Qkq_-OqaAnWN6Q96mOfd0TuO9nxAT09PkAuxEU

type URL. Here aXe86Qkq_-OqaAnWN6Q96mOfd0TuO9nxAT09PkAuxEU corresponds to the value of the PKey field which is, in our earlier sample, reply to the POST operation (for more on this, refer to the [Calling the event] section)

Statuses

In this reply, the “status” field, which is “pending” here, allows you to know whether the event has been processed or not.

In the API, the possible statuses are:

Quick Starts

How to create a profile?

This action can be done with a simple POST operation on the profile resource. By default, the submitted payload is in a JSON format.

curl
-X POST https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 
-i 
-d {"email":"test@adobe.com"}

By default with a simple POST operation, it’s possible to create duplicate entries in the Standard database.

If you want to manage duplicates entries you have to extend the profile resource with a new field. This new field must have the type ‘key’.

Then you should perform the POST operation on this new field. If the key already exists in the Standard database, the record will not be created.

How to update an email recipient?

This action can be done with a PATCH operation on the profile resource. The payload contains the list of fields to update in a JSON format. The Primary Key of the profile must be integrated to the called URL.

curl 
-X PATCH https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile/<PROFILE_PKEY>
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 
-i 
-d "{"mobilePhone":"0102030405"}"

How to list all profiles?

This action can be done with a GET operation on the profile resource. You can add some filters, ordering and pagination. To read more information on these parameters, consult the respective sections: Filtering,Sorting and Pagination.

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

How to list the profiles subscribed to a service ?

This is a two-steps procedure. First, you need to retrieve the URL of the subscriptions and then perform a GET operation on the subscriptions collection. The second GET operation will return the list of the available services.

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service/
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

Answer contains the subscription url

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service/<LINK_IDENTIFIER>/subscriptions/
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

How to perform a profile subscription? (Method n°1)

The first method starts from a Profile and the action consists to add a subscription to this profile for a given service. Follow the steps on the right panel.

Retrieve the subscription URL for a given profile

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile/<PROFILE_PKEY>
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

then retrieve the PKey of a service

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

then update the profile subscription URL with service Pkey inside the payload.

curl 
-X POST https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile/<PROFILE_PKEY>/subscriptions
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 
-i 
-d "{"service":{"PKey":"@so2OIDjwhzTn8WebURgqQBRQAkbWqvvmg7Gi5KLUtb40-aewGugmZ8Y_RdzSNMmNuFKoevO_DMDjUDbaUa7rn280rn8"}}"

The POST operation returns the updated profile with the service node completed

{
  "PKey": "@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZXEGAgeA9x1lrtDqd4nlEZ_Op8ADEy5Mnd-81S8PneTZTU-pHfeXKrdvlKHGzuPzzf058oq_-o3w7uNpKX6rMzc1rmyGA",
  "created": "2017-03-03 10:50:55.621Z",
  "email": "",
  "expirationDate": "",
  "href": "/profileAndServices/profile/@ErI2qvtJeKgoTt8sgCkkX6NGhjiOSnX4REgvkGU08oNvMsHe-tw314YvJa3R9JEMQvCy1J0Al0W34vRva6iRWoeUte0/subscriptions/@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZXEGAgeA9x1lrtDqd4nlEZ_Op8ADEy5Mnd-81S8PneTZTU-pHfeXKrdvlKHGzuPzzf058oq_-o3w7uNpKX6rMzc1rmyGA",
  "mobilePhone": "",
  "service": {
    "PKey": "@HbXlQ9tWWjk_O49diRgL146NMSERTz1U8OJr7PPdTYvL4wVAOkTuDmGuJlnCUa368_DQchC97rdcooX0mIiplxXuxXT9xfoF1xYDDCrYu546taQb",
    "title": "Sport Newsletter (SVC1)"
  },
  "serviceName": "",
  "subscriber": {
    "PKey": "@NqAgOby4EoGCAV0JZvdvcIjnMUtNeoIoT2N5iRonOsPNnYL9kkNcg2cDYUfqUx-s6kH23IvKGPOQdQZI1V9PBw_k_5faL0YQQ4INfrMGJGqKk_Ko",
    "title": "Test Profile (test@adobe.com)"
  },
  "title": ""
}

How to perform a profile subscription? (Method n°2)

The second method is to add a subscription to a service for a given profile. You can also follow the steps in the right panel to execute this action.

First, you need to retrieve the Primary Key of a profile.

curl
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

Then retrieve the service endpoint url.

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

It returns the subscription URL:

...

      "subscriptions": {
        "href": "/profileAndServices/service/@so2OIDjwhzTn8WebURgqQBRQAkbWqvvmg7Gi5KLUtb6_GuN766u3vhMiiYOssx-1L9gEidPkNl-mcgR-_QbPe22dSkc/subscriptions/"
      },
...

And then, make a POST operation on the service endpoint with the Primary Key value in the payload.

curl 
-X POST https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service/@so2OIDjwhzTn8WebURgqQBRQAkbWqvvmg7Gi5KLUtb6_GuN766u3vhMiiYOssx-1L9gEidPkNl-mcgR-_QbPe22dSkc/subscriptions/
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 
-i 
-d "{"subscriber":{"PKey": "<Profile_PKey>"}}"

It returns:

{
  "PKey": "@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZXnHIyLN97QA7bPi1Udci7e48Gj_jES1eqyP2x_OxAgz4LUiXGwQ0cawUWxxhYrd5n1yeiGy-QuiDmjUPhIFWxhKA13uQ",
  "created": "2017-03-15 08:32:01.847Z",
  "email": "",
  "expirationDate": "",
  "href": "/profileAndServices/service/@so2OIDjwhzTn8WebURgqQBRQAkbWqvvmg7Gi5KLUtb6_GuN766u3vhMiiYOssx-1L9gEidPkNl-mcgR-_QbPe22dSkc/subscriptions/@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZXnHIyLN97QA7bPi1Udci7e48Gj_jES1eqyP2x_OxAgz4LUiXGwQ0cawUWxxhYrd5n1yeiGy-QuiDmjUPhIFWxhKA13uQ",
  "mobilePhone": "",
  "service": {
    "PKey": "@HbXlQ9tWWjk_O49diRgL146NMSERTz1U8OJr7PPdTYvL4wVAOkTuDmGuJlnCUa368_DQchC97rdcooX0mIiplxXuxXT9xfoF1xYDDCrYu546taQb",
    "title": "Sport Newsletter (SVC1)"
  },
  "serviceName": "",
  "subscriber": {
    "PKey": "@NqAgOby4EoGCAV0JZvdvcOVBZgAOwLgF_9CqofQz7EhLQi3MJPmoMBTqBUklC4P-AWa5RvnTFfhtHulNUu22NOzONwtmtNU8b_8L3vSIaV423YLB",
    "title": "Test  ()"
  },
  "title": ""
}

How to retrieve the list of subscriptions for a profile?

This is a two-steps procedure. First, you need to retrieve the URL of the subscriptions for a given profile and then perform a GET operation on the subscriptions collection. The second GET operation will return the list of the subscriptions for a profile.

Retrieve a profile record

curl
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/profile/<PROFILE_PKEY>
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

Execute a GET on the subscriptions href returned.

curl 
-X GET https://mc.adobe.io/<TENANT>/campaign/profileAndServices/service/<LINK_IDENTIFIER>/subscriptions/
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Cache-Control: no-cache" 
-H "X-Api-Key: <API_KEY>" 

It returns the list of subscriptions for a given profile:

{
  "content": [
    {
      "PKey": "@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZU0AQhqL67dllT2XEXPbKkaXmu9zJQRYt5X0fWlsTqJFQjv0PeI1O_BfVCRNuA9AwvcR6Tf6mwbeh3FCYybGOAM0X1VyQ",
      "created": "2017-03-03 10:54:00.363Z",
      "email": "",
      "expirationDate": "",
      "href": "/profileAndServices/profile/@ErI2qvtJeKgoTt8sgCkkX6NGhjiOSnX4REgvkGU08oNvMsHe-tw314YvJa3R9JEMQvCy1J0Al0W34vRva6iRWoeUte0/subscriptions/@KYvRaw88wU6xvyY-qAEGjw5S5PkzIgMO10exNTqRzZU0AQhqL67dllT2XEXPbKkaXmu9zJQRYt5X0fWlsTqJFQjv0PeI1O_BfVCRNuA9AwvcR6Tf6mwbeh3FCYybGOAM0X1VyQ",
      "metadata": "subscription",
      "mobilePhone": "",
      "service": {
        "PKey": "@so2OIDjwhzTn8WebURgqQD-PGbj9Y_DX9fTQWrKpMWGLz0a340snaccbwDVzOwv69wL-gD3IsldzBZyTi0IQ0V3xSJA",
        "href": "/profileAndServices/service/@so2OIDjwhzTn8WebURgqQD-PGbj9Y_DX9fTQWrKpMWGLz0a340snaccbwDVzOwv69wL-gD3IsldzBZyTi0IQ0V3xSJA",
        "label": "Sport Newsletter",
        "name": "SVC1",
        "title": "Sport Newsletter (SVC1)"
      },
      "serviceName": "SVC1",
      "subscriber": {
        "PKey": "@ErI2qvtJeKgoTt8sgCkkXzYkOR7UWa1D6RKGWCSXtnmtxYO6A_7sE68TV15UqVhfozzWiNSa4cxHTNJ9tGlNggli5yg",
        "email": "demo@adobe.com",
        "firstName": "Demo",
        "href": "/profileAndServices/profile/@ErI2qvtJeKgoTt8sgCkkXzYkOR7UWa1D6RKGWCSXtnmtxYO6A_7sE68TV15UqVhfozzWiNSa4cxHTNJ9tGlNggli5yg",
        "lastName": "Demo",
        "title": "Demo Demo (demo@adobe.com)"
      },
      "title": "Sport Newsletter (SVC1) / Demo Demo (demo@adobe.com)"
    }
  ],
  "count": {
    "href": "/profileAndServices/profile/@ErI2qvtJeKgoTt8sgCkkX6NGhjiOSnX4REgvkGU08oNvMsHe-tw314YvJa3R9JEMQvCy1J0Al0W34vRva6iRWoeUte0/subscriptions/_count?_lineStart=@QOvMafjR1qavxAfSzQd2fkdMfqyxebvd-kTnoCsZqyD1TTfo",
    "value": 1
  },
  "serverSidePagination": true
}

Troubleshooting

You can only create API Keys for the IMS organizations you are admin of. If this message is displayed and you want to create API Keys and you want to ask one of the administrator of the IMS organization.

$ "curl -X GET -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "Cache-Control: no-cache" -H "X-Api-Key:xxxxxxxxxxxxxxxxxxxxxxxxxx" https://mc.adobe.io/{tenant_id}/campaign/profileAndServices/profile"

Returns the following error:

{"error_code":"403023","message":"Profile is not valid"}

Check your IMS profile with this request:

$ curl  -X "GET" \
        -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Cache-Control: no-cache" "https://ims-na1.adobelogin.com/ims/profile/v1"

And in the response, the tenant_id value must be the same in your first GET opeartion:

{
"countryCode": "FR",
"mrktPermEmail": null,
"projectedProductContext": [
{
"prodCtx": {
"statusCode": "ACTIVE",
"geo": "emea",
"ident": "ZQ9FRQK7BF09YXAESFY9DDQP1G",
"modDts": 1448307260000,
"tenant_id": "actest",
"owningEntity": "6096892F54B5819E0A4C98A2@AdobeOrg",
"serviceCode": "dma_tartan",
"label": "Adobe Marketing Cloud",
"serviceLevel": "standard",
"createDts": 1421181343000,
"deal_id": " "
}

This means that there is an issue with the IMS provisioning of your specific Campaign product: the IMS team needs to fix it.

To get more details you can call the IMS API with your token to see what your IMS profile looks like: You need to have a prodCtx where the tenant_id is the same as the one you put in you URL for Adobe.io to be able to route your request. If it is missing the IMS provisioning needs to be fixed.












































Adobe.io declares your unvalid URI: most likely the URI you are requesting is not valid. On Adobe.io when you select the Campaign service you get a picker with a list of possible tenant-ids. You need to check that the one you choose is the one you put in your URL.

Either your token is invalid (improper IMS call used to generate a token) or your token has expired.

Depending on the instance configuration, the created profile needs to be associated to an orgUnit and an geoUnit. Please consult the How to create a profile section to understand how to add these fields in your creation.