Skip to content
Charles Graham edited this page Mar 19, 2024 · 4 revisions

Requests or Responses from the API may include headers with additional information. This includes any planned headers.

Response Headers

Header Can multiple occur Purpose Additional information expected
X-CWMS-Deprecated one for each deprecated element Indicated some usage of this endpoint is no longer going to be supported Information displayable to a user or developer about what should replace this usage.

Request Headers

Header Can multiple occur Purpose Additional information expected
Accept One per request Tells the MIME type of the data and the version of the given endpoint to use For some endpoints (/timeseries) you can specify in the Accept header to use version 2 of the API. We highly recommend migrating and/or doing this as it greatly simplifies working with the data in your client application. V1 will be depreciated by End of Year 2024 (or sooner)

i.e. {"accept": "application/json;version=2"}
You will see this in the SwaggerUI for any endpoints that can use it.
Consider running a request with and without this to compare the response JSON for each.

NOTE: If you paste a URL into the browser this WILL use V1.
You can confirm what version you are using by:

  1. Open the Developer Tools for your browser (run the query again after you do this)
  2. Click the network tab
  3. Click the URL of the request
  4. Click the headers tab
  5. Look at the Request headers. You should see the accept header that was used
Clone this wiki locally