I managed to get a TOKEN, list all incidents, create one, list details of said incident and even attach a file... but wait, to access the incident... I needed the incident ID; and to get that I needed to go to the web interface, which in a curl script isn't an option. So ... assuming I create an incident with ..
curl -H "X-Samanage-Authorization: Bearer TOKEN" -d '<incident><name>Incident Title</name><priority>High</priority><requester><email>email@example.com</email></requester><description>Incident description</description><category><name>Human Resources</name></category><due_at>Dec 11, 2017</due_at><assignee><email>firstname.lastname@example.org</email></assignee></incident>' -H 'Accept: application/vnd.samanage.v2.1+xml' -H 'Content-Type:text/xml' -X POST https://apieu.samanage.com/incidents.xml
How do I get the incident ID that this action assigned to this POST? using a command line, obviously not the web interface!