davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
349 stars 341 forks source link

Item’s HTML Description #227

Closed amirvenus closed 4 years ago

amirvenus commented 5 years ago

How can I get an item’s HTML description? It’s a live listing and I have its id.

michabbb commented 5 years ago

Which example did you use and what's exactly the problem when you try the example code?

amirvenus commented 5 years ago

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.

?>`

michabbb commented 5 years ago

That's your code, okay, but what's the error you get?

amirvenus commented 5 years ago

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

michabbb commented 5 years ago

Have you searched for the word "description" in the ebay docu of the call "getMyeBaySelling"?

amirvenus commented 5 years ago

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.

michabbb commented 5 years ago

Have you searched for the word "description" in the ebay docu of the call "getMyeBaySelling"?

amirvenus commented 5 years ago

I have but I cannot find anything

michabbb commented 5 years ago

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 ?

amirvenus commented 5 years ago

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.

michabbb commented 5 years ago

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 ?

amirvenus commented 5 years ago

http://developer.ebay.com/devzone/xml/docs/reference/ebay/getmyebayselling.html

sunil11475 commented 5 years ago

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

michabbb commented 5 years ago

@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 😏