Update basic details of a Shopping List

This endpoint allows you to update the shopping list name or set/reset it as primary.

post
Update Shopping List

https://api.whisk.com/list/v2/{id}
You can use a body parameter to update a shopping list:
Request
Response
Request
Path Parameters
id
required
string
The shopping list identifier.
Headers
Authentication
required
string
Server Token or a User Access token containing shopping_list:write scope to authorize the API usage. For more information, see Authentication.
Body Parameters
body
required
object
The body object contains the attributes to update the general shopping list details. See the Body Object Example below.
Response
200: OK
This is how a successful response looks.
{
"list": {
"id": "string",
"name": "string",
"primary": true
}
}
400: Bad Request
This failed response appears when error codes are found in the endpoint query.
{
"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
"message": "Additional details about error are not static and can be changed"
}
401: Unauthorized
This failed response appears due to API authentication failure. The possible error codes that may appear are: auth.tokenNotFound , auth.tokenExpired, auth.tokenInvalid, auth.tokenRequired.
{
"code": "auth.tokenNotFound"
}
500: Internal Server Error
This failed response appears when something is not right on Whisk's end. Please send a message to [email protected], and be sure to include both the Request and Response data. We’ll get back to you soon.
This is unexpected response, something is wrong on our side, please contact: [email protected]

Request Body Object Example

{
"fields": {
"name": "My Updated Shopping List",
"primary": true
},
"mask": {
"paths": [
"name", "primary"
]
}
}

The fields object allows you to specify new values for the shopping list attributes. Currently, we only support updating the name and primary attributes.

The mask object allows you to specify the attributes that you want to update specifically. For example, in each update request, you need to specify values for both name and primary attributes regardless of whether you want to update both or only one of them. Hence, the mask object determines which attributes are to be updated exactly.

The mask object contains the path array that allows you to add a comma-separated list of attributes to update.

Sample Request and Response

Curl Request
Response
Curl Request
curl -X POST "https://api.whisk.com/list/v2/106e1fa4cbb7c844458be372c3e0f7bfa94"
-H "Accept: application/json"
-H "Authorization: Bearer <YOUR-API-ACCESS-KEY>"
-d "{ \"fields\": { \"name\": \"My Updated Shopping List\", \"primary\": true }, \"mask\": { \"paths\": [ \"name\", \"primary\" ] }}"

Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint here.

Response
{
"list": {
"id": "106e1fa4cbb7c844458be372c3e0f7bfa94",
"name": "My Updated Shopping List",
"primary": true
}
}

A successful response includes the shopping list identifier and its updated attributes.