jimamster
Posts: 0
Joined: Wed May 16, 2012 2:49 am

Cannot populate from sample response: get error: must be valid JSON response.

I am receiving a response to a token request as shown below.
access_token=token_value
I am not able to use the “populate from sample response” due to the “=” sign.
When I try to "populate from sample response" on the service test screen, I get the "Must be valid JSON response" error.
I cannot parse out the token and store it. Any ideas?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Cannot populate from sample response: get error: must be valid JSON response.

Can you share the service or the JSON you are trying to use?

jimamster
Posts: 0
Joined: Wed May 16, 2012 2:49 am

Cannot populate from sample response: get error: must be valid JSON response.

Got this to work. Thanks for the help. I added a complete event with a custom javascript action shown below.
var access_token = jqXHR.responseText.split("=")[1];
localStorage.setItem('access_token', access_token);
This is a slight variation the script described at the following link.
http://help.gotiggr.com/documentation...

Return to “Issues”