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?