-
Notifications
You must be signed in to change notification settings - Fork 14
Special Headers
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.
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. |
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:
- Open the Developer Tools for your browser (run the query again after you do this)
- Click the network tab
- Click the URL of the request
- Click the headers tab
- Look at the
Request
headers. You should see theaccept
header that was used