Closed amirvenus closed 4 years ago
Which example did you use and what's exactly the problem when you try the example code?
This is my code:
All I want is to get the item's HTML description
`<?php
require 'vendor/autoload.php';
use \DTS\eBaySDK\Constants; use \DTS\eBaySDK\Trading\Services; use \DTS\eBaySDK\Trading\Types; use \DTS\eBaySDK\Trading\Enums;
$key ='myKey'; $siteId = Constants\SiteIds::GB;
// Create the service object.
$service = new Services\TradingService([ 'authToken' => $key, 'credentials' => [ 'appId' => 'myappid', 'certId' => 'mycertid', 'devId' => 'mycertid' ], 'siteId' => $siteId ]);
$args = array( "detailLevel" => "ReturnAll" ); // Create the request object. $request = new Types\GetMyeBaySellingRequestType(); /**
$item = new Types\ItemType(); /**
$request->ActiveList = new Types\ItemListCustomizationType(); $request->ActiveList->Include = true; $request->ActiveList->Pagination = new Types\PaginationType(); $request->ActiveList->Pagination->EntriesPerPage = 200; $request->ActiveList->Sort = Enums\ItemSortTypeCodeType::C_CURRENT_PRICE_DESCENDING; $pageNum = 1; $itemsArr = array(); do { $request->ActiveList->Pagination->PageNumber = $pageNum; /**
Output the result of calling the service operation. */ //echo "==================\nResults for page $pageNum\n==================\n"; if (isset($response->Errors)) { foreach ($response->Errors as $error) { printf( "%s: %s\n%s\n\n", $error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', $error->ShortMessage, $error->LongMessage ); } } if ($response->Ack !== 'Failure' && isset($response->ActiveList)) {
foreach ($response->ActiveList->ItemArray->Item as $item) {
/* printf(
"<br>(%s) %s: %s %.2f\n<br>",
$item->ItemID,
$item->Title,
$item->SellingStatus->CurrentPrice->currencyID,
$item->SellingStatus->CurrentPrice->value
); */
$tempArr = array('ItemId' => $item->ItemID, 'Title' => $item->Title, 'Currency' => $item->SellingStatus->CurrentPrice->currencyID, 'Value' => $item->SellingStatus->CurrentPrice->value);
array_push($itemsArr, $tempArr);
}
} $pageNum += 1; } while (isset($response->ActiveList) && $pageNum <= $response->ActiveList->PaginationResult->TotalNumberOfPages); echo json_encode($itemsArr);
// Output the result of calling the service operation.
?>`
That's your code, okay, but what's the error you get?
In that loop, Where:
$item->ItemID, $item->Title
I am not getting any errors but I just want to:
$item->Description
But it’s null/does not exist
Have you searched for the word "description" in the ebay docu of the call "getMyeBaySelling"?
I know how to set a description using the Revise but I don't know how to get it as I have been looking everywhere and I cannot find it.
I found this example useful: https://github.com/davidtsadler/ebay-sdk-examples/blob/master/trading/11-get-my-ebay-selling.php
But again, it only addresses title and price of the items and not the HTML description I am looking for.
Have you searched for the word "description" in the ebay docu of the call "getMyeBaySelling"?
I have but I cannot find anything
okay, that´s very strange, because the word "Description" appears 71 times in the docu of your call, so very very strange you say "you cannot find anything" 😂 what´s the url of the docu you looked in ?
Yes but most of them are not about Active listings.
Could you just help me with getting item’s HTML Description of active listings please?
I am a beginner and find it hard to understand the API.
i am doing, all the time, but help is not helping when you don´t understand why things work or not. and it´s not a help if i have to ask you everyting twice. so you said, you didn´t find anything. i ask you: what is the url of the docu you looked at ?
If you see the API documentation for the GetMyeBaySelling: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyeBaySelling.html, it does not have the 'description' and the 'Item Specifics' defined in the response xml, hence it will not be returned.
Try using - https://developer.ebay.com/devzone/xml/docs/reference/ebay/GetSellerList.html
@amirvenus there we go.... so do you see the field "Description" at the ouput ? NO. that´s the point as @sunil11475 already mentions. so it´s important to understand the ebay docu to work with this SDK.
and btw.. a google search for "GetMyeBaySelling description" shows you a link to the ebay developer forum which gives you the same answer. so next time: understand the docs, use google 😏
How can I get an item’s HTML description? It’s a live listing and I have its id.