question

cardboard.superstars avatar image
0 Likes"
cardboard.superstars asked

How to make a GET cURL request to eBay Restful API in php

I'm having trouble getting a Restful GET cURL to the Ebay API, the code I'm using is below, could someone tell me what I'm doing wrong. Since some of the XML API Calls are being deprecated, I'd like to just design my code now to use the new Restful API's.


This code returns an empty response, no errors, error codes, nothing at all. Could anyone tell me what I'm doing wrong?

$headers = array
(
    'Authorization: Bearer '.$oAuth
);

$queryString = '?category_id=213';
$url = 'https://api.sandbox.ebay.com/commerce/taxonomy/v1/category_tree/64482/get_item_aspects_for_category';

$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url.$queryString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$response = curl_exec($ch);
curl_close($ch);

print_r($response);
taxonomy api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.