Enumerar ofertas personalizadas list-personalized-offers
Una oferta personalizada es un mensaje de marketing personalizable basado en reglas de elegibilidad y restricciones.
Puede ver una lista de todas las ofertas personalizadas realizando una sola petición GET a la API Offer Library.
Formato de API
GET /{ENDPOINT_PATH}/offers?offer-type=personalized&{QUERY_PARAMS}
{ENDPOINT_PATH}https://platform.adobe.io/data/core/dps{QUERY_PARAMS}limit=2Solicitud
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}'
Uso de parámetros de consulta using-query-parameters
Puede utilizar parámetros de consulta para paginar y filtrar los resultados al enumerar recursos.
Paginación paging
Los parámetros de consulta más comunes para la paginación incluyen:
propertyUn filtro de propiedad opcional:
- Las propiedades se agrupan por operación AND.
- Los parámetros se pueden repetir como se indica a continuación: property={PROPERTY_EXPR}[&property={PROPERTY_EXPR2}…] o property={PROPERTY_EXPR1}[,{PROPERTY_EXPR2}…]
- Las expresiones de propiedad están en el formato
[ !]field[op]value, conopen[==,!=,<=,>=,<,>,~], que admite expresiones regulares.
property=name!=abc&property=id~.*1234.*&property=description equivalent with property=name!=abc,id~.*1234.*,description.orderByorderby=field1[,-fields2,field3,...]orderby=id,-namelimitlimit=5Respuesta
Una respuesta correcta devuelve una lista de ofertas personalizadas que están presentes junto con las que tiene acceso a.
{
"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"
}
}
}
Realice la paginación si faltan varias ofertas personalizadas en la respuesta.
Respuesta
{
"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"
}
}
}
totalcountRecupere el extremo de _links.next.href, como /offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED, y anexe a la API.
Formato de 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"
}
}
}
Del mismo modo, si no se encuentra en la primera página y necesita recuperar la página anterior de ofertas personalizadas, utilice el valor href de _links.prev. Realice una solicitud a la dirección URL para recuperar el conjunto de resultados anterior, como se muestra en el ejemplo siguiente.
Respuesta
{
"results": [...],
"count": 2,
"total": 43,
"_links": {
"self": {...},
"next": {...},
"prev": {
"href": "/offers?orderby=-modified&limit=2&start={TIMESTAMP}&offer-type=PERSONALIZED",
"type": "application/json"
}
}
}