Chilkat Online Tools

phpAx / Belvo API Docs / Retrieve credit metrics

Back to Collection Items

<?php

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

$http = new COM("Chilkat_9_5_0.Http");

$http->BasicAuth = 1;
$http->Login = '{{secretId}}';
$http->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 = new COM("Chilkat_9_5_0.JsonObject");
$json->UpdateString('link','link_id');

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

print $resp->StatusCode . "\n";
print $resp->BodyStr . "\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": [
  ]
}