i want to know step by step procedure to use API to get data in CAP format #364
Replies: 1 comment
-
This made me look back over the Examples tab on the documentation page and realize the Alerts example is missing details on the common CAP format. I'll add those shortly. Until then... The most important step in requesting CAP is setting the request Accept header. Alert endpoints either return a list of alert summaries, or details of a single alert. The lists use ATOM, and the details use CAP. You can also use the default JSON to discover then request CAP for specific alerts. To return a list in ATOM, the request should use the Accept header If you already know the alert id, you can directly request the /alerts/{id} endpoint. For example (note this id will expire at some point and be invalid): Here is an example of using an Accept header for CAP in curl: The other /alerts endpoints and parameters can be used to discover alert ids, including active alerts using the /alerts/active endpoint. For example: Here is an example of using an Accept header for ATOM in curl: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NOTE
Please do not report operational issues (such as outages) here. We can not support these issues via this forum. Please report these as described here: https://weather-gov.github.io/api/reporting-issues
Please describe what you're trying to do.
A clear and concise description of what your issue is. Ex. I'm looking for forecast data...
Beta Was this translation helpful? Give feedback.
All reactions