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: Fri, 26 Apr 2024 06:54:41 GMT
Server: Apache
Set-cookie: PHPSESSID=b6f9798fb51e1cf36841ac42ad6d72a9; 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 0c9c133650294ca2485db2f5e74b2d10.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
Alt-svc: h3=":443"; ma=86400
X-amz-cf-id: anDONi42kZAWheJIQVBn5kUS9-d2j0crNrmzxGqeK4_CqqBB62INXA==

[

]

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: Fri, 26 Apr 2024 06:54:41 GMT
Server: Apache
Set-cookie: PHPSESSID=21f6b8ac3edf49cad10ddb5f1e58962e; 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 f63a9bb4aae02f02eec90d4f5c360d60.cloudfront.net (CloudFront)
X-amz-cf-pop: IAD66-C1
Alt-svc: h3=":443"; ma=86400
X-amz-cf-id: rOJXo9-iTWjQDPmCjh9P_4ujARjFcHTO_fjHsL7l5vSHzLLIRFmbyw==

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