$baseurl = 'https://sandbox-api.ininal.com';
$currentDate = gmdate('D, d M Y H:i:s T');
$contentType ='application/json';
$language ='TR';
$uri ='/v2/oauth/accesstoken';
$url = $baseurl . $uri;
$authorization = 'Basic M2RrZDU4ZnN3ZGY5NTNlMGQxOGE0cmZlNDU0NWRmYTIxMWZhNDVyZnMzZjk1OTQ6MzQzZGZzZzU0MzMyMzJ3cjY1NTMyMmQzNDY0NWZ0NjE2NTY1MzQyMjQ1MmV3M3J3dDU1Mw==';
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array('Date:'.$currentDate, 'Authorization:'.$authorization, 'Content-Type:'.$contentType, 'Language:'.$language),
));
$response = curl_exec($ch);
if($response === FALSE){
die(curl_error($ch));
}
$responseData = json_decode($response, TRUE);
echo $response;
;?>
buradaki kod sandbox ortamında giriş yaptırıyor response donen sonucumuz fakat ben giriş başarılı ise accessToken yazdırmak istiyorum
RESPONSE SAMPLES
Kopyala
{
"httpCode": 200,
"description": "string",
"response": {
"accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0OTI1MDM1NDcsInN1YiI6IklOSU5BTCIsImlzcyI6IjFkNTZlYmY4OTk1M2UwZDE4YTMxZGUxZjAwNmVkYjMyMTFmYTYwNjVlNGVmOTU5MyIsInNjb3BlIjoiUkVBRCxXUklURSxERUxFVEUsRVhFQ1VURSxBRE1JTl9SRUFELEFETUlOX1dSSVRFLEFETUlOX0RFTEVURSxBRE1JTl9FWEVDVVRFLENIQU5ORUxfUkVBRCxDSEFOTkVMX1dSSVRFLENIQU5ORUxfREVMRVRFLENIQU5ORUxfRVhFQ1VURSxPVVRCT1VORF9SRUFELE9VVEJPVU5EX1dSSVRFLE9VVEJPVU5EX0RFTEVURSxPVVRCT1VORF9FWEV",
"tokenType": "Bearer",
"expiresIn": "3600000"
},
"validationErrors": {
"property1": "string",
"property2": "string"
}
}
buda kaynak api kodları
https://developer.ininal.com/authentication#operation/v2-oauth-accesstoken