Automate

 View Only
  • 1.  USPS API in Evolve

    Posted 10-15-2021 11:19
    Is anyone using the USPS API within Evolve?  Would like to connect with a company that has done this integration.

    ------------------------------
    James Starbuck | Director, Master Data Dovernance
    HP Hood LLC | 9782392631
    ------------------------------


  • 2.  RE: USPS API in Evolve

    Employee
    Posted 10-19-2021 09:29
    Hi James

    I just tried yesterday.  Please note I'm brand new to this set of services, and I have not read through their documentation - just a quick search for examples after registering for an account.

    The service runs well.  Log output:
    2021-10-18 08:11:00.8091|DEBUG|61|SEA-EN-VSTFINX1|Winshuttle.Finx.SharedInfra.SolutionConnectionRestAPIAdapter.ExecuteOperation|request url:http://production.shippingapis.com/ShippingAPI.dll?API=Verify&XML=%3CAddressValidateRequest%20USERID=%2youruserid%22%3E%3CAddress%20ID=%220%22%3E%3CAddress1%3E100%20Beale%20Street%3C/Address1%3E%3CAddress2%3E%3C/Address2%3E%3CCity%3ESan%20Francisco%3C/City%3E%3CState%3ECA%3C/State%3E%3CZip5%3E94105%3C/Zip5%3E%3CZip4%3E%3C/Zip4%3E%3C/Address%3E%3C/AddressValidateRequest%3E|
    ...
    VSTFINX1|Winshuttle.Finx.SharedInfra.SolutionConnectionRestAPIAdapter.ExecuteOperation|response status:OK|
    2021-10-18 08:11:01.0121|DEBUG|30|SEA-EN-VSTFINX1|Winshuttle.Finx.SharedInfra.SolutionConnectionRestAPIAdapter.ExecuteOperation|response code:200|
    ...


    Output, with the corrected address and zip from the log:
    2021-10-18 08:11:01.0121|DEBUG|30|SEA-EN-VSTFINX1|Winshuttle.Finx.SharedInfra.SolutionConnectionRestAPIAdapter.ExecuteOperation|response Html:<?xml version="1.0" encoding="UTF-8"?>
    <AddressValidateResponse><Address ID="0"><Address2>100 BEALE ST</Address2><City>SAN FRANCISCO</City><State>CA</State><Zip5>94105</Zip5><Zip4>1802</Zip4></Address></AddressValidateResponse>|


    But they appear to only support XML output, unless I am missing something.  Right now we support JSON payloads for REST API calls from Composer.

    I tried to "fudge" a JSON output payload, once with each field and groupings and once with just AddressValidateResponse as a string, and also tried to add a format json parameter to no avail.  :)  I get an error on the output (this was a test trying to get the individual fields).
    2021-10-18 08:11:01.0121|ERROR|30|SEA-EN-VSTFINX1|Winshuttle.Finx.WF.Services.DataPostingService.PostToSAP|Exception occurred while posting to SAP|Newtonsoft.Json.JsonException: Unexpected character while parsing path:
    at Newtonsoft.Json.Linq.JsonPath.JPath.ParseMain()
    ...

    I have a question in to our engineering team about it.  I'll post again when I get a response. 

    If anyone else has done this and has more information, please share.

    Best Regards,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------