Adobe  I/O Adobe Target

Entities

Create, update, or delete entities. See the parent page for common documentation that applies to all resources within the API.

Save entities

POST /recs/{client}/entities
Save new entities and update existing entities specified by the request data.
REQUEST BODY
entityBatch (required) Body Parameter — EntityBatch
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

cat entity.js

{
    "entities":[
        {
            "attributes": {
                "inventory": "77",
                "margin": "23",
                "message": "crashing helicopter",
                "pageUrl": "www.foobar.foo.com/helicopter.html",
                "thumbnailUrl": "www.foobar.foo.com/helicopter.jpg",
                "value": "19.2"
            },
            "categories": [
                "recreation:food"
            ],
            "environment": "4227",
            "id": "wes2001",
            "name": "Rotisserie Chicken"
        }
    ]
}

curl -X POST -H 'content-type: application/vnd.adobe.target.v1+json' -H 'username: buzz' -H 'x-target-user-email: buzz@adobe.com' "http://recs/api/recs/honeybeedemo/entities" -d@entity.js<-- 200 OK

<-- Location https://{recs-host}/api/recs/honeybeedemo/entities
{"rejected":0,"inserted/updated":1}

Delete entities

DELETE /recs/{client}/entities
Delete entities referenced by ids. Delete all entities by not including the entities parameter.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
ids (optional) Query Parameter — string

Sample code

curl -X DELETE -H 'accept: application/vnd.adobe.target.v1+json' -H 'username: buzz' -H 'x-target-user-email: buzz@adobe.com' 'http://recs/api/recs/honeybeedemo/entities?ids=item1'

<-- 200 OK
{ "operation": "deleted by ids" }

Get entity

GET /recs/{client}/entities/{id}
Get the details of a single entity.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — string
environmentId (optional) Query Parameter — string

Sample code

curl -X GET -H 'accept: application/vnd.adobe.target.v1+json' -H 'username: buzz@adobe.com' -H 'x-target-user-email: demo' "http://recs/api/recs/honeybeedemo/entities/item1?environmentId=4227"

<-- Location https://{recs-host}/api/recs/honeybeedemo/entities/item1

{
    "attributes": {
        "message": "crashing helicopter",
        "inventory": "77",
        "pageUrl": "www.foobar.foo.com/helicopter.html",
        "thumbnailUrl": "www.foobar.foo.com/helicopter.jpg",
        "value": "19.200000762939453125",
        "margin": "23"
    },
    "id": "item1",
    "categories": [
        "recreation:food"
    ],
    "environment": "4227",
    "name": "Rotisserie Chicken"
} 

Field Description and Validation Rules

Field Path Description Validation
id String. Identifying a specific entity by the customers id. This is usually the same string as the property id in the entity's JSON. This applies to POST and GET. Must be specified. Cannot be longer than a 1000 characters.
environmentId Long. GET requests require an existing environmentId
ids This is for DELETE only. The ids in this list of comma separated ids are deleted. If this parameter is left out, ALL entities are deleted. Ids that don't exist are ignored.
entities List of entities. List must contain at least one entity.
entities->entity->environment String. ID of the Environment. Must be a valid id of an existing environment.
entities->entity->name String. Typically representing a readable or identifiable name of the entity. Must be 250 characters or less and not empty.
entities->entity->category Array of strings. Category must be 250 characters or less and not empty. Up to a 1000 unique categories are allowed.
entities->entity->attributes Key-value pairs. Both the key and the value are of type string.