Mark a List Public
Make a "list" public to make it shareable to everyone.
Authenticated users only. Implementations that need to support this need to build out logic only for logged-in users where the source email is clear.
Endpoint
Endpoint | request type | API Type |
---|---|---|
{{Swym API Endpoint }}/api/v3/lists/markPublic | POST | shopper |
Query Params
Parameter | Type | Required | Description |
---|---|---|---|
pid | string (Encoded) | Yes | Unique identifier for the store available in Swym Admin |
limit | int64 | No | Maximum number of records to return |
offset | int64 | No | Number of records to skip |
Form Data
Field | Type | Required | Description |
---|---|---|---|
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 |
lid | string | Yes | Unique identifier of the list. |
Example Curl
An example of a /api/v3/lists/markPublic
request with lid
curl --location --request POST '{{Swym API Endpoint}}/api/v3/lists/markPublic?pid={{URL Encoded PID}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'regid={{regid}}' \
--data-urlencode 'sessionid={{sessionid}}' \
--data-urlencode 'lid={{lid}}'
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'regid': '{{regid}}',
'sessionid': '{{sessionid}}',
'lid': '{{lid}}'
});
var config = {
method: 'post',
url: '{{Swym API Endpoint}}/api/v3/lists/markPublic?pid={{URL Encoded PID}}',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
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. |
{{lid}} | This needs to be replaced with the actual list ID value. |
Success Response
When the list is marked public, the entire list contents are returned, this allows anyone with the lid to view the list.
{
"di":"f03daefc-d03e-438b-950c-86bdee5fcc6c",
"listcontents":[
{
"dt":"Blue Silk Tuxedo",
"empi":7168987889824,
"lid":"94dff98c-3eaa-48ee-ad87-98af2f87aeb5",
"du":"https://yourstore.myshopify.com/products/blue-silk-tuxedo?variant=41450466377888",
"pid":"6cLXc3z0TERBWpFvFJUpxjaWITbnZ2/uBEzdkDw3lbo=",
"epi":41450466377888,
"id":"e90a7375-c0e4-477e-8a73-75c0e4177e0d",
"uts":1682523571207,
"_pkey":"Xjg/Jbh9",
"iu":"https://cdn.shopify.com/s/files/1/0590/0723/8304/products/man-adjusts-blue-tuxedo-bowtie_925x_e6ca7031-3707-4ca0-9b1a-cfe7df185ebc_620x620.jpg?v=1638894844",
"_t":2,
"uby":"support@swymcorp",
"pr":70.0
},
{
"di":"f03daefc-d03e-438b-950c-86bdee5fcc6c",
"uid":"Xjg/Jbh9Y/0OTIydKNmd5NZjoB7w6B++1/RFflqnPa8=",
"dt":"Black Leather Bag",
"cts":1682520365028,
"empi":7168987529376,
"cby":"[email protected]",
"lid":"94dff98c-3eaa-48ee-ad87-98af2f87aeb5",
"du":"https://yourstore.myshopify.com/products/black-leather-bag?variant=41450466017440",
"pid":"/uBEzdkDw3lbo=",
"epi":41450466017440,
"id":"64beebf5-ceb5-4b47-beeb-f5ceb55b47f3",
"uts":1682520365028,
"_pkey":"Xjg/Jbh9",
"iu":"https://cdn.shopify.com/s/files/1/0590/0723/8304/products/black-bag-over-the-shoulder_925x_f7b24271-3c83-4bc4-8968-5d1f6b5c2584_620x620.jpg?v=1638894832",
"_t":2,
"uby":"support@swymcorp",
"pr":30.0
}
],
"userinfo":{
"fname":"support@swymcorp",
"sw_mkt":null,
"uid":"Xjg/Jbh9Y/0OTIydKNmd5NZjoB7w6B++1/RFflqnPa8=",
"m":null,
"em":"support@swymcorp",
"cts":1643656974342,
"lname":"support@swymcorp",
"pid":"/uBEzdkDw3lbo=",
"uts":1682516274533,
"acc_mkt":false,
"ut":null,
"prefs":{
"Mediums":{
"email":{
"signuptime":1643656974312,
"acceptmarketing":false,
"acceptsource":"shopify"
}
}
}
},
"lty":"wl",
"uid":"Xjg/Jbh9Y/0OTIydKNmd5NZjoB7w6B++1/RFflqnPa8=",
"cts":1682520364996,
"anonRead":1,
"cnt":2,
"lnote":"I am newly updated.",
"lname":"My Wishlist",
"cby":"support@swymcorp",
"lid":"94dff98c-3eaa-48ee-ad87-98af2f87aeb5",
"pid":"6cLXc3z0TERBWpFvFJUpxjaWITbnZ2/uBEzdkDw3lbo=",
"st":1,
"id":"75c32443-ecd5-442f-8324-43ecd5f42f1e",
"uts":1682529851920,
"_pkey":"Xjg/Jbh9",
"_t":1,
"itemcmnts":0,
"uby":"support@swymcorp",
"lhash":"bXktd2lzaGxpc3Q=",
"cfor":"support@swymcorp"
}
Error Response:
{
"error": true,
"msg": "List Not Found",
"type": "sw-entity-notfound",
"uid": "ny2AXQ5m7rQ7sRsaTmXvvafMGCKfwTbZY/5eZ3FTH+w=",
"di": "c0deab58-8510-4aa2-9a1a-328812c8e0a1-API",
"lid": "671de5eb-e69f-4b25-8ab7-0b9cd245f27"
}
Error Status Codes
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. |
429 | Too Many Requests | You're raising too many requests! Slow down! |
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 over 1 year ago