Snippets API

GET /snippets

List of extenal (non-dvidshub) live events

Example request:

GET /snippets?max_results=2&api_key=key-XXXXXXXXXXXXX HTTP/1.1
Host: api.dvidshub.net
Accept-encoding: gzip, deflate
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example response:

HTTP/1.1 200 OK
Date: Tue, 16 Jul 2019 14:03:09 GMT
Server: Apache/2.4.18 (Ubuntu)
Set-cookie: PHPSESSID=365m6inb7jrgehqfch00q674u7; path=/; domain=.dvidshub.net; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-control: no-store, no-cache, must-revalidate
Pragma: no-cache
Access-control-allow-origin: *
Content-length: 2
Content-type: application/json

[

]

Query Parameters:

  • api_key: Public API access key issued by DVIDS (key-xxxxxxxxxxxxx)
  • from_date: Specify a date/time in ISO8601 format to return events newer than from_date
  • max_results: [1-50] Maximum number of results to return per page. Default and maximum value are both 50.
  • sort: One of begin, end
  • sortdir: One of asc, desc
  • to_date: Specify a date/time in ISO8601 format to return events older than to_date

Status Codes:

  • 200: no error
  • 400: invalid parameter(s) specified. See errors element in response for details.
  • 403: api_key not provided, invalid, or accessed from origin (protocol+domain) other than the one associated with the key provided.

Response Fields:

  • id: Id of the live event
  • begin: Date/time event starts in ISO8601 format
  • description: Event description
  • embed: HTML embed code for event
  • end: Date/time event ends in ISO8601 format
  • thumbnail: [array] Resized image of event poster as specified by thumb_XXX params
  • title: Event title

GET /snippets/{id}

Get additional details about external event

Example request:

GET /snippets/5?api_key=key-XXXXXXXXXXXXX HTTP/1.1
Host: api.dvidshub.net
Accept-encoding: gzip, deflate
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example response:

HTTP/1.1 400 Bad Request
Date: Tue, 16 Jul 2019 14:03:09 GMT
Server: Apache/2.4.18 (Ubuntu)
Set-cookie: PHPSESSID=95k4san2prrfs65g8p4h86ms11; path=/; domain=.dvidshub.net; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-control: no-store, no-cache, must-revalidate
Pragma: no-cache
Access-control-allow-origin: *
Content-length: 75
Content-type: application/json

{
    "error":0,
    "message":"Dvids_Model_Snippet with params (id => 5) not found"
}

Query Parameters:

  • api_key: Public API access key issued by DVIDS (key-xxxxxxxxxxxxx)
  • id: [int] Id of of the live event

Status Codes:

  • 200: no error
  • 400: invalid parameter(s) specified. See errors element in response for details.
  • 403: api_key not provided, invalid, or accessed from origin (protocol+domain) other than the one associated with the key provided.

Response Fields:

  • id: Id of the live event
  • begin: Date/time event starts in ISO8601 format
  • description: Event description
  • embed: HTML embed code for event
  • end: Date/time event ends in ISO8601 format
  • thumbnail: [array] Resized image of event poster as specified by thumb_XXX params
  • title: Event title