Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
belltown
Roku Guru

Re: ParseJson Error

1.
When posting code, please use [code][/code] tags.


2. The code you posted runs on my Roku. However, the response returned is over 6MB! The documentation used to state that there was a limit of 64K for AsyncGetToString () responses, although it doesn't say that any more. However, try using AsyncGetToFile() instead, then read the file into a string using ReadAsciiFile().
0 Kudos
subhalaxmi
Visitor

Re: ParseJson Error

Thank you for your help.Heartly thankful.But it doesn't help me.

Can you please paste the code how can I get data from web service.May be that will helpful to me.

I am using Roku Player 4200X and 7.0.My same code was working before 7.0 update .After update it is not working.That's why I am in trouble.
0 Kudos
RokuMarkn
Visitor

Re: ParseJson Error

You already posted code yourself that gets and parses a JSON string from a web service, using the khanacademy URL. Are you saying that that code doesn't work for you? It works fine for me, exactly as you posted it. If something is failing for you, you will need to post an example of the code that is actually failing, rather than similar code that is not failing.

--Mark
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: ParseJson Error

"subhalaxmi" wrote:
This is my json response.

...
Guys help me


As Belltown said, the "Unknown identifier" error would occur if the JSON data itself is invalid, or not recognized, during tokenization.
Failing to quote a key name or a string value would be an example of that.

The error message should include the exact token that it failed on, again as Belltown demonstrated.

What does the error message print (including in the quotes) for the JSON that you said didn't parse?
0 Kudos
subhalaxmi
Visitor

Re: ParseJson Error

Thanks guys.Its a great feeling to be in this forum. Finally solved this.Actually there's issue in json string.Some characters is getting assigned before jso string.I had removed it and then it worked.
0 Kudos
SECHIN_SUNNY
Visitor

Re: ParseJson Error

Hi subha 
 i am facing the same issue while parsing the json it comes like unknown identifier , what was the string character within the response that caused this issue .

Thanks 
Regards
Sechin
Thanks
Regards
Sechin Sunny
0 Kudos
SECHIN_SUNNY
Visitor

Re: ParseJson Error

"subhalaxmi" wrote:
Thanks guys.Its a great feeling to be in this forum. Finally  solved this.Actually there's issue in json string.Some characters is getting assigned before jso string.I had removed it and then it worked.

Hi subha 
 i am facing the same issue while parsing the json it comes like unknown identifier , what was the string character within the response that caused this issue .

Thanks 
Regards
Sechin
Thanks
Regards
Sechin Sunny
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.