Jump to content

Help with cURL


This topic is 2505 days old. Please don't post here. Open a new topic instead.

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":"[email protected]"
       },
       "address_to":{
          "name":"Mrs. Hippo",
          "street1":"965 Mission St.",
          "city":"San Francisco",
          "state":"CA",
          "zip":"94105",
          "country":"US",
          "phone":"+1 555 341 9393",
          "email":"[email protected]"
       },
       "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

 

 

 

 

 

 

Link to comment
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
Link to comment
Share on other sites

"-H Authorization: ShippoToken " & $token & " -H Content-Type: application/json -d " & $json

I believe above should make a valid string.

Edited by ggt667
  • Like 1
Link to comment
Share on other sites

This topic is 2505 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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