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: Mon, 26 Feb 2024 06:59:36 GMT
Server: Apache
Set-cookie: PHPSESSID=e78968885d3732e745f18707c4c4abb6; 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 7304a96518f6c4657eabe5542a78c41a.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
Alt-svc: h3=":443"; ma=86400
X-amz-cf-id: yPMQJwDS0KLADnaRBI6ODDVIvDECkZDYnKyrf0PhtnNfR1vC2ThByQ==

[

]

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: Mon, 26 Feb 2024 06:59:36 GMT
Server: Apache
Set-cookie: PHPSESSID=a4288f0ff4444e63316f4d75ede86c45; 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 52ad9d3d5f0aff7e88fa3d0fe9458014.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
Alt-svc: h3=":443"; ma=86400
X-amz-cf-id: Vi014pN7V_oaP9f7RNRZmS3Zuz4BQEPqLRGeyHUl5KXPelbExmzfMg==

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