This is an authenticated resource, so all requests made must include basic authentication, using your `username:password`, base64 encoded and passed along in the Authorization Header.
`Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=`
`curl` will automatically encode your username and password when passed with the `-u` option.
The List API currently allows for requesting all lists belonging to the authenticated user, or a specific list. Lists can also be modified using an English-like string.
GET Index
curl "https://ardesian.com/lists/" \
-u "username:password"
[
{
id: 1,
name: "Groceries",
description: "The family shared list of groceries for the household.",
list_items: [
"Milk",
"Bread",
"Sour Cream",
"Onions"
]
},
{
id: 2,
name: "TODO",
description: "My personal list of things I need to do.",
list_items: [
"Update APIs for each page",
"Add API documentation"
]
}
]
GET Show
curl "https://ardesian.com/lists/:list_id" \
-u "username:password"
{
id: 1,
name: "Groceries",
description: "The family shared list of groceries for the household.",
list_items: [
"Milk",
"Bread",
"Sour Cream",
"Onions"
]
}
POST Update
Multiple items can be included in the same request by splitting names with commas.
`add <list of item names>` is used for adding items to the list - does not return an error if one or more items already exist on the list.
`remove <list of item names>` is used for removing items from the list - does not return an error if one or more items are not found.
`clear` is used for removing all items from the list.
curl -X PUT "https://ardesian.com/lists/:list_id" \
-u "username:password" \
--data-urlencode "message=add potatoes, carrots, and onions"
curl -X PUT "https://ardesian.com/lists/:list_id" \
-u "username:password" \
--data-urlencode "message=remove potatoes, carrots, and onions"
curl -X PUT "https://ardesian.com/lists/:list_id" \
-u "username:password" \
--data-urlencode "message=clear"
{
id: 1,
name: "Groceries",
description: "The family shared list of groceries for the household.",
list_items: [
"Milk",
"Bread",
"Sour Cream",
"Onions",
"Potatoes",
"Carrots"
]
}