Shaarli-client
a client in node.js for a shaarli api.
Installing
To utilize shaarli-client, install the the npm
module:
npm install shaarli-client
After installing the npm
package you can now start request shaarli instance like so:
var shaarliClient = ; var client = urlsecret;
Get Info
Get information about this instance.
client
Get Links
Get a collection of links ordered by creation date.
params
is a collection wich can have the following keys:
offset
(int
) - Offset from which to start listing linkslimit
(int
| "all") - Number of links to retrieve or 'all'searchtags
(Array
) - List of tagssearchterm
(Array
) - Search terms across all links fieldsvisibility
("all" | "private" | "public") - Filter links by visibility
var params = "offset": 0 "limit": 10 "searchtags": "gif""cat" "searchterm": "looks""at" "visibility": "all"; client
Get Link
Get a link with its id
.
client
Post Link
Create a new link or note.
params
is a collection wich can have the following keys:
description
(string
) - Link descriptionprivate
(boolean
) - Link visibilitytags
(Array
) - List of tags associated with the linktitle
(string
) - Link titleurl
(string
) - Link URL
var params = "description": "blabla" "private": false "tags": "cat""image" "title": "jumping cats" "url": "http://jumpin.cat/"; client;
Put Link
Update an existing link with provided request data. Keep in mind that all link’s fields will be updated.
params
is a collection wich can have the following keys:
description
(string
) - Link descriptionprivate
(boolean
) - Link visibilitytags
(Array
) - List of tags associated with the linktitle
(string
) - Link titleurl
(string
) - Link URL
var params = "description": "bloblo" "private": false "tags": "image""truc" "title": "jumping cats calendar" "url": "http://jumpin.cat/post"; client;
Delete Link
Delete a link.
client;
Get Tags
Get a collection of tags
params
is a collection wich can have the following keys:
offset
(int
) - Offset from which to start listing tagslimit
(int
| "all") - Number of tags to retrieve or 'all'visibility
("all" | "private" | "public") - Filter tags by visibility
var params = "offset": 0 "limit": 10 "visibility": "private"; client
Get Tag
Get a tag with its tagName
.
client
Put Tag
Rename an existing tag.
params
is a collection wich can have the following keys:
name
(string
) - new tag name
var params = "name": "kitty"; client;
Delete Tag
Delete a tag.
client;
Get History
Retrieve the last actions made by the user, even in the web version, including:
CREATED
: A new link has been created.UPDATED
: An existing link has been updated.DELETED
: A link has been deleted.SETTINGS
: Shaarli settings have been updated.
params
is a collection wich can have the following keys:
since
(string
) - Get all event since this datetime (format ISO ISO8601). Note: the + should be encoded to %2B.offset
(int
) - Offset from which to start listing eventslimit
(int
| "all") - Number of event to retrieve or 'all'
var params = "since": "2015-05-05T12:30:00%2B03:00" "offset": 0 "limit": 10; client;