complexdatacollective / Server

A tool for storing, analyzing, and exporting Network Canvas interview data.
http://networkcanvas.com/
GNU General Public License v3.0
2 stars 2 forks source link

Device API versioning #295

Closed wwqrd closed 3 years ago

wwqrd commented 3 years ago

Add required header to device api: X-Device-API-Version.

If version matches server respond as normal, if version mismatch or no header supplied return a 400 error and a json error in the format:

{
  error: 'Device API version mismatch.',
  server: '[Server api version number]'
  device: '[Supplied api version number]'
}

Resolves https://github.com/complexdatacollective/Server/issues/294