API ReferenceGuides
Log In
API Reference

Mark list public

Make a wishlist publicly readable by its list ID, enabling custom shared wishlist landing pages to fetch its contents via swat.fetchListDetails.

swat.markListPublic

The markListPublic API allows read access to the list id for anyone. Once marked, this list id can be fetched using fetchListDetails API on a shared page.

Definition

swat.markListPublic(lid, onSuccess, onError)

📘

This is a prerequisite for shared links to be viewable.

A link generated by swat.generateSharedListURL can only be viewed by recipients after the list has been marked public. Call this API before sharing the link.

❗️

This API is only supported for Logged in Users.

To mark a list public, the user must have a valid source email address, which is picked up implicitly by the API. The user must be logged in to use this functionality.

Example

let lid = "a5decd55-5bfe-4cd4-9991-ed5721ae2914";

let onSuccess = (response) => {
	console.log("Successfully Marked List Public ", response.lid);
}
let onError = (error) => {
  // Error is an xhrObject
	console.log("Error while marking the list public", error)
}

swat.markListPublic(lid, onSuccess, onError);

API Parameters

ArgumentTypeDescription
lidguidUnique id of the List to be marked public.
onSuccessfunctionCalled if the list id is marked public successfully.
onErrorfunctionCalled if the action fails. Error message is passed as argument.

Did this page help you?