Chilkat Online Tools

Classic ASP / GP-API Collection / Ping GP-API

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")

' Adds the "Authorization: Bearer {{token}}" header.
http.AuthToken = "{{token}}"
http.SetRequestHeader "X-GP-Version","2020-12-22"

set sbResponseBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = http.QuickGetSb("https://{{url}}/ucp/ping",sbResponseBody)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( "Response status code = " & http.LastStatus) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( sbResponseBody.GetAsString()) & "</pre>"

%>
</body>
</html>

Curl Command

curl -X GET
	-H "Authorization: Bearer {{token}}"
	-H "X-GP-Version: 2020-12-22"
https://{{url}}/ucp/ping

Postman Collection Item JSON

{
  "name": "Ping GP-API",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}"
      },
      {
        "key": "X-GP-Version",
        "value": "2020-12-22"
      }
    ],
    "url": {
      "raw": "https://{{url}}/ucp/ping",
      "protocol": "https",
      "host": [
        "{{url}}"
      ],
      "path": [
        "ucp",
        "ping"
      ]
    },
    "description": "This request can be sent to periodically check if the API is up"
  },
  "response": [
  ]
}