这是两步法。
REST API会返回“href”属性,该属性包含要使用的URL。 始终使用响应中包含的URL来发出后续API请求.
示例请求
执行GET请求以检索服务。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
它返回服务的订阅URL。
{
...
"messageType": "email",
"name": "SVC1",
"subscriptions": {
"href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>/subscriptions/"
},
...
},
对订阅URL执行GET请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>/subscriptions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
此时将显示服务订阅列表,其中包含每个关联的用户档案。
{
...
"service": ...,
"serviceName": "SVC3",
"subscriber": {
"PKey": "<PKEY>",
"email": "",
"firstName": "John",
"href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>",
"lastName": "Doe",
},
}
这是两步法。
示例请求
执行GET请求以检索配置文件。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
它会返回用户档案的订阅URL。
{
...
"postalAddress":...,
"preferredLanguage": "none",
"subscriptions": {
"href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions/"
},
...
}
对订阅URL执行GET请求。
-X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
它会返回用户档案订阅的服务列表。
{
...
"PKey": "<PKEY>",
"created": "2017-03-03 10:54:00.363Z",
"service": {
"PKey": "<PKEY>",
"href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>",
"label": "Sport Newsletter",
"name": "SVC1",
"title": "Sport Newsletter (SVC1)"
},
...
}