question

rickendude avatar image
1 Like"
rickendude asked

Can't make a simple GetItemRequest call

Hi.

In my attempts to make a call to get the actual selling price of a "best offer" item I am trying to use different functions that require POSTing of data.

I just can't make it work. I don't know what I am doing wrong, I read all the guides I could find. Even finding the URI to POST to wasn't too clear and I still hope I at least got this part right...

I would appreciate a push to the right direction (and no. a cliff isn't one ;) )

 

Thanks in advance.

 

<?php
function talk_to_ebay($devid, $appid, $certid, $callname, $xml, $siteid="3", $version="693"){
        $ch = curl_init("https://api.ebay.com/ws/api.dll?siteid=$siteid");
        $headers =      array('X-EBAY-API-COMPATIBILITY-LEVEL: '.$version,
                                          'X-EBAY-API-DEV-NAME: '.$devid,
                                          'X-EBAY-API-APP-NAME: '.$appid,
                                          'X-EBAY-API-CERT-NAME: '.$certid,
                                          'X-EBAY-API-CALL-NAME: '.$callname,
                                          'X-EBAY-API-SITEID: '.$siteid);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
        $output = curl_exec($ch);
        curl_close($ch);
        return simplexml_load_string($output);
}

$devid = 'DEVID';
$appid = 'APPID';
$certid= 'CERTID';
$callname= 'GetItemRequest';

$xml ='
<?xml version="1.0" encoding="utf-8"?>
<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>TOKEN</eBayAuthToken>
</RequesterCredentials>
<ItemID>140805296973</ItemID>
<IncludeItemSpecifics>True</IncludeItemSpecifics>
<DetailLevel>ReturnAll</DetailLevel>
<Version>693</Version>
<WarningLevel>High</WarningLevel>
</GetItemRequest> ';

$foo=talk_to_ebay($devid, $appid, $certid, $callname, $xml);

print_r($foo);

?>

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

1 Answer

· Write an Answer
rickendude avatar image
0 Likes"
rickendude answered

Ooops.

I finally got it.

The function name is GetItem and not GetItemRequest...

Fixed it, it works but still doesn't display the actual selling price...

 

I'll continue searching

· 1
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.

did you finally succeed? I seem to be unable, I get:

 

 Item cannot be accessed.
<BR>This item cannot be accessed because the listing has been deleted, is a Half.com listing, or you are not the seller.
 
 

0 Likes 0 ·

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.