L
L
leshka2696072020-10-24 14:15:20
PHP
leshka269607, 2020-10-24 14:15:20

EPN api how to get a shortened link ali.pub?

Hi all! I can't figure out how to get

a shortened link to the product
ali.pub //oauth2.epn.bz/ssid?v=2&client_id=web-client STEP 2) Next, you need to get an access_token https://app.epn.bz/swagger/redoc?v=2#tag/auth%2Fpa... throws an error at this step: {"errors":[{"error":400001,"error_description":"check API version"}],"result":false} //////// ///STEP 1 //try to get ssid_token like this first // if( $curl = curl_init() ) { curl_setopt($curl,CURLOPT_URL,' https://oauth2.epn.





');
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
}

json_decode($out);
$array = json_decode($out, true);
echo "";
print_r($array);

$ssid_token = $array['data']['attributes']['ssid_token'];
echo 'token here' . $ssid_token;


///STEP 2
$data = array(
"grant_type" => "password",
"username" => "***",
"password" => "***",
"client_id" => "web client ",
);

$data = json_encode($data, JSON_UNESCAPED_UNICODE);

$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => " https://oauth2.epn.bz/token?v=2 ",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($data)
));
$response = curl_exec($myCurl);
curl_close($myCurl);

echo "Answer to your request: ".$response;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question