Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function authorise($clientId, $clientSecret
- $b64 = base64_encode($clientId.":".$clientSecret
- $cURLConnection = curl_init(
- $url = "https://api.sandbox.ebay.com/identity/v1/oauth2/token";
- $postFields = array(
- 'grant_type' => 'client_credentials',
- 'scope' => 'https://api.ebay.com/oauth/api_scope'
- );
- curl_setopt($cURLConnection, CURLOPT_URL, $url);
- curl_setopt($cURLConnection, CURLOPT_POST, true);
- curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, array(
- "Authorization:Basic $b64",
- "Content-Type:application/x-www-form-urlencoded"
- ));
- curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postFields))
- $response = curl_exec($cURLConnection);
- curl_close($cURLConnection);
- $result = json_decode($response, true);
Add Comment
Please, Sign In to add comment