php - How can i make the call better Trading API -
i trying build monitor ebay store.. dont know recommended way work trading api. found on internet can make call in curl tried this:
$xml = '<?xml version="1.0" encoding="utf-8"?>'. '<getebayofficialtimerequest xmlns="urn:ebay:apis:eblbasecomponents">'. '<requestercredentials>'. '<ebayauthtoken>'. 'xxxxxxxxxxxxxxxxxx'. '</ebayauthtoken>'. '</requestercredentials>'. '<errorlanguage>en_us</errorlanguage>'. '<warninglevel>high</warninglevel>'. '</getebayofficialtimerequest>'; $headers = array( 'content-type: text/xml', 'x-ebay-api-compatibility-level: 967', 'x-ebay-api-dev-name: xxxxxx', 'x-ebay-api-app-name: xxxxxx', 'x-ebay-api-cert-name: xxxxxx', 'x-ebay-api-siteid: 0', 'x-ebay-api-call-name: getebayofficialtime' ); $url = 'https://api.ebay.com/ws/api.dll'; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_postfields, $xml); curl_setopt($ch, curlopt_timeout, 400); curl_setopt($ch, curlopt_ssl_verifypeer, false); $result = curl_exec($ch); curl_close($ch); echo '<pre>'; echo $result; echo '</pre>';
the output is:
2017-04-14t13:25:26.954zsuccess971e971_core_api6_18007281_r1
its work prints values want make call , store values in array or dont know.. im confusion.
my questions is: how can use php & xml calls in better way (if possible)? , how can manage values better?
Comments
Post a Comment