GET / POST / PATCH / DELETE verb verbs
Följande verb kan användas för åtgärder på resurserna:
GET: hämtar ett element eller en samling elementPOST: skapar en resurs med parametrar.PATCH: uppdaterar en resurs med parametrar.DELETE: tar bort en resurs.
Exempelbegäranden
-
Exempel på GET-begäran i profilsamlingen.
code language-none $curl -X GET https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -H 'Cache-Control: no-cache' \ -H 'X-Api-Key: <API_KEY>'Den returnerar en array med profiler.
code language-none { "content": [ { "PKey": "<PKEY>", "firstName": "Olivia", "lastName": "Varney", "birthDate": "1977-09-°4", "email": "o.varney@mail.com", }, { "PKey": "<PKEY>", "firstName": "John", "lastName": "Doe", "birthDate": "1985-08-17", "email": "johndoe@mail.com", } ], } -
Exempel på GET-begäran för en viss profil.
code language-none $curl -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>'Den returnerar den begärda profilen.
code language-none { "PKey": "<PKEY>", "firstName": "John", "lastName": "Doe", "birthDate": "1985-08-17", "email": "johndoe@mail.com", ... } -
Exempelbegäran POST för att skapa en profil.
code language-none -X POST https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -H 'Cache-Control: no-cache' \ -H 'X-Api-Key: <API_KEY>' \ -d '{"lastName":"Doe"}'Den returnerar profilen med standardfälten.
code language-none { "PKey": "<PKEY>", "firstName": "John", "lastName": "Doe", "birthDate": "1985-08-17", "email": "johndoe@mail.com", } -
Exempel på PATCH-begäran om att uppdatera en profil.
code language-none -X PATCH 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>' \ -d '{"firstName":"Mark"',"lastName":"Smith"}'Den returnerar PKEY och URL för att hämta den uppdaterade profilen.
code language-none { "PKey": "<PKEY>", "href": "https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServices/profile/<PKEY>" } -
Exempelbegäran från DELETE om att ta bort en profil.
code language-none -X DELETE 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>'Begäran returnerar ett 200-svar som bekräftar att profilen har tagits bort.
recommendation-more-help
3ef63344-7f3d-48f9-85ed-02bf569c4fff