question

stillluvtoys avatar image
0 Likes"
stillluvtoys asked

getProduct errorId 2004 "The request has errors."

This has eaten up 2 full days. Going crazy. I know my Token is fine as it works in the API explorer. I've used the token for many other calls with no issues. I've used the exact headers shown in the API explorer. I've ported the initial routine from VB to PHP - same exact result error both places. Not sure what I'm missing. Here's the PHP code:

<?php

$devID = '6----------------------------------8';

$appID = 'L----------------------------------6';

$certID = 'c---------------------------------f';

$clientID = 'L-------------------------------6';

//set the Server to use (Sandbox or Production)

$serverUrl = 'https://api.ebay.com/ws/api.dll'; // server URL different for prod and sandbox

//the token representing the eBay user to assign the call with


$authAPIToken = "xxxxxxxxxxxxxxxxxxxx......xxxxxx";


$link = "https://api.ebay.com/commerce/catalog/v1_beta/product/59108213";

$ch = curl_init($link);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(

'Content-Type:application/json',

'Accept:application/json',

'X-EBAY-C-MARKETPLACE-ID:EBAY_US',

'Authorization:Bearer '.$authAPIToken

));

curl_setopt($ch, CURLHEADER_SEPARATE, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_POST, 1);

$response = curl_exec($ch);

print '<pre>' . htmlspecialchars(print_r($response, true)) . '</pre>'

ANY help would be appreciated. Thanks is advance.

catalog 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.

stillluvtoys avatar image
0 Likes"
stillluvtoys answered

Oh, I don't care if someone wants to dig through the routine I wrote - or just supply an actual working example in VB or PHP, I'd greatly appreciate it. And just to be clear - I'm trying to retrieve detailed ISBN data from eBay's product catalog. Thanks.

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.

landlcollectables1 avatar image
0 Likes"
landlcollectables1 answered

For future reference, I figured it out. Seems that while most "get..." API calls work with an HTTP Post method - this one will not and produces a fatal error. Switched from "Post" to "Get" and it works flawlessly now.

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.

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.