Foxpro / Broker API / client_id
        
        Back to Collection Items
        LOCAL loHttp
LOCAL lnSuccess
LOCAL loJson
LOCAL loSbRequestBody
LOCAL loResp
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
loHttp = CreateObject('Chilkat.Http')
loHttp.BasicAuth = 1
loHttp.Login = "{{api_key}}"
loHttp.Password = "{{api_secret}}"
* Use this online tool to generate code from sample JSON: Generate Code to Create JSON
* The following JSON is sent in the request body.
* {
*   "response_type": "token",
*   "redirect_uri": "www.example.com/oauth_redirect",
*   "scope": "general"
* }
loJson = CreateObject('Chilkat.JsonObject')
loJson.UpdateString("response_type","token")
loJson.UpdateString("redirect_uri","www.example.com/oauth_redirect")
loJson.UpdateString("scope","general")
loSbRequestBody = CreateObject('Chilkat.StringBuilder')
loJson.EmitSb(loSbRequestBody)
loResp = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpSb("GET","https:///v1/oauth/clients/:client_id",loSbRequestBody,"utf-8","application/json",loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loJson
    RELEASE loSbRequestBody
    RELEASE loResp
    CANCEL
ENDIF
? STR(loResp.StatusCode)
? loResp.BodyStr
RELEASE loHttp
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loResp
        Curl Command
        curl -X GET
	-u '{{api_key}}:{{api_secret}}'
	-d '{
  "response_type": "token",
  "redirect_uri": "www.example.com/oauth_redirect",
  "scope": "general"
}'
https:///v1/oauth/clients/:client_id
        Postman Collection Item JSON
        {
  "name": "client_id",
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "method": "GET",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"response_type\": \"token\",\n  \"redirect_uri\": \"www.example.com/oauth_redirect\",\n  \"scope\": \"general\"\n}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "/v1/oauth/clients/:client_id",
      "path": [
        "v1",
        "oauth",
        "clients",
        ":client_id"
      ],
      "variable": [
        {
          "key": "client_id",
          "value": null
        }
      ]
    },
    "description": "| Attribute         | Type   | Notes                                  |\n| ----------------- | ------ | -------------------------------------- |\n| `response_type`   | string | ENUM: `code` or `token`                |\n| `redirect_uri`    | string | Redirect URI of the OAuth flow         |\n| `scope`           | string | Requested scopes by the OAuth flow     |"
  },
  "response": [
  ]
}