Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

curl request in udemy api using php

by
Category:php
php
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.

Code

header('Content-Type: application/json');
$url = "https://www.udemy.com/api-2.0/courses/?fields[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);


$result=curl_exec($ch);
curl_getinfo($ch, CURLINFO_HEADER_OUT);
curl_getinfo($ch,CURLINFO_HTTP_CODE);
$result = json_decode($result);
print_r($result);
die;    

0 Comments


Html code work in comment box


Related Post