Could someone give me an example of a properly formatted curl example to get an incident by? I am not having luck with the documentation.
@bgflan Hi thank you for your question. You have an example here and also for the different filtering options:https://apidoc.samanage.com/#tag/Incident/operation/getIncidents
You can use this example as well:
curl -v -H "X-Samanage-Authorization: Bearer $TOKEN" -H "Accept: application/vnd.samanage.v2.1+json" -H "Content-Type: application/json" -X GET "https://api.samanage.com/incidents.json?updated=Select%20Date%20Range&updated_custom_gte=Mar%201%202023&updated_custom_lte=Mar%202%202023"
If you are in windows you need to wrap the request URL with double quotes because of the special characters.
Thanks. That works. When I do a curl for just the incident id it returns all incidents. It seem to be ignoring the ?id=394316
api.samanage.com/incidents.json
You don't use a query parameter when you provide the ID. To use an ID, your URI should be like this (replace {id} with the actual number):
"https://api.samanage.com/incidents/{id}.json"
When successful, you'll get a single object instead of a list.
Otherwise, you'll get a 404 if the incident doesn't exist, rather than an empty list.