Jump to content

Recommended Posts

Trying to get FMP 16 solution to integrate with Shippo to get shipping rates but keep getting an authentication error. I suspect my syntax is wrong in the cURL component of the Insert from URL step. I've checked the URL ($url)  and token ($token) and they are correct values. Any help is greatly appreciated.

Shippo API:

curl https://api.goshippo.com/shipments/  \
    -H "Authorization: ShippoToken shippo_test_4f4d4302e76f97f922d6fb957a9c156712bec772" \
    -H "Content-Type: application/json"  \
    -d '{
       "address_from":{
          "name":"Mr. Hippo",
          "street1":"215 Clayton St.",
          "city":"San Francisco",
          "state":"CA",
          "zip":"94117",
          "country":"US",
          "phone":"+1 555 341 9393",
          "email":"support@goshippo.com"
       },
       "address_to":{
          "name":"Mrs. Hippo",
          "street1":"965 Mission St.",
          "city":"San Francisco",
          "state":"CA",
          "zip":"94105",
          "country":"US",
          "phone":"+1 555 341 9393",
          "email":"support@goshippo.com"
       },
       "parcels":[{
          "length":"5",
          "width":"5",
          "height":"5",
          "distance_unit":"in",
          "weight":"2",
          "mass_unit":"lb"
       }],
       "async": false
    }'

 

My cURL code in the Insert from URL step:

"-H  & Authorization: ShippoToken"  & $token & 

"-H" &  "Content-Type: application/json" & 

"-d" & $json

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

If you take that piece of your code and put in the data viewer it will tell you what is wrong.  Look at the output and compare it to what is required.

Some quick ones:

- you don't need the ampersand after the first -H

- you don't add spaces between the different sections

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
"-H Authorization: ShippoToken " & $token & " -H Content-Type: application/json -d " & $json

I believe above should make a valid string.

Edited by ggt667
  • Like 1

Share this post


Link to post
Share on other sites

Thank you both

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×

Important Information

By using this site, you agree to our Terms of Use.