Creare un’offerta di fallback create-fallback-offer

Per creare un’offerta di fallback, devi effettuare una richiesta POST al Offer Library API.

Intestazioni Accept e Content-Type accept-and-content-type-headers

La tabella seguente mostra i valori validi che compongono Content-Type nell’intestazione della richiesta:

Nome intestazione
Valore
Content-Type
application/json

Formato API

POST /{ENDPOINT_PATH}/offers/{ID}?offer-type=fallback
Parametro
Descrizione
Esempio
{ENDPOINT_PATH}
Percorso endpoint per le API di persistenza.
https://platform.adobe.io/data/core/dps/

Richiesta

curl -X POST 'https://platform.adobe.io/data/core/dps/offers?offer-type=fallback' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
    "name": "Test Fallback Offer DPS",
    "description": "Fallback Offer description",
    "status": "approved",
    "selectionConstraint": {
        "startDate": "2022-06-10T00:30:00.000+00:00",
        "endDate": "2032-06-06T23:29:21.402+00:00",
        "profileConstraintType": "none"
    },
    "representations": [
        {
            "components": [
                {
                    "deliveryURL": "https://mysite.com",
                    "type": "imagelink",
                    "format": "image/png"
                }
            ],
            "channel": "https://ns.adobe.com/xdm/channel-types/web",
            "placement": "offerPlacement1234"
        }
    ],
    "rank": {
        "priority": 1
    }
}'

Risposta

In caso di esito positivo, la risposta restituisce informazioni sulla nuova offerta di fallback creata, inclusa la sua offerta di fallback univoca id. È possibile utilizzare id nei passaggi successivi per aggiornare o eliminare l’offerta di fallback o per creare una decisione in un’esercitazione successiva.

{
    "etag": 2,
    "createdBy": "{CREATED_BY}",
    "lastModifiedBy": "{MODIFIED_BY}",
    "id": "{ID}",
    "sandboxId": "{SANDBOX_ID}",
    "createdDate": "2023-05-31T15:09:11.771Z",
    "lastModifiedDate": "2023-05-31T15:09:11.771Z",
    "createdByClientId": "{CREATED_CLIENT_ID}",
    "lastModifiedByClientId": "{MODIFIED_CLIENT_ID}"
}
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76