Chilkat Online Tools

Perl / Belvo API Docs / Retrieve credit metrics

Back to Collection Items

use chilkat();

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

$http = chilkat::CkHttp->new();

$http->put_BasicAuth(1);
$http->put_Login("{{secretId}}");
$http->put_Password("{{secretPassword}}");

# Use this online tool to generate code from sample JSON: Generate Code to Create JSON

# The following JSON is sent in the request body.

# {
#   "link": "link_id"
# }

$json = chilkat::CkJsonObject->new();
$json->UpdateString("link","link_id");

# resp is a HttpResponse
$resp = $http->PostJson3("https://domain.com/api/risk-insights/","application/json",$json);
if ($http->get_LastMethodSuccess() == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

print $resp->get_StatusCode() . "\r\n";
print $resp->bodyStr() . "\r\n";

Curl Command

curl -X POST
	-u '{{secretId}}:{{secretPassword}}'
	-d '{
    "link": "link_id"
}'
https://domain.com/api/risk-insights/

Postman Collection Item JSON

{
  "name": "Retrieve credit metrics",
  "request": {
    "method": "POST",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"link\": \"link_id\"\n}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/risk-insights/",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "risk-insights",
        ""
      ]
    }
  },
  "response": [
  ]
}