New output formats for our REST Api: PHP, XML and JSONP

  30 mars 2014       Cet article a 0 commentaire       De Mikaël DELSOL

Before reading this post, please read the post about how to call our REST Api.

As indicated in our previous post only json output format was available. We quickly added 3 new output formats which are :

  • PHP: the data are serialized with serialize
  • XML: the data are transformed to XML data using DOMDocument
  • JSONP: the data are returned as a JSONP-formatted result

The PHP output format

Taking the previous post sample URL as:

  • https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.json

Using the PHP output format is simply made by replacing the last part, meaning json, by php as:

  • https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.php

As simply as this, you get a PHP serialized version of the data:

a:5:{s:10:"error_code";i:0;s:5:"error";b:0;s:12:"error_reason";N;s:13:"output_format";s:3:"php";s:4:"data";a:3:{s:8:"soapcall";a:7:{s:2:"id";s:3:"846";s:5:"title";s:45:"Request sent on 13 February 2014 at 22h58m46s";s:11:"description";s:73:"Call of PayPalServiceGet::GetBalance, nouvelle version PSR-2 de WsdlToPhp";s:7:"created";s:10:"1392328700";s:11:"packagename";s:6:"PayPal";s:11:"servicename";s:16:"PayPalServiceGet";s:10:"methodname";s:10:"GetBalance";}s:8:"requests";a:4:{s:11:"soapoptions";a:2:{s:8:"wsdl_url";s:49:"https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl";s:8:"location";s:30:"https://api-3t.paypal.com/2.0/";}s:11:"soapheaders";a:6:{s:9:"namespace";a:1:{i:1;s:22:"urn:ebay:api:PayPalAPI";}s:4:"name";a:1:{i:1;s:20:"RequesterCredentials";}s:14:"mustunderstand";a:1:{i:1;s:1:"0";}s:5:"actor";a:1:{i:1;s:0:"";}s:9:"data_type";a:1:{i:1;s:36:"PayPalStructCustomSecurityHeaderType";}s:4:"data";a:1:{i:1;a:3:{i:1;s:0:"";i:2;s:0:"";i:3;a:8:{i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:26:"***********************";i:5;s:16:"***********************";i:6;s:56:"**********************************************";i:7;s:0:"";i:8;s:0:"";}}}}s:11:"httpheaders";a:2:{s:4:"name";a:1:{i:0;s:0:"";}s:5:"value";a:1:{i:0;s:0:"";}}s:10:"parameters";a:1:{i:1;a:1:{i:1;a:5:{i:1;s:1:"1";i:2;s:15:"VALUE_RETURNALL";i:3;s:0:"";i:4;s:3:"109";i:5;s:0:"";}}}}s:9:"responses";a:7:{s:10:"xmlrequest";s:885:"<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:ns2="urn:ebay:api:PayPalAPI"> <SOAP-ENV:Header> <ns2:RequesterCredentials> <ns1:Credentials> <ns1:Username>***********************</ns1:Username> <ns1:Password>***********************</ns1:Password> <ns1:Signature>**********************************************</ns1:Signature> </ns1:Credentials> </ns2:RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns2:GetBalanceReq> <ns2:GetBalanceRequest> <ns1:DetailLevel>ReturnAll</ns1:DetailLevel> <ns1:Version>109</ns1:Version> <ns2:ReturnAllCurrencies>1</ns2:ReturnAllCurrencies> </ns2:GetBalanceRequest> </ns2:GetBalanceReq> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ";s:11:"xmlresponse";s:2036:"<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"> <SOAP-ENV:Header> <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/> <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"> <Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"> <Username xsi:type="xs:string"/> <Password xsi:type="xs:string"/> <Signature xsi:type="xs:string"/> <Subject xsi:type="xs:string"/> </Credentials> </RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body id="_0"> <GetBalanceResponse xmlns="urn:ebay:api:PayPalAPI"> <Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2014-03-29T22:30:59Z</Timestamp> <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack> <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">c863480727e10</CorrelationID> <Version xmlns="urn:ebay:apis:eBLBaseComponents">109</Version> <Build xmlns="urn:ebay:apis:eBLBaseComponents">10277387</Build> <Balance xsi:type="cc:BasicAmountType" currencyID="EUR">815.23</Balance> <BalanceTimeStamp xsi:type="xs:dateTime">2014-03-29T22:30:59Z</BalanceTimeStamp> <BalanceHoldings xsi:type="cc:BasicAmountType" currencyID="EUR">815.23</BalanceHoldings> </GetBalanceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ";s:17:"httpheaderrequest";a:6:{s:4:"Host";s:17:"api-3t.paypal.com";s:10:"Connection";s:10:"Keep-Alive";s:10:"User-Agent";s:14:"PHP-SOAP/5.3.5";s:12:"Content-Type";s:23:"text/xml; charset=utf-8";s:10:"SOAPAction";s:2:"""";s:14:"Content-Length";s:3:"770";}s:18:"httpheaderresponse";a:5:{s:4:"Date";s:29:"Sat, 29 Mar 2014 22:30:59 GMT";s:6:"Server";s:6:"Apache";s:14:"Content-Length";s:4:"1940";s:10:"Connection";s:5:"close";s:12:"Content-Type";s:23:"text/xml; charset=utf-8";}s:10:"phprequest";a:1:{i:0;O:25:"PayPalStructGetBalanceReq":6:{s:17:"GetBalanceRequest";O:33:"PayPalStructGetBalanceRequestType":10:{s:19:"ReturnAllCurrencies";s:1:"1";s:11:"DetailLevel";s:9:"ReturnAll";s:13:"ErrorLanguage";N;s:7:"Version";s:3:"109";s:3:"any";N;s:23:"PayPalWsdlClassresult";N;s:26:"PayPalWsdlClasslastError";a:0:{}s:37:"PayPalWsdlClassinternArrayToIterate";N;s:44:"PayPalWsdlClassinternArrayToIterateIsArray";N;s:43:"PayPalWsdlClassinternArrayToIterateOffset";N;}s:23:"PayPalWsdlClassresult";N;s:26:"PayPalWsdlClasslastError";a:0:{}s:37:"PayPalWsdlClassinternArrayToIterate";N;s:44:"PayPalWsdlClassinternArrayToIterateIsArray";N;s:43:"PayPalWsdlClassinternArrayToIterateOffset";N;}}s:11:"phpresponse";O:34:"PayPalStructGetBalanceResponseType":14:{s:7:"Balance";O:27:"PayPalStructBasicAmountType":7:{s:10:"currencyID";s:3:"EUR";s:1:"_";s:6:"815.23";s:23:"PayPalWsdlClassresult";N;s:26:"PayPalWsdlClasslastError";N;s:37:"PayPalWsdlClassinternArrayToIterate";N;s:44:"PayPalWsdlClassinternArrayToIterateIsArray";N;s:43:"PayPalWsdlClassinternArrayToIterateOffset";N;}s:16:"BalanceTimeStamp";s:20:"2014-03-29T22:30:59Z";s:15:"BalanceHoldings";a:1:{i:0;O:27:"PayPalStructBasicAmountType":7:{s:10:"currencyID";s:3:"EUR";s:1:"_";s:6:"815.23";s:23:"PayPalWsdlClassresult";N;s:26:"PayPalWsdlClasslastError";N;s:37:"PayPalWsdlClassinternArrayToIterate";N;s:44:"PayPalWsdlClassinternArrayToIterateIsArray";N;s:43:"PayPalWsdlClassinternArrayToIterateOffset";N;}}s:9:"Timestamp";s:20:"2014-03-29T22:30:59Z";s:3:"Ack";s:7:"Success";s:13:"CorrelationID";s:13:"c863480727e10";s:6:"Errors";N;s:7:"Version";s:3:"109";s:5:"Build";s:8:"10277387";s:23:"PayPalWsdlClassresult";N;s:26:"PayPalWsdlClasslastError";N;s:37:"PayPalWsdlClassinternArrayToIterate";N;s:44:"PayPalWsdlClassinternArrayToIterateIsArray";N;s:43:"PayPalWsdlClassinternArrayToIterateOffset";N;}s:9:"soapfault";s:0:"";}}}

This means that when you received the response, you only have to use the PHP unserialize function as:

$uri = 'https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.php'; $result = file_get_contents($uri); $data =  unserialize($result); $error_code = $data['error_code']; // etc .... 

The XML output format

Using the XML output format is simply made by replacing the last part, meaning json, by xml as:

  • https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.xml

In addition, as DOMDocument allows to generated either a nicely formated output with indentation and extra space or a normal xml string. So we decided to give the availibility to choose between the two output formats. To do so, you have to had an extra GET parameter named formated. If this parameter is omitted or equal to 0, then you get normal xml string. If this parameter is equal to 1, then you get the formated xml string as well indented with extra spaces from this type of URL https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.xml?formated=1:

<?xml version="1.0" encoding="UTF-8"?> <xml formated="true"> <error_code>0</error_code> <error></error> <error_reason/> <output_format>xml</output_format> <data> <soapcall> <id>846</id> <title>Request sent on 13 February 2014 at 22h58m46s</title> <description>Call of PayPalServiceGet::GetBalance, nouvelle version PSR-2 de WsdlToPhp</description> <created>1392328700</created> <packagename>PayPal</packagename> <servicename>PayPalServiceGet</servicename> <methodname>GetBalance</methodname> </soapcall> <requests> <soapoptions> <wsdl_url>https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl</wsdl_url> <location>https://api-3t.paypal.com/2.0/</location> </soapoptions> <soapheaders> <namespace> <array_element index="1">urn:ebay:api:PayPalAPI</array_element> </namespace> <name> <array_element index="1">RequesterCredentials</array_element> </name> <mustunderstand> <array_element index="1">0</array_element> </mustunderstand> <actor> <array_element index="1"></array_element> </actor> <data_type> <array_element index="1">PayPalStructCustomSecurityHeaderType</array_element> </data_type> <data> <array_element index="1"> <array_element index="1"></array_element> <array_element index="2"></array_element> <array_element index="3"> <array_element index="1"></array_element> <array_element index="2"></array_element> <array_element index="3"></array_element> <array_element index="4">*********************</array_element> <array_element index="5">*********************</array_element> <array_element index="6">******************************************</array_element> <array_element index="7"></array_element> <array_element index="8"></array_element> </array_element> </array_element> </data> </soapheaders> <httpheaders> <name> <array_element index="0"></array_element> </name> <value> <array_element index="0"></array_element> </value> </httpheaders> <parameters> <array_element index="1"> <array_element index="1"> <array_element index="1">1</array_element> <array_element index="2">VALUE_RETURNALL</array_element> <array_element index="3"></array_element> <array_element index="4">109</array_element> <array_element index="5"></array_element> </array_element> </array_element> </parameters> </requests> <responses> <xmlrequest><?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:ns2="urn:ebay:api:PayPalAPI"> <SOAP-ENV:Header> <ns2:RequesterCredentials> <ns1:Credentials> <ns1:Username>*********************</ns1:Username> <ns1:Password>*********************</ns1:Password> <ns1:Signature>******************************************</ns1:Signature> </ns1:Credentials> </ns2:RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns2:GetBalanceReq> <ns2:GetBalanceRequest> <ns1:DetailLevel>ReturnAll</ns1:DetailLevel> <ns1:Version>109</ns1:Version> <ns2:ReturnAllCurrencies>1</ns2:ReturnAllCurrencies> </ns2:GetBalanceRequest> </ns2:GetBalanceReq> </SOAP-ENV:Body> </SOAP-ENV:Envelope> </xmlrequest> <xmlresponse><?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"> <SOAP-ENV:Header> <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/> <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"> <Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"> <Username xsi:type="xs:string"/> <Password xsi:type="xs:string"/> <Signature xsi:type="xs:string"/> <Subject xsi:type="xs:string"/> </Credentials> </RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body id="_0"> <GetBalanceResponse xmlns="urn:ebay:api:PayPalAPI"> <Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2014-03-29T22:43:17Z</Timestamp> <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack> <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">e10f1b0643232</CorrelationID> <Version xmlns="urn:ebay:apis:eBLBaseComponents">109</Version> <Build xmlns="urn:ebay:apis:eBLBaseComponents">10277387</Build> <Balance xsi:type="cc:BasicAmountType" currencyID="EUR">815.23</Balance> <BalanceTimeStamp xsi:type="xs:dateTime">2014-03-29T22:43:17Z</BalanceTimeStamp> <BalanceHoldings xsi:type="cc:BasicAmountType" currencyID="EUR">815.23</BalanceHoldings> </GetBalanceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> </xmlresponse> <httpheaderrequest> <Host>api-3t.paypal.com</Host> <Connection>Keep-Alive</Connection> <User-Agent>PHP-SOAP/5.3.5</User-Agent> <Content-Type>text/xml; charset=utf-8</Content-Type> <SOAPAction>""</SOAPAction> <Content-Length>770</Content-Length> </httpheaderrequest> <httpheaderresponse> <Date>Sat, 29 Mar 2014 22:43:17 GMT</Date> <Server>Apache</Server> <Content-Length>1940</Content-Length> <Connection>close</Connection> <Content-Type>text/xml; charset=utf-8</Content-Type> </httpheaderresponse> <phprequest> <array_element index="0" type="PayPalStructGetBalanceReq"> <GetBalanceRequest type="PayPalStructGetBalanceRequestType"> <ReturnAllCurrencies>1</ReturnAllCurrencies> <DetailLevel>ReturnAll</DetailLevel> <ErrorLanguage/> <Version>109</Version> <any/> </GetBalanceRequest> </array_element> </phprequest> <phpresponse type="PayPalStructGetBalanceResponseType"> <Balance type="PayPalStructBasicAmountType"> <currencyID>EUR</currencyID> <_>815.23</_> </Balance> <BalanceTimeStamp>2014-03-29T22:43:17Z</BalanceTimeStamp> <BalanceHoldings> <array_element index="0" type="PayPalStructBasicAmountType"> <currencyID>EUR</currencyID> <_>815.23</_> </array_element> </BalanceHoldings> <Timestamp>2014-03-29T22:43:17Z</Timestamp> <Ack>Success</Ack> <CorrelationID>e10f1b0643232</CorrelationID> <Errors/> <Version>109</Version> <Build>10277387</Build> <any/> </phpresponse> <soapfault></soapfault> </responses> </data> </xml>

As you an see, the whole data are contained within a root tag named xml. This root tag contains one always-present attribute named formated which can have as value true or false depending on the formated GET parameter.

You might also notice the array_element tags. These tags represent array elements with incremental numeric index. Each array_element tag contains several attributes:

  • index: the index's attribute value is the position of the element within the array as we stored the requests and how the SOAP response is returned
  • type: the type of the array element if the element is an object

Any element that represents an object has the type attribute with the class name as value.

The JSONP output format

Using the JSONP output format is simply made by replacing the last part, meaning json, by jsonp as:

  • https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.jsonp

In addition to make it work, you must add the GET-type callback parameter. This parameter gives you the availibility to define which of you javascript function must receive the json response. The JSONP URL should look like https://api.wsdltophp.com/rest/request/v1/send/53d5dbf25871fddb417ca10105ee06ba2022f2a2/846/1.jsonp?callback=obj.getSoapResponse which should return something like this:

obj.getSoapResponse({ "error_code":0, "error":false, "error_reason":null, "output_format":"xml", "data": { "soapcall": { "id":"846", "title":"Request sent on 13 February 2014 at 22h58m46s", "description":"Call of PayPalServiceGet::GetBalance, nouvelle version PSR-2 de WsdlToPhp", "created":"1392328700", "packagename":"PayPal", "servicename":"PayPalServiceGet", "methodname":"GetBalance" }, "requests": { "soapoptions": { "wsdl_url":"https:\/\/www.paypalobjects.com\/wsdl\/PayPalSvc.wsdl", "location":"https:\/\/api-3t.paypal.com\/2.0\/" }, "soapheaders": { "namespace":{ "1":"urn:ebay:api:PayPalAPI" }, "name": { "1":"RequesterCredentials" }, "mustunderstand": { "1":"0" }, "actor":{ "1":"" }, "data_type":{ "1":"PayPalStructCustomSecurityHeaderType" }, "data": { "1":{ "1":"", "2":"", "3":{ "1":"", "2":"", "3":"", "4":"******************************", "5":"******************************", "6":"************************************************************", "7":"", "8":"" } } } }, "httpheaders": { "name":[""], "value":[""] }, "parameters": { "1":{ "1":{ "1":"1", "2":"VALUE_RETURNALL", "3":"", "4":"109", "5":"" } } } }, "responses":{ "xmlrequest":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\" xmlns:ns1=\"urn:ebay:apis:eBLBaseComponents\" xmlns:ns2=\"urn:ebay:api:PayPalAPI\">" + " <SOAP-ENV:Header>" + " <ns2:RequesterCredentials>" + " <ns1:Credentials>" + " <ns1:Username>******************************<\/ns1:Username>" + " <ns1:Password>******************************<\/ns1:Password>" + " <ns1:Signature>************************************************************<\/ns1:Signature>" + " <\/ns1:Credentials>" + " <\/ns2:RequesterCredentials>" + " <\/SOAP-ENV:Header>" + " <SOAP-ENV:Body>" + " <ns2:GetBalanceReq>" + " <ns2:GetBalanceRequest>" + " <ns1:DetailLevel>ReturnAll<\/ns1:DetailLevel>" + " <ns1:Version>109<\/ns1:Version>" + " <ns2:ReturnAllCurrencies>1<\/ns2:ReturnAllCurrencies>" + " <\/ns2:GetBalanceRequest>" + " <\/ns2:GetBalanceReq>" + " <\/SOAP-ENV:Body>" + "<\/SOAP-ENV:Envelope>\n", "xmlresponse":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\" xmlns:SOAP-ENC=\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:xsd=\"http:\/\/www.w3.org\/2001\/XMLSchema\" xmlns:xs=\"http:\/\/www.w3.org\/2001\/XMLSchema\" xmlns:cc=\"urn:ebay:apis:CoreComponentTypes\" xmlns:wsu=\"http:\/\/schemas.xmlsoap.org\/ws\/2002\/07\/utility\" xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\" xmlns:ds=\"http:\/\/www.w3.org\/2000\/09\/xmldsig#\" xmlns:wsse=\"http:\/\/schemas.xmlsoap.org\/ws\/2002\/12\/secext\" xmlns:ed=\"urn:ebay:apis:EnhancedDataTypes\" xmlns:ebl=\"urn:ebay:apis:eBLBaseComponents\" xmlns:ns=\"urn:ebay:api:PayPalAPI\">" + " <SOAP-ENV:Header>" + " <Security xmlns=\"http:\/\/schemas.xmlsoap.org\/ws\/2002\/12\/secext\" xsi:type=\"wsse:SecurityType\"\/>" + " <RequesterCredentials xmlns=\"urn:ebay:api:PayPalAPI\" xsi:type=\"ebl:CustomSecurityHeaderType\">" + " <Credentials xmlns=\"urn:ebay:apis:eBLBaseComponents\" xsi:type=\"ebl:UserIdPasswordType\">" + " <Username xsi:type=\"xs:string\"\/>" + " <Password xsi:type=\"xs:string\"\/>" + " <Signature xsi:type=\"xs:string\"\/>" + " <Subject xsi:type=\"xs:string\"\/>" + " <\/Credentials>" + " <\/RequesterCredentials>" + " <\/SOAP-ENV:Header>" + " <SOAP-ENV:Body id=\"_0\">" + " <GetBalanceResponse xmlns=\"urn:ebay:api:PayPalAPI\">" + " <Timestamp xmlns=\"urn:ebay:apis:eBLBaseComponents\">2014-03-25T19:30:21Z<\/Timestamp>" + " <Ack xmlns=\"urn:ebay:apis:eBLBaseComponents\">Success<\/Ack>" + " <CorrelationID xmlns=\"urn:ebay:apis:eBLBaseComponents\">f42394c06da52<\/CorrelationID>" + " <Version xmlns=\"urn:ebay:apis:eBLBaseComponents\">109<\/Version>" + " <Build xmlns=\"urn:ebay:apis:eBLBaseComponents\">9915774<\/Build>" + " <Balance xsi:type=\"cc:BasicAmountType\" currencyID=\"EUR\">764.79<\/Balance>" + " <BalanceTimeStamp xsi:type=\"xs:dateTime\">2014-03-25T19:30:21Z<\/BalanceTimeStamp>" + " <BalanceHoldings xsi:type=\"cc:BasicAmountType\" currencyID=\"EUR\">764.79<\/BalanceHoldings>" + " <\/GetBalanceResponse>" + " <\/SOAP-ENV:Body>" + "<\/SOAP-ENV:Envelope>\n", "httpheaderrequest":{ "Host":"api-3t.paypal.com", "Connection":"Keep-Alive", "User-Agent":"PHP-SOAP\/5.3.5", "Content-Type":"text\/xml; charset=utf-8", "SOAPAction":"\"\"", "Content-Length":"770" }, "httpheaderresponse": { "Date":"Tue, 25 Mar 2014 19:30:21 GMT", "Server":"Apache", "Content-Length":"1939", "Connection":"close", "Content-Type":"text\/xml; charset=utf-8" }, "phprequest": [ { "GetBalanceRequest":{ "ReturnAllCurrencies":"1", "DetailLevel":"ReturnAll", "ErrorLanguage":null, "Version":"109", "any":null } } ], "phpresponse": { "Balance": { "currencyID":"EUR", "_":"764.79" }, "BalanceTimeStamp":"2014-03-25T19:30:21Z", "BalanceHoldings": [ { "currencyID":"EUR", "_":"764.79" } ], "Timestamp":"2014-03-25T19:30:21Z", "Ack":"Success", "CorrelationID":"f42394c06da52", "Errors":null, "Version":"109", "Build":"9915774" } } } })

We hope these new output formats will enjoy your usage of our REST Api.

We now hope to quickly give you the availibitly to override each request parameters using POST.