Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JSON Error: Unterminated String

Featured Replies

Trying to integrate FMP solution with Shippo using the Shippo API. When using Insert from URL step, response comes back with this error.

{"detail": "JSON parse error - Unterminated string starting at: line 1 column 25 (char 24)"}

 

Here's what Shippo specifies in their API, and below that, what FMP is sending (per Data Viewer). Any help resolving this issue is greatly appreciated.

 

From Shippo API:

'{
       "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
    }'

 

Here's what FMP 16 Data Viewer shows:

{
	"address_from" : 
	{
		"city" : "Los Angeles",
		"country" : "US",
		"name" : "KL Test",
		"state" : "CA",
		"street1" : "Thompson Ave",
		"zip" : "91201"
	},
	"address_to" : 
	{
		"city" : "Los Angeles",
		"country" : "US",
		"name" : "David Test",
		"state" : "CA",
		"street1" : "1017 South Point View St",
		"zip" : "90035"
	},
	"parcels" : 
	{
		"parcels" : 
		[
			{
				"distance_unit" : "in",
				"height" : "5",
				"length" : "5",
				"mass_unit" : "lb",
				"weight" : "2",
				"width" : "5"
			}
		]
	}
}

 

 

 

 

 

You have a 'parcels' key/node that is not correct.  It should immediately start with an array as per their API, you start it as another piece of JSON with another 'parcels' key name

  • Author
On 5/21/2017 at 9:00 AM, Wim Decorte said:

You have a 'parcels' key/node that is not correct.  It should immediately start with an array as per their API, you start it as another piece of JSON with another 'parcels' key name

Thanks for the tip, Wim! I've attempted to build an array in the code after looking at an example online. The dataviewer seems to show the json output matching the API spec, but I'm still getting "{"detail": "JSON parse error - Unterminated string starting at: line 1 column 25 (char 24)"}"

Here's what the dataviewer now shows:

{
	"address_from" : 
	{
		"city" : "Los Angeles",
		"country" : "US",
		"name" : "KL Test",
		"state" : "CA",
		"street1" : "Thompson Ave",
		"zip" : "91201"
	},
	"address_to" : 
	{
		"city" : "Riverside",
		"country" : "US",
		"name" : "David Test",
		"state" : "CA",
		"street1" : "555 Some Street",
		"zip" : "90015"
	},
	"parcels" : 
	[
		{
			"distance_unit" : "in",
			"height" : "5",
			"length" : "5",
			"mass_unit" : "lb",
			"weight" : "2",
			"width" : "5"
		}
	]
}

 

don't know their api but you are missing the 

async

key.  Perhaps they require it?

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.