Integrating with Webhooks
Use spike's webhook and create an incident from your code.
From your code, you can create an incident simply by making a POST request.
Create an incident
The above request will create a new incident. Please make sure you have used the correct webhook URL. If you have copied the URL from the dashboard then the token should already be present. A new incident is created soon as make a POST request. A successful request will get you 200 HTTP response status code.
If the integration has an open incident (not resolved state) with the same title then a new incident will NOT be created.
The title plays an important role really. A new incident will use this title and it will be sent on all alter channels. The title acts as a unique identifier to perform group actions, suppress repeated incidents and also to auto-resolve them.
Failing to add title would create incidents with no message. This also means that it will NOT group, suppress or auto-resolve these incidents.
The above request will automatically resolve incidents. We use the title and the token to uniquely get open incidents and resolve them.
All you need is to add the status parameter as 'resolve' in your POST request. The rest of the parameters are the same as creating incident request.