endpoint-migration-examples
Examples for the Endpoint Migration period#
Getting personalization data through the dedicated personalization GET endpoint#
This endpoint retrieves a listing’s personalization questions by listing ID. It returns a personalization_questions array. If the listing has no personalization configured, the array is empty.
The following procedure retrieves the personalization questions attached to a listing.
Form a valid URL for
getListingPersonalization, which must include alisting_id. For example, if yourlisting_idis "987654", the URL is:https://api.etsy.com/v3/application/listings/987654/personalization
Execute a
getListingPersonalizationGET request with your x-api-key.The response contains a
personalization_questionsobject:
Getting personalization data via endpoints that return listings with associations#
You can still retrieve the personalization data for a listing by using the following endpoints and including the parameter ?includes=personalization in your requests:
- getListingsByShop -
GET /v3/application/shops/{shop_id}/listings - getListing -
GET /v3/application/listings/{listing_id} - getListingsByListingIds -
GET /v3/application/listings/batch
Example url for the getListing endpoint: https://api.etsy.com/v3/application/shops/12345678/listings?includes=personalization\&language=en
Example response:
During this phase we will continue to return the legacy keys related to personalization, since the new data shape is fully backwards compatible with the legacy one.
Adding or updating personalization data through the dedicated personalization POST endpoint#
To create or update personalization questions for a listing you must first have an existing listing. If you do not have one, you can create a new listing using the createDraftListing endpoint before utilizing this endpoint.
The following procedure creates and attaches personalization profile to a specific listing:
Form a valid URL for
updateListingPersonalization, which must include ashop_idand alisting_id. For example, if yourshop_idis "12345678", and yourlisting_idis “987654” then thecreateListingPersonalizationURL would be:https://api.etsy.com/v3/application/shops/12345678/listings/987654/personalization
Build the
updateListingPersonalizationrequest body, which must include:personalization_questions- Array ofpersonalization_questionswith a singletext_inputquestion and thequestion_textvalue must be “Personalization”, similar to:
- Execute a
updateListingPersonalizationPOST request with yourlistings_wscoped OAuth token and x-api-key. For example, a request with the previouspersonalization_questionmight look like this:
- JavaScript fetch
- The response would look something like this:
- The content of this request will replace any existing personalization data in this listing.
Deleting personalization from a listing through the dedicated DELETE endpoint#
This endpoint deletes personalization for a listing. It clears personalization by setting is_personalizable to false and removing the listing’s personalization data.
The following procedure deletes the personalization questions attached to a listing.
Form a valid URL for
deleteListingPersonalization, which must include ashop_idand alisting_id. For example, if yourshop_idis "12345678", and yourlisting_idis “987654” then thedeleteListingPersonalizationURL would be:https://api.etsy.com/v3/application/shops/12345678/listings/987654/personalization
Execute a
deleteListingPersonalizationDELETE request with your listings_w scoped OAuth token and x-api-key.Check the response. On success, the endpoint returns
204 No Content.