Getting item details with the Get Entity API

To retrieve the details of an existing item, use the Get Entity API. The syntax is:

GET https://mc.adobe.io/{{TENANT_ID}}/target/recs/entities/[entity.id]

Entity details can only be retrieved for a single entity at a time. You can use Get Entity to confirm updates were made in the catalog as expected, or to otherwise audit the contents of the catalog.

  1. In the API request, specify the entity ID, using the variable entityId. The following example will return details for the entity whose entityId=kit2004.

    GetEntity1

  2. Verify TENANT_ID and API_KEY reference the Postman environment variables established earlier. Use the image below for comparison. If necessary, modify the Headers and path in your API request to match those in the image below.

    GetEntity2

  3. Send the request.

    GetEntity3
    If you receive an error stating the entity was not found, as shown in the example above, verify you are submitting the request to the correct Target environment.

    NOTE
    If no environment is explicitly specified, Get Entity attempts to get the entity from your default environment only. If you wish to pull from any environment other than your default environment, you must specify the environment ID.
  4. If necessary, add the environmentId parameter, and re-send the request.

    GetEntity4

  5. Send another Get Entity request, this time to inspect the entity whose entityId=kit2005.

    GetEntity5

Suppose you decide these entities need to be removed from your catalog. Let’s use the Delete Entities API.

Deleting items with the Delete Entities API

To remove items from your catalog, use the Delete Entities API. The syntax is:

DELETE https://mc.adobe.io/{{TENANT_ID}}/target/recs/entities?ids=[comma-delimited-entity-ids]&environment=[environmentId]
WARNING
The Delete Entities API deletes entities referenced by IDs you specify. If no entity IDs are provided, all entities in the given environment are deleted. If no environment ID is given, entities will be deleted from all environments. Use this with caution!
  1. Navigate to Target > Setup > Hosts > Environments to obtain the Target Environment ID from which you want to delete items.

    DeleteEntities1

  2. In the API request, specify the entity IDs of the entities you want to delete, using the syntax &ids=[comma-delimited-entity-ids] (a query parameter). When deleting more than one entity, separate the IDs using commas.

    DeleteEntities2

  3. Specify the environment ID, using the syntax &environment=[environmentId], otherwise entities across all environments will be deleted.

    DeleteEntities3

  4. Verify TENANT_ID and API_KEY reference the Postman environment variables established earlier. Use the image below for comparison. If necessary, modify the Headers and path in your API request to match those in the image below.

    DeleteEntities4

  5. Send the request.

    DeleteEntities5

  6. Verify your results using Get Entity, which should now indicate the deleted entities cannot be found.

    DeleteEntities6

    DeleteEntities6

Congratulations! You can now use the Recommendations APIs to create, update, delete, and obtain details on the entities in your catalog. In the next section, you will learn how to manage custom criteria.

Previous pageRecommendations API overview
Next pageManage custom criteria

Target


Personalization & Experiementation Excellence with Recommendations and AI

Adobe Customer Success Webinars

Tuesday, Mar 4, 4:00 PM UTC

Adobe Target innovations, including GenAI, and best practices on AI-powered personalization and experimentation at scale.

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more