Incident status is not getting update with PATCH request.

Mehvish_Ahmed November 4, 2022

Hi, 

I am trying to update an incident status from "Investigating" to "Resolved" with a PATCH request. Basically, I created a lambda function with a patch request triggered by SNS topic. 

code:

http = urllib3.PoolManager()
encoded_args = urlencode({
"incident_update": {
"status": "resolved",
"body": "issue is Resolved now",
"deliver_notifications": "true"
}

})
API_ENDPOINT = "https://api.statuspage.io/v1/pages/%7BXXXXX%7D/incidents/%XXXXX%7D/incident_updates/%XXXXXX%7D"+ encoded_args
API_KEY = "XXXXXXXX"
HEADERS = {'Authorization': API_KEY}
response = http.request('PATCH', url = API_ENDPOINT, headers=HEADERS)
import json
json.loads(response.data.decode('utf-8'))
{'status': 'success', 'data': [], 'message': 'Successfully! Record has been updated.'}
data = json.loads(response.data)
print(data)

 

Output: {'error': 'The requested resource could not be found.'}

 

Please help me, what is missing and where am I wrong?

1 answer

0 votes
Mehvish_Ahmed November 4, 2022

Seems like api is working but not able to find the incident id or incident update id, 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events