Chilkat Online Tools

ERROR!

------------------- GenerateCode ----------------------
---- begin chilkat script ----
// This example assumes the Chilkat API to have been previously unlocked.
// See {{-global_unlock:::Global Unlock Sample-}} for sample code.

new Http http;
ckbool success;

// Adds the "Authorization: Bearer {{accessToken}}" header.
http.AuthToken = "{{accessToken}}";
call http.SetRequestHeader("Accept","text/plain, application/json, text/json");

new StringBuilder sbResponseBody;
success = http.QuickGetSb("https://domain.com/v2/accounts/{{accountId}}",sbResponseBody);
if (success == ckfalse) {
    println http.LastErrorText;
    return;
}

println "Response status code = ",http.LastStatus;
println sbResponseBody.GetAsString();

---- end chilkat script ----

swift3 / DocuSign Rooms API - v2 / Get information about the account.

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!
    var success: Bool

    // Adds the "Authorization: Bearer {{accessToken}}" header.
ERROR: Property not found: Http.AuthToken
Assignment type mismatch.  ExpressionType=string, atgType=ERROR:

ERROR: Non-existent Chilkat method:  Http.SetRequestHeader
ERROR: Non-existent Chilkat method:  Http.SetRequestHeader

    let sbResponseBody = CkoStringBuilder()!
ERROR: Entry not found: Http.QuickGetSb
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  emitNewObject:
    atgType: StringBuilder
    varName: sbResponseBody
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

ERROR: Non-existent Chilkat method:  Http.QuickGetSb
Assignment type mismatch.  ExpressionType=ERROR:, atgType=ckbool

    if success == false {
ERROR: Entry not found: Http.LastErrorText
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  emitNewObject:
    atgType: StringBuilder
    varName: sbResponseBody
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

        print("\(http.ERROR: Swift property not found: Http.LastErrorText
)")
        return
    }

ERROR: Entry not found: Http.LastStatus
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  emitNewObject:
    atgType: StringBuilder
    varName: sbResponseBody
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

    print("Response status code = \(http.ERROR: Swift property not found: Http.LastStatus
)")
    print("\(sbResponseBody.getAsString()!)")

}

Curl Command

curl -X GET
	-H "Accept: text/plain, application/json, text/json"
	-H "Authorization: Bearer {{accessToken}}"
https://domain.com/v2/accounts/{{accountId}}

Postman Collection Item JSON

{
  "name": "Get information about the account.",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "text/plain, application/json, text/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/v2/accounts/{{accountId}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2",
        "accounts",
        "{{accountId}}"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    }
  },
  "response": [
  ]
}