Call Flipkart API with PHP Code Example

How to Expose and Route to a Resource?
How to Expose and Route to a Resource?

Program – Call Flipkart API with PHP Code Example

Call Flipkart API with PHP Code Example
Call Flipkart API with PHP Code Example

Solution

<?php 
//header('Content-Type: application/json');

$tracking_id = "your tracking id";
$token = "your token";

$handle = "https://affiliate-api.flipkart.net/affiliate/api/$tracking_id.json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $handle);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Fk-Affiliate-Id:{$tracking_id}",
    "Fk-Affiliate-Token:{$token}"
));

$data = json_decode(curl_exec($ch), true);
print_r($data);

Now to have idea to get data from flipkart API. If you got any error please comment below.

इसे भी पढ़े – परवल खाने के Benefits और Side Effects

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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