DataFlex / Squadcast API V3 / Get Incident Events
Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vQueryParams
Handle hoQueryParams
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
If (Not(IsComObjectCreated(hoQueryParams))) Begin
Send CreateComObject of hoQueryParams
End
Get ComUpdateInt Of hoQueryParams "offset" 1 To iSuccess
Get ComUpdateInt Of hoQueryParams "limit" 10 To iSuccess
Get ComUpdateString Of hoQueryParams "sort" "asc" To iSuccess
Get ComUpdateString Of hoQueryParams "deduped" "true" To iSuccess
// Adds the "Authorization: Bearer <access_token>" header.
Set ComAuthToken Of hoHttp To "<access_token>"
Get pvComObject of hoQueryParams to vQueryParams
Get ComQuickRequestParams Of hoHttp "GET" "https://api.squadcast.com/v3/incidents/:incidentID/events" vQueryParams To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
Curl Command
curl -G -d "offset=1"
-d "limit=10"
-d "sort=asc"
-d "deduped=true"
-H "Authorization: Bearer <access_token>"
https://api.squadcast.com/v3/incidents/:incidentID/events
Postman Collection Item JSON
{
"name": "Get Incident Events",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{sq_pb_auth_header}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/incidents/:incidentID/events?offset=1&limit=10&sort=asc&deduped=true",
"host": [
"{{baseUrl}}"
],
"path": [
"incidents",
":incidentID",
"events"
],
"query": [
{
"key": "offset",
"value": "1",
"description": "non zero value"
},
{
"key": "limit",
"value": "10",
"description": "non zero value, maximum is 10"
},
{
"key": "sort",
"value": "asc",
"description": "sort it by either asc or desc"
},
{
"key": "deduped",
"value": "true",
"description": "if set to true, it will return only the deduped events.\n\nif set to false, it will return only the non-deduped event.\n\notherwise it will return all the events"
}
],
"variable": [
{
"key": "incidentID",
"value": "5d81d9bc60e42f6b99ca4307"
}
]
},
"description": "- This endpoint is used to get all the deduped incident events details by either ID or number.\n- Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header.\n\nQuery Params:\n```\noffset - non zero value\nlimit - non zero value, maximum is 10\nsort - sort it by either asc or desc\ndeduped - if set to true, it will return only the deduplicated events. if set to false, it will return only the non-deduplicated event, otherwise it will return all the events\n```"
},
"response": [
{
"name": "200 OK",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/incidents/:incidentID/events?offset=1&limit=10&sort=asc&deduped=true",
"host": [
"{{baseUrl}}"
],
"path": [
"incidents",
":incidentID",
"events"
],
"query": [
{
"key": "offset",
"value": "1"
},
{
"key": "limit",
"value": "10"
},
{
"key": "sort",
"value": "asc"
},
{
"key": "deduped",
"value": "true"
}
],
"variable": [
{
"key": "incidentID",
"value": "5f6480a22379e9c06df6a32e"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": null,
"cookie": [
],
"body": "{\n \"data\": {\n \"events\": [\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:02.721Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:02.401Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:02.088Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:01.769Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:01.454Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:01.091Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:00.689Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:41:00.24Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n },\n {\n \"incident_id\": \"5f6480a22379e9c06df6a32e\",\n \"alert_source_id\": \"5e868c596b90eec3d4148737\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"time_of_creation\": \"2020-09-18T09:40:59.689Z\",\n \"tags\": null,\n \"deduplication_reason\": {\n \"matched_event_id\": \"5f6480a2b1bafb2fcccce904\",\n \"evaluated_expression\": \"true\",\n \"time_window\": 3600\n },\n \"payload\": {\n \"description\": \"Memory usage of platform pod is above set threshold of 70%\\n\\nThreshold: 70%\\nCurrent usage: 70.1%\",\n \"event_id\": \"6\",\n \"message\": \"Memory out of set threshold : 70.1%\",\n \"metric\": {\n \"absolute\": {\n \"current_value\": 1.402,\n \"threshold\": 1.4,\n \"unit\": \"GB\"\n },\n \"pod\": \"platform-d23ixi-ug5ty\",\n \"relative\": {\n \"current_value\": 70.1,\n \"threshold\": 70\n },\n \"time\": \"2020-09-18T09:37:13.607Z\"\n },\n \"status\": \"trigger\"\n }\n }\n ]\n },\n \"meta\": {\n \"total\": 20,\n \"count\": 10,\n \"current\": \"https://api.squadcast.com/v3/incidents/5f6480a22379e9c06df6a32e/events?offset=0&limit=10&deduped=true\",\n \"next\": \"https://api.squadcast.com/v3/incidents/5f6480a22379e9c06df6a32e/events?deduped=true&limit=10&offset=10\"\n }\n}"
},
{
"name": "401 Unauthorized",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/incidents/:incidentID/events?offset=1&limit=1",
"host": [
"{{baseUrl}}"
],
"path": [
"incidents",
":incidentID",
"events"
],
"query": [
{
"key": "offset",
"value": "1"
},
{
"key": "limit",
"value": "1"
}
],
"variable": [
{
"key": "incidentID",
"value": "5d81d9bc60e42f6b99ca4305"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": null,
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": 401,\n \"error_message\": \"<string>\"\n }\n}"
}
]
}