Create a List [Beta]
Creates a Save for Later List with the given name and attributes.
Contact support for using Save for Later Beta APIs.
This document describes for creating a new save for later list for a shopper
Endpoint | request type | API Type |
---|---|---|
https://{{Swym API Endpoint }}/api/v3/lists/sfl/create | POST | shopper |
Query Params
Parameter | Type | Required | Description |
---|---|---|---|
pid | string (Encoded) | Yes | Unique identifier for the store available in Swym Admin |
Form Data
Field | Type | Required | Description |
---|---|---|---|
lname | string | Yes | Unique name of the list to create |
regid | string | Yes | Unique identifier for the shopper generated by generate-regid |
sessionid | string | Yes | Session id generated with generate-regId endpoint which does not expire without manual intervention |
user-agent | string | Yes | User-Agent header of the app used to access the API |
lnote | string | optional | Optional note at list level |
lprops | object | optional | List level object that can house custom properties |
ldesc | string | optional | List description |
Example Curl
curl -X POST \
--url '{{Swym API Endpoint }}/api/v3/lists/sfl/create?pid={{URL Encoded PID }}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'lname=My SFL list' \
--data-urlencode 'sessionid={{sessionId}}' \
--data-urlencode 'regid={{regid}}'\
--data-urlencode 'user-agent={{user-agent}}'
Curl Placeholders
Assuming these values are provided above, the curl command should work correctly. However, if there are any issues with the API endpoint or the data being passed in the request, there could still be errors that need to be resolved before you can test these APIS.
Placeholders | Descriptions |
---|---|
{{Swym API Endpoint}} | This needs to be replaced with the actual Swym API endpoint URL. |
{{URL Encoded PID}} | This needs to be replaced with the actual PID value, URL-encoded. |
{{regid}} | This needs to be replaced with the actual regid value. |
{{sessionid}} | This needs to be replaced with the actual session ID value. |
{{user-agent}} | This needs to be replaced with User-Agent header value. |
Success Response
The below responses are what you would get based on being logged in or an authenticated user.
{
"list": {
"di": "27e0ff4a-e950-4057-aab0-e62fa0821c83", // Unique identifier for the device
"lty": "sfl", // List type
"uid": "eQfca8LNr0PeDPyEIb7Bz97FxkYqwbhcKMGVT5/rSHQ=", // Unique identifier for the user
"cts": 1699666952352, // Creation timestamp (in milliseconds since epoch)
"lnote": null, //List note
"lname": "My SFL List", // List name
"cby": "[email protected]", //Email of the user
"lid": "0b2c578f-7583-4175-b0fe-db5fc31f4b7c", // Unique identifier for the list.
"pid": "C7vi6wI9s9aa0jE3DY+e2J8R/45MnnDtXYF6xfGNlDQ=", // Unique identifier for the store
"st": 1, // List status (1 = active, 0 = inactive)
"cprops": {}, //Custom properties
"id": "bbf8fc3a-1c18-48fa-b8fc-3a1c1898fae9",
"uts": 1699666952352, // Update timestamp (in milliseconds since epoch)
"ldesc": {}, //List description
"uby": "[email protected]", //Email of the user
"cfor": "[email protected]" //Email of the user
}
}
Error Response:
If the request is unsuccessful, the API will return a JSON response with an error message and an HTTP status code indicating the type of error that occurred.
Status Code | Type | Description |
---|---|---|
400 | Bad Request | Your request is invalid, change your request params and query and try again. |
401 | Unauthorised | You are performing an action on a resource that is not granted to the current logged-in user. Additionally, for REST APIs, this could mean your API key is wrong. |
403 | Forbidden | You are not allowed to request this data. |
404 | Not Found | The specified requested data could not be found. |
500 | Internal Server Error | We had a problem with our server. Try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance. Please try again later. |
Updated about 1 year ago