简体   繁体   中英

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.

$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);

I'm pretty sure I figured out what the problem is, I finally got an error message out of the response and it says: "SSL certificate problem: unable to get local issuer certificate". I suppose the curl operation must come from a secure location before eBay will send the information in the request.

If anyone else has any other ideas, please let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM