question

newuser-6d42e507-9e9a-4980-b39f-a28d5aa0d46e avatar image

JSON error after multiple attempts "There was an error parsing the feed. Please ensure that the feed is valid JSON or RSS."

I am continually running into this error message regarding my JSON feed for a single-item audio flash briefing.

"There was an error parsing the feed. Please ensure that the feed is valid JSON or RSS."

I'm curious as to what's causing this, as I've seen the question asked elsewhere with seemingly no conclusive answer. My guess is that my formatting is off at some point. External web-based JSON validators have no problem with my code. I have used the format specified in the Feed Reference API document. I have tried varying iterations to no success.

Potential diagnoses:

1: Do I need to generate a GUID/UUID in a different manner?

I have been using https://www.uuidgenerator.net/guid

2: Is my content header incorrect?

I used the example from the Feed Reference and plugged in my custom fields. Here's my JSON feed:

Content-Type: application/json
...
{
	"uid": "urn:uuid:e703888e-0f48-41c3-98cf-5d765aa1f770", 
	"updateDate": "2018-07-09T20:08:51.0Z",
	"titleText": "Founty Test Trial Run",
	"mainText": "",
	"streamUrl": "https://s3.us-east-2.amazonaws.com/fountytest1/temps.mp3",
	"redirectionUrl": "https://tinybop.com/"
}

Thanks for your help.

flash briefing
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-6d42e507-9e9a-4980-b39f-a28d5aa0d46e avatar image
newuser-6d42e507-9e9a-4980-b39f-a28d5aa0d46e answered

I found the error was the way I saved the JSON file from notepad.

Maybe this will help someone else who is new to all this schtuff like me: when saving JSON files from notepad you must select ANSI from the "encoding" dropdown menu. Seems Alexa doesn't like UTF-8.

Thank you @Jenn@amazon and @Darin Pope

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jenn@amazon avatar image Jenn@amazon commented ·

Ah, glad you found the issue. I like to use Visual Studio Code or Atom for editing. (Both are free)

1 Like 1 ·
Jenn@amazon avatar image
Jenn@amazon answered

Can you share your feed URL? It might not be the format of the feed, but rather the endpoint.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Darin Pope avatar image
Darin Pope answered

Looking at your feed, you need to remove lines 1-4. The file should only contain the JSON content:

{
  "uid": "urn:uuid:e703888e-0f48-41c3-98cf-5d765aa1f770",
  "updateDate": "2018-07-09T20:08:51.0Z",
  "titleText": "Founty Test Trial Run",
  "mainText": "",
  "streamUrl": "https://s3.us-east-2.amazonaws.com/fountytest1/temps.mp3",
  "redirectionUrl": "https://www.callafountain.com"
}

You don't need the following in the body:

HTTP / 1.1 200 OK
Content - Type: application / json;
charset = UTF - 8<br>

I looked at the headers and they look ok:

curl --head https://s3.us-east-2.amazonaws.com/fountytest1/fountytest10.json
HTTP/1.1 200 OK
x-amz-id-2: QqCleC8WgUYfC4yjN0sXG/TxUk0kVg/6Lp1wFGgHPAgoGV/Nlsz3zFigI/YlBkT8HMaIDX61VMs=
x-amz-request-id: FE273987AA6BF490
Date: Sat, 04 Aug 2018 20:16:21 GMT
Last-Modified: Tue, 10 Jul 2018 00:06:51 GMT
ETag: "4c19749342579b7d3b3644b0d04a89b4"
Accept-Ranges: bytes
Content-Type: application/json
Content-Length: 358
Server: AmazonS3
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I have tried these and I am still getting the same error. Also, I do not believe these suggestions are in line with the feed reference API. Thank you for your help.

0 Likes 0 ·
Jenn@amazon avatar image
Jenn@amazon answered

@Darin Pope is correct. It looks like there's invalid content in the body.

Use an online validator like jsonformatter.curiousconcept.com to show the incorrect items.


json-validator.png (236.2 KiB)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.