curl request in udemy api using php

To make any calls to Udemy REST API, you will need to create an API client. API client consists of a bearer token, which is connected to a user account on Udemy. To send authenticated requests, provide the client_id and client_secret values as a base64 encoded HTTP Authorization header. You may also like curl request in udemy api using php and export data in excel file and Lusha API using PHP curl.


header('Content-Type: application/json');
$url = "[user]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Udemy-Client-Id:','X-Udemy-Client-Secret:',"Authorization:","Accept: application/json, text/plain, */*"));
curl_setopt($ch, CURLINFO_HEADER_OUT, true);

curl_getinfo($ch, CURLINFO_HEADER_OUT);
$result = json_decode($result);

Leave a Reply

Your email address will not be published. Required fields are marked *