Classic ASP / Support API / Bulk Unregister Push Notification Devices
Back to Collection Items
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
set http = Server.CreateObject("Chilkat_9_5_0.Http")
http.BasicAuth = 1
http.Login = "login"
http.Password = "password"
' Use this online tool to generate code from sample JSON: Generate Code to Create JSON
' The following JSON is sent in the request body.
' {}
set json = Server.CreateObject("Chilkat_9_5_0.JsonObject")
http.SetRequestHeader "Content-Type","application/json"
http.SetRequestHeader "Accept","application/json"
' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PostJson3("https://example.zendesk.com/api/v2/push_notification_devices/destroy_many","application/json",json)
If (http.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
set sbResponseBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = resp.GetBodySb(sbResponseBody)
set jResp = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0
Response.Write "<pre>" & Server.HTMLEncode( "Response Body:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( jResp.Emit()) & "</pre>"
respStatusCode = resp.StatusCode
Response.Write "<pre>" & Server.HTMLEncode( "Response Status Code = " & respStatusCode) & "</pre>"
If (respStatusCode >= 400) Then
Response.Write "<pre>" & Server.HTMLEncode( "Response Header:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.Header) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Failed.") & "</pre>"
Response.End
End If
%>
</body>
</html>
Curl Command
curl -u login:password -X POST
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{}'
https://example.zendesk.com/api/v2/push_notification_devices/destroy_many
Postman Collection Item JSON
{
"name": "Bulk Unregister Push Notification Devices",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"headerFamily": "json",
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/api/v2/push_notification_devices/destroy_many",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"push_notification_devices",
"destroy_many"
]
},
"description": "Unregisters the mobile devices that are receiving push notifications. Specify the devices as an array of mobile device tokens.\n\n#### Allowed for\n\n* Admins"
},
"response": [
{
"name": "Successful response",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"headerFamily": "json",
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/api/v2/push_notification_devices/destroy_many",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"push_notification_devices",
"destroy_many"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "<string>"
}
]
}