Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. define('XML_POST_URL', 'https://api.sandbox.ebay.com/ws/api.dll');
  2.  
  3. $theData ='
  4. <?xml version="1.0" encoding="utf-8"?>
  5. <GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  6. <RequesterCredentials>
  7. <eBayAuthToken>My Auth Key</eBayAuthToken>
  8. </RequesterCredentials>
  9. <Pagination ComplexType="PaginationType">
  10. <EntriesPerPage>1</EntriesPerPage>
  11. <PageNumber>1</PageNumber>
  12. </Pagination>
  13. <WarningLevel>Low</WarningLevel>
  14. <StartTimeFrom>2011-07-12T21:59:59.005Z</StartTimeFrom>
  15. <StartTimeTo>2011-07-30T21:59:59.005Z</StartTimeTo>
  16. <DetailLevel>ReturnAll</DetailLevel>
  17. </GetSellerListRequest>
  18. ';
  19.  
  20. $headers = array(
  21. 'Content-Type' => 'text/xml',
  22. 'X-EBAY-API-COMPATIBILITY-LEVEL' => '727',
  23. 'X-EBAY-API-DEV-NAME' => '03dbea79-6089-4a00-8b3f-3114882e5d07',
  24. 'X-EBAY-API-APP-NAME' => 'sarfaraz-6e72-49e2-a7c0-ce2d2a48702b',
  25. 'X-EBAY-API-CERT-NAME' => 'd8382047-b425-40d6-8250-bac1497dc510',
  26. 'X-EBAY-API-SITEID' => '0',
  27. 'X-EBAY-API-CALL-NAME' => 'GetSellerList'
  28. );
  29.  
  30. /**
  31. * Initialize handle and set options
  32. */
  33. $ch = curl_init();
  34. curl_setopt($ch, CURLOPT_URL, XML_POST_URL);
  35. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  36. curl_setopt($ch, CURLOPT_POSTFIELDS, $theData);
  37. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  38. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  39.  
  40. /**
  41. * Execute the request
  42. */
  43. $result = curl_exec($ch);
  44.  
  45. /**
  46. * Close the handle
  47. */
  48. curl_close($ch);
  49.  
  50. /**
  51. * Output the results and time
  52. */
  53. header('Content-Type: text/xml');
  54. echo $result;
  55.  
  56. <GeteBayOfficialTimeResponse>
  57. <Timestamp>2011-07-29 15:59:21</Timestamp>
  58. <Ack>Failure</Ack>
  59. <Errors>
  60. <ShortMessage>Unsupported API call.</ShortMessage>
  61. <LongMessage>The API call "GeteBayOfficialTime" is invalid or not supported in this release.</LongMessage>
  62. <ErrorCode>2</ErrorCode>
  63. <SeverityCode>Error</SeverityCode>
  64. <ErrorClassification>RequestError</ErrorClassification>
  65. </Errors>
  66. <Build>13564081</Build>
  67. </GeteBayOfficialTimeResponse>
  68.  
  69. $headers = array(
  70. 'Content-Type: text/xml',
  71. 'X-EBAY-API-COMPATIBILITY-LEVEL: 727',
  72. 'X-EBAY-API-DEV-NAME: 03dbea79-6089-4a00-8b3f-3114882e5d07',
  73. 'X-EBAY-API-APP-NAME: sarfaraz-6e72-49e2-a7c0-ce2d2a48702b',
  74. 'X-EBAY-API-CERT-NAME: d8382047-b425-40d6-8250-bac1497dc510',
  75. 'X-EBAY-API-SITEID: 0',
  76. 'X-EBAY-API-CALL-NAME: GetSellerList'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement