<?php
//Enter your endpoint
$authorizationEndpoint = "https://s...content-available-to-author-only...y.com/api/v1/auth/login" ;
//Monnify API Credentials
$clientID = "MK_TEST_1MC3T269JV" ;
$clientSecret =
"5PAV3G1Z4Q8JQ92G7XXD6K45CJ4YNMY6" ;
//Set the request Header
"Content-Type: application/json" ,
"Authorization: Basic " . base64_encode ( $clientID . ":" . $clientSecret ) ) ;
//Init the cURL session
//Set some configurations
//Execute the cURL Session
echo "Access Token: " . $accessToken = $responseData -> responseBody -> accessToken ;
?>
IDw/cGhwCi8vRW50ZXIgeW91ciBlbmRwb2ludAogJGF1dGhvcml6YXRpb25FbmRwb2ludCA9ICJodHRwczovL3MuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnkuY29tL2FwaS92MS9hdXRoL2xvZ2luIjsKCiAvL01vbm5pZnkgQVBJIENyZWRlbnRpYWxzCiRjbGllbnRJRCA9ICJNS19URVNUXzFNQzNUMjY5SlYiOwokY2xpZW50U2VjcmV0PQoiNVBBVjNHMVo0UThKUTkyRzdYWEQ2SzQ1Q0o0WU5NWTYiOwogCgovL1NldCB0aGUgcmVxdWVzdCBIZWFkZXIKJGhlYWRlcnMgPSBhcnJheSgKICJDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24iLAoiQXV0aG9yaXphdGlvbjogQmFzaWMgIi4gYmFzZTY0X2VuY29kZSgkY2xpZW50SUQgLiAiOiIgLiAkY2xpZW50U2VjcmV0KQopOwoKCiAvL0luaXQgdGhlIGNVUkwgc2Vzc2lvbgokY2ggPSBjdXJsX2luaXQoJGF1dGhvcml6YXRpb25FbmRwb2ludCk7CiAKLy9TZXQgc29tZSBjb25maWd1cmF0aW9ucwpjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfUE9TVCwgMSk7CgpjdXJsX3NldG9wdCgkY2gsIENVUkxPUFRfSFRUUEhFQURFUiwgJGhlYWRlcnMpOwoKY3VybF9zZXRvcHQoJGNoLCBDVVJMT1BUX1J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3NldG9wdCgkY2gsIENVUkxPUFRfSFRUUEhFQURFUiwgJGhlYWRlcnMpOwoKY3VybF9zZXRvcHQoJGNoLCBDVVJMT1BUX1JFVFVSTlRSQU5TRkVSLCB0cnVlKTsKCi8vRXhlY3V0ZSB0aGUgY1VSTCBTZXNzaW9uCiRyZXNwb25zZSA9IGN1cmxfZXhlYygkY2gpOwoKCiRyZXNwb25zZURhdGEgPSBqc29uX2RlY29kZSgkcmVzcG9uc2UpOwoKIGVjaG8gJnF1b3Q7QWNjZXNzIFRva2VuOiAmcXVvdDsgLiAkYWNjZXNzVG9rZW4gPSRyZXNwb25zZURhdGEtJmd0O3Jlc3BvbnNlQm9keS0mZ3Q7YWNjZXNzVG9rZW47CiA/Jmd0Ow==
<?php
//Enter your endpoint
$authorizationEndpoint = "https://s...content-available-to-author-only...y.com/api/v1/auth/login";
//Monnify API Credentials
$clientID = "MK_TEST_1MC3T269JV";
$clientSecret=
"5PAV3G1Z4Q8JQ92G7XXD6K45CJ4YNMY6";
//Set the request Header
$headers = array(
"Content-Type: application/json",
"Authorization: Basic ". base64_encode($clientID . ":" . $clientSecret)
);
//Init the cURL session
$ch = curl_init($authorizationEndpoint);
//Set some configurations
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//Execute the cURL Session
$response = curl_exec($ch);
$responseData = json_decode($response);
echo "Access Token: " . $accessToken =$responseData->responseBody->accessToken;
?>