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
User-Agent: Zend_Http_Client
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example response:

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 2
Connection: keep-alive
Date: Wed, 31 May 2023 22:18:44 GMT
Server: Apache
Set-cookie: PHPSESSID=23a1300c99c595d0da4ca43646e01e0e; 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: *
X-cache: Miss from cloudfront
Via: 1.1 e58f499d9cd10c42a7ba13215f40c914.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
X-amz-cf-id: Zbx0IaLGqD18IBeHH-YpFj38c9rz-5kbQmvDXZbbhT2e7UfXj5ywjA==

[

]

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
User-Agent: Zend_Http_Client
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example response:

HTTP/1.1 400 Bad Request
Content-type: application/json
Content-length: 75
Connection: keep-alive
Date: Wed, 31 May 2023 22:18:44 GMT
Server: Apache
Set-cookie: PHPSESSID=8e7dde96473e8a9138b5e62bc6f67245; 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: *
X-cache: Error from cloudfront
Via: 1.1 e58f499d9cd10c42a7ba13215f40c914.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
X-amz-cf-id: ca-aaiuISOJPXR7Y6oUaKfiw8vl5R98d92vxIAp0PgkmY82URzyX8A==

{
    "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