Elencare offerte personalizzate list-personalized-offers
Un’offerta personalizzata è un messaggio di marketing personalizzabile basato su regole e vincoli di idoneità.
È possibile visualizzare un elenco di tutte le offerte personalizzate eseguendo una singola richiesta GET all'API Offer Library.
Formato API
GET /{ENDPOINT_PATH}/offers?offer-type=personalized&{QUERY_PARAMS}
{ENDPOINT_PATH}
https://platform.adobe.io/data/core/dps
{QUERY_PARAMS}
limit=2
Richiesta
curl -X GET 'https://platform.adobe.io/data/core/dps/offers?offer-type=personalized&limit=2' \
-H 'Accept: *,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}'
Utilizzo dei parametri di query using-query-parameters
Puoi utilizzare i parametri di query per visualizzare e filtrare i risultati quando elenchi le risorse.
Paging paging
I parametri di query più comuni per il paging includono:
property
Un filtro proprietà facoltativo:
- Le proprietà sono raggruppate per operazione AND.
- I parametri possono essere ripetuti come segue: proprietà={PROPERTY_EXPR}[&proprietà={PROPERTY_EXPR2}…] o proprietà={PROPERTY_EXPR1}[,{PROPERTY_EXPR2}…]
- Le espressioni di proprietà sono in formato
[ !]field[op]value
, conop
in[==,!=,<=,>=,<,>,~]
, che supportano espressioni regolari.
property=name!=abc&property=id~.*1234.*&property=description equivalent with property=name!=abc,id~.*1234.*,description.
orderBy
orderby=field1[,-fields2,field3,...]
orderby=id
,-name
limit
limit=5
Risposta
In caso di esito positivo, la risposta restituisce un elenco di offerte personalizzate presenti insieme a quelle a cui hai accesso.
{
"results": [
{
"created": "2023-05-15T14:35:16.781+00:00",
"modified": "2023-05-15T14:38:26.691+00:00",
"etag": 2,
"schemas": [
"https://ns.adobe.com/experience/offer-management/personalized-offer;version=0.15"
],
"createdBy": "{CREATED_BY}",
"lastModifiedBy": "{MODIFIED_BY}",
"id": "personalizedOffer1234",
"name": "Test personalized offer with frequency constraint",
"status": "draft",
"representations": [
{
"channel": "https://ns.adobe.com/xdm/channel-types/web",
"placement": "offerPlacement1234",
"components": [
{
"type": "html",
"format": "text/html",
"language": [
"en-us"
],
"content": "Hello You qualify for our Discount of 60%"
}
]
}
],
"selectionConstraint": {
"startDate": "2022-07-27T05:00:00.000+00:00",
"endDate": "2023-07-29T05:00:00.000+00:00",
"profileConstraintType": "none"
},
"rank": {
"priority": 0
},
"cappingConstraint": {},
"frequencyCappingConstraints": [
{
"enabled": false,
"limit": 1,
"startDate": "2023-05-15T14:25:49.622+00:00",
"endDate": "2023-05-25T14:25:49.622+00:00",
"scope": "global",
"entity": "offer",
"repeat": {
"enabled": false,
"unit": "month",
"unitCount": 1
}
}
]
}
],
"count": 1,
"total": 1,
"_links": {
"self": {
"href": "/offers?offer-type=personalized&href={SELF_HREF}",
"type": "application/json"
}
}
}
Esegui l’impaginazione se nella risposta mancano più offerte personalizzate.
Risposta
{
"results": [...],
"count": 2,
"total": 43,
"_links": {
"self": {
"href": "/offers?orderby=-modified&limit=2&offer-type=PERSONALIZED",
"type": "application/json"
},
"next": {
"href": "/offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED",
"type": "application/json"
}
}
}
total
count
Recuperare l'endpoint da _links.next.href
, ad esempio /offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED
, e aggiungerlo all'API.
Formato API
GET /{ENDPOINT_PATH}/offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED
{
"results": [...],
"count": 2,
"total": 43,
"_links": {
"self": {...},
"next": {
"href": "/offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED",
"type": "application/json"
}
}
}
Allo stesso modo, se non ti trovi nella prima pagina e devi recuperare la pagina precedente delle offerte personalizzate, utilizza il valore href
di _links.prev
. Invia una richiesta all’URL per recuperare il set di risultati precedente, come mostrato nell’esempio seguente.
Risposta
{
"results": [...],
"count": 2,
"total": 43,
"_links": {
"self": {...},
"next": {...},
"prev": {
"href": "/offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED",
"type": "application/json"
}
}
}