Snip REST Callback

From Sni.ps Documentation

Jump to: navigation, search
   The functionality specified for the Snip Callback is documented but not yet implemented.


Contents

REST Callbacks

snip

By default this is the callback for returning a list of snips, but if posted to it is also the callback for creating a new snip.

Search

Optional Arguments

type

The type or list of types to use for filtering the list of returned snips. Use a comma separated list to specify more than one type and prefix the list with an ! to instead find all snips not of that type(s).

Default: null

Example: type=im

Example: type=im,vi

Example: type=!vi

user

The user id or list of users' ids whose snips you would like returned. Use a comma separated list to specify more than one user and prefix the list with an ! to instead find all snips not by that user(s).

Default: null

Example: user=8

Example: user=54,112

Example: user=!13

license

Narrows down the snips returned to only those with the specified licence. License should be referred to by the numeric id referred to be the license callback. Use a comma separated list to specify more than one license and prefix the list with an ! to instead find all snips not under that license(s).

Default: null

Example: license=1

Example: license=1,4

Example: license=!4

tag

One or more tags you would like to use to narrow down the list of snips. Use a comma separated list to specify more than one tag and prefix the list with an ! to instead find all snips that do not have that tag(s).

Default: null

Example: tag=cat

Example: tag=rock,banjo

Example: tag=!rickroll

attribution_path

The URL from which the snip originated. Can be simply the site domain.

Default: null

Example: attribution_path=www%2Eflickr%2Ecom

min_date, max_date

The minimum and maximum for the date range for when the snips were created. Given in the format of a ISO 8601 date.

Default: null

Example: min_date=2008-12-31T23%3A59%3A59%2B00%3A00 - One second to midnight, New Years Eve of 2008

tag_logic

The type of join used when more than one tag is specified.

Default: AND

Options: AND and OR

Example: tag_logic=OR

sort

The order in which the snips will be return.

Default: date

Options: date and popularity

Example: sort=popularity

limit

The maximum number of snips to return per page.

Default: 20

Maximum: 100

Example: limit=5

page

For result lists that have multiple pages worth of results, used to determine which page of results you would like returned.

Default: 1

Example: page=8

Create

For creating a new snip. Arguments must be passed in via POST.

Required Arguments

action

The action being performed. For creating a snip, the value must be create.

Default: null

Example: action=create

auth

The authentication key returned from identifying with oauth.

type

The type of content that the new snip is

Example: type=image

attribution_path

The URL from which the snip originated. Can be simply the site domain.

Example: attribution_path=http%3A%2F%2Fen%2Ewikipedia%2Eorg

Example: attribution_path=http%3A%2F%2Fwww%2Eflickr%2Ecom%2Fphotos%2Fdonatgroup%2F

source

The string from which the snip is generated. Dependant on the type of snip being created. For an image or video it is the actual source where it is located.

Example: source=http%3A%2F%2Fimgs%2Exkcd%2Ecom%2Fcomics%2Fturing%5Ftest%2Epng

Optional Arguments

license

The license that should be attributed to the content contained in the new snip. The value should refer to the id of one of the licenses stored in the system. If none is specified, a default is attempted to be applied. If the desired license is not available, you need to first create your license with the repective callback.

Default: null

Example: license=1

tag

One or more tags you would like to assign to the newly created snip. Use a comma separated list to specify more than one tag.

Default: null

Example: tag=cat

Example: tag=rock,banjo

Personal tools