Add to the wishlist
const url = 'https://acme.mykreezalid.com/front_api/v1/wishlists';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"item_id":4242,"listing_id":1,"type":"listing"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/front_api/v1/wishlists \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "item_id": 4242, "listing_id": 1, "type": "listing" }'Saves a listing (by default) or a vendor (type=vendor) in the signed-in member’s wishlist. The response is always 200: check success, and read message to know why an item was not added.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Identifier of the listing or of the vendor to save.
Example
4242Accepted instead of item_id.
Kind of item to save. With any other value, nothing is saved.
Responses
Section titled “Responses”The outcome. success is true when the item is saved.
object
On success, Listing added successfully or Vendor added successfully. Otherwise listing_not_found, vendor_not_found, listing_already_in_user_wishlist, vendor_already_in_user_wishlist or unable_to_save; null when type is neither listing nor vendor.
Example
{ "success": true, "message": "Listing added successfully"}No valid access token was sent.
Error body returned by the Front API when it refuses a request.
object
HTTP status code, repeated in the body.
Human-readable reason.
Example
{ "code": 403, "status": "error", "message": "Token not found in request"}