Abonnementen met API's verwijderen mdeleting-subscriptions-api

Een serviceabonnement voor een specifiek profiel verwijderen deleting-service-subscription

Dit is een procedure in drie stappen.

  1. Haal de abonnements-URL voor het gewenste profiel op.
  2. Voer een GET-aanvraag uit op de abonnements-URL.
  3. Voer een DELETE-verzoek uit op de gewenste service-URL.

Als het verwijderingsverzoek is gelukt, is de status van het antwoord 204 Geen inhoud.

verzoek van de Steekproef

In de onderstaande voorbeeldladingen ziet u hoe u een profiel van een service kunt afmelden. Voer eerst een GET-aanvraag uit om het profiel op te halen.

-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>'

De abonnements-URL voor het profiel wordt geretourneerd.

  {
    ...
    "postalAddress":...,
    "preferredLanguage": "none",
    "subscriptions": {
      "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>/subscriptions/"
    },
  }

Voer een GET-aanvraag uit op de abonnements-URL.

-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>'

Het keert de lijst van abonnementen voor het geselecteerde profiel, met een URL voor elke geabonneerde dienst terug.

...
"service": {
  "PKey": "<PKEY>",
  "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>",
  "label": "Sport Newsletter",
  "name": "SVC1",
  "title": "Sport Newsletter (SVC1)"
},
...

Voer een DELETE-verzoek uit op de gewenste service-URL.

-X DELETE 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>'

Een serviceabonnement voor een specifiek profiel verwijderen

Dit is een procedure in drie stappen.

  1. Haal de gewenste service en de abonnements-URL op.
  2. Voer een GET-aanvraag uit op de abonnements-URL om alle abonnementen op profielen op te halen.
  3. Voer een DELETE-aanvraag uit op de gewenste profielabonnements-URL.

Als het verwijderingsverzoek is gelukt, is de status van het antwoord 204 Geen inhoud.

verzoek van de Steekproef

Haal het servicerecord op.

-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>'

De abonnements-URL voor de service wordt geretourneerd.

{
  ...
  "messageType": "email",
  "mode": "newsletter",
  "name": "SVC3",
  "subScenarioEventType": "subscriptionEvent",
  "subscriptions": {
    "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>/subscriptions/"
  },
  "targetResource": "profile",
  ...
},

Voer een GET-aanvraag uit op de abonnements-URL.

-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>'

De lijst met abonnementen voor de geselecteerde service wordt geretourneerd, met een URL (href) voor elk profielabonnement.

{
  "PKey": "<PKEY>",
  "created": "2019-03-26 08:58:04.764Z",
  "email": "",
  "expirationDate": "",
  "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>/subscriptions/<PKEY>",
  "metadata": "subscriptionRcp",
  "service": ...,
  "serviceName": "SVC3",
  "subscriber": ...,
  ...
}

Voer een DELETE-aanvraag uit op de gewenste profielabonnements-URL.

-X DELETE https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/service/<PKEY>/subscriptions/<PKEY> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'X-Api-Key: <API_KEY>'
recommendation-more-help
3ef63344-7f3d-48f9-85ed-02bf569c4fff