Chilkat Online Tools

VBScript / Support API / Verify Support Address Forwarding

Back to Collection Items

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = CreateObject("Chilkat_9_5_0.Http")

http.BasicAuth = 1
http.Login = "login"
http.Password = "password"

http.SetRequestHeader "Accept","application/json"

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.QuickRequest("PUT","https://example.zendesk.com/api/v2/recipient_addresses/:support_address_id/verify")
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

set sbResponseBody = CreateObject("Chilkat_9_5_0.StringBuilder")
success = resp.GetBodySb(sbResponseBody)

set jResp = CreateObject("Chilkat_9_5_0.JsonObject")
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0

outFile.WriteLine("Response Body:")
outFile.WriteLine(jResp.Emit())

respStatusCode = resp.StatusCode
outFile.WriteLine("Response Status Code = " & respStatusCode)
If (respStatusCode >= 400) Then
    outFile.WriteLine("Response Header:")
    outFile.WriteLine(resp.Header)
    outFile.WriteLine("Failed.")

    WScript.Quit
End If


outFile.Close

Curl Command

curl  -u login:password -X PUT
	-H "Accept: application/json"
https://example.zendesk.com/api/v2/recipient_addresses/:support_address_id/verify

Postman Collection Item JSON

{
  "name": "Verify Support Address Forwarding",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v2/recipient_addresses/:support_address_id/verify",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "recipient_addresses",
        ":support_address_id",
        "verify"
      ],
      "variable": [
        {
          "key": "support_address_id",
          "value": "<integer>"
        }
      ]
    },
    "description": "Sends a test email to the specified support address to verify that email forwarding for the address works. An external support address won't work in Zendesk Support until it's verified.\n\n**Note**: You don't need to verify Zendesk support addresses.\n\nThe endpoint takes the following body parameter: `{\"type\": \"forwarding\"}`.\n\nUse this endpoint after [adding](#create-support-address) an external support address to Zendesk Support and setting up forwarding on your email server. See [Forwarding incoming email to Zendesk Support](https://support.zendesk.com/hc/en-us/articles/203663266).\n\nThe endpoint doesn't return the results of the test. Instead, use the [Show Support Address](#show-support-address) endpoint to check that the `forwarding_status` property is \"verified\".\n\n#### Allowed For\n\n* Admins\n* Agents with permission to manage channels and extensions. See the system permissions in [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026-Creating-custom-roles-and-assigning-agents-Enterprise-#topic_cxn_hig_bd) in the Support Help Center\n"
  },
  "response": [
    {
      "name": "Success response",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/recipient_addresses/:support_address_id/verify",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "recipient_addresses",
            ":support_address_id",
            "verify"
          ],
          "variable": [
            {
              "key": "support_address_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "<string>"
    }
  ]
}