That's the output
string(84) "{"errorCode": 500, "errorMessage": "INVALID_URI", "results": null, "statusCode": ""}"
array(4) {
["errorCode"]=>
int(500)
["errorMessage"]=>
string(11) "INVALID_URI"
["results"]=>
NULL
["statusCode"]=>
string(0) ""
}In v2 I got other error message
Here is the code
<?php
$ch = curl_init();
$token = 'a1ab30ed221a';
$a_link_params = array (
'login' => 'mylogin',
'apiKey' => 'myapikey',
'format' => 'json'
);
$url .= '?' . http_build_query($a_link_params);
echo "url: " . $url . "<br>";
$a_curl_options = array (
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_CONNECTTIMEOUT => 30
);
curl_setopt_array($ch, $a_curl_options);
curl_setopt($ch, CURLOPT_POST, false);
$result = curl_exec($ch);
echo "<pre>";var_dump($result);echo "</pre>";
curl_close($ch);
$obj = json_decode($result, true);
echo "<pre>";var_dump($obj);echo "</pre>";
// $SLink = $obj["results"]["longurl"]["shortUrl"];
//echo $SLink; ?>