topical media & game development
server-webapi-code-09-addItem.php / php
<?php
exit('FILL IN YOUR DEV TOKENS!');
appID = '';
token = '';
version = "405";
token]]></RequestToken>
<Country>US</Country>
<Category>14111</Category>
<Currency>1</Currency>
<Description>This is the item description.</Description>
<ListingDuration>Days_7</ListingDuration>
<Location>San Jose, CA</Location>
<PaymentMethods>PaymentSeeDescription</PaymentMethods>
<PrimaryCategory>
<CategoryID>357</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<RegionID>0</RegionID>
<ReservePrice>5.0</ReservePrice>
<StartPrice>1.0</StartPrice>
<Title>Test Auction, TESTBAIT23</Title>
<VisaMaster>1</VisaMaster>
<SellerPays>0</SellerPays>
<Version>2</Version>
<Duration><![CDATA[5]]></Duration>
<MinimumBid>1.00</MinimumBid>
</request>";
// header("Content-Type: application/xml");
//request, 1, "AddItem");
//echo
itemInfo = array();
addItem(itemInfo)
{
global itemInfo[] = array("DetailLevel" => "1");
itemInfo[] = array("Verb" => "AddItem");
itemInfo[] = array("RequestToken" => request = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
itemInfo as value)
{
key}>{key}>\n";
}
request, callName)
{
global appID, token, requestLength = strlen(headers = array();
headers[] = "X-EBAY-API-SESSION-CERTIFICATE: headers[] = "X-EBAY-API-DEV-NAME: headers[] = "X-EBAY-API-APP-NAME: headers[] = "X-EBAY-API-CERT-NAME: headers[] = "X-EBAY-API-CALL-NAME: headers[] = "X-EBAY-API-SITEID: 0";
detailLevel";
headers[] = "Content-Length: ch = curl_init();
curl_setopt(endPoint);
curl_setopt(ch, CURLOPT_HTTPHEADER, ch, CURLOPT_POST, true); // Send a POST
curl_setopt(request); // This is the post to send
curl_setopt(data = curl_exec(ch);
return
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.