I am changing over to the new UPS rest API that uses oAuth2.0. I used to get the response in XML not I am not. What can I change to get the response in XML format?
I changed the script to get the TRACKING response to their new posted script. I don't know if the old way using the new Bearer and Token would work. The new response looks different than before, don't know why they did that, this is a lot of work to adjust to the new output.
Current response in XML:
<?xml version="1.0"?>
<TrackResponse><Response><TransactionReference><CustomerContext>...</CustomerContext> </TransactionReference><ResponseStatusCode>1</ResponseStatusCode>
New response style:
{"trackResponse":{"shipment":[{"inquiryNumber":"1Z...","package":[{"trackingNumber":...
new code ....
With CreateObject("MSXML2.ServerXMLHTTP")
.Open "GET", "https://wwwcie.ups.com/api/track/v1/details/1Z.....?locale=en_US&returnSignature=false&returnMilestones=true"
.setRequestHeader "Authorization", "Bearer " + strClientToken
.setRequestHeader "transId", "string"
.setRequestHeader "transactionSrc", "testing"
.send
Debug.Print .responseText
strFile_Path = "C:\test.txt"
Open strFile_Path For Output As #1
Print #1, .responseText
Close #1
End With
Old URL won't work in new script : "https://wwwcie.ups.com/ups.app/xml/Track"
current post script: <?xml version="1.0" ?>
<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber>....</AccessLicenseNumber>
<UserId>....</UserId>
<Password>....</Password>
</AccessRequest>
<?xml version="1.0" ?>
<TrackRequest>
<Request>
<TransactionReference>
<CustomerContext>....</CustomerContext>
</TransactionReference>
<RequestAction>Track</RequestAction>
</Request> <TrackingNumber>1Z....</TrackingNumber> </TrackRequest>
update, found this on their website, does this mean that the response is not in XML anymore? ...The second step in the process will be to review all the new API definitions that are present in our . Any UPS API integrations using XML, SOAP or legacy JSON payloads will be required to convert to the RESTful APIs found in the API Catalogue. This will involve reworking the construction of your API request payloads. API sample requests can be found for all APIs in the API documentation, and sample integrations for each API can be found in the UPS UPS GitHub The new API endpoints will only support a RESTful request, and many of the APIs have a slightly different request structure. The new API endpoints and payloads will need to be integrated into your software, along with the new OAuth security (bearer token) model.
No XML response possible with new API after June.