the number that appears at the end of the JSON result when adding a signature

72 views
Skip to first unread message

Kevin Sandness

unread,
Aug 12, 2013, 7:18:04 PM8/12/13
to change-...@googlegroups.com
When I add a signature with POST petitions/:petition_id/signatures, the response looks something like this: {"result":"success"}1. What is that "1" at the end? I seem to need to strip that out before I'm able to work with the result.

Alain Bloch

unread,
Aug 16, 2013, 1:21:29 PM8/16/13
to change-...@googlegroups.com
Hmmm interesting. That looks like some kind of JSON parsing error. I'll see if its coming from our end.

- Alain

John Moss

unread,
Sep 1, 2013, 3:20:02 PM9/1/13
to change-...@googlegroups.com
I've just noticed this on the "/v1/petitions/$PETITION_ID/auth_keys" end point  as well after spending about an hour figuring out where I was going wrong... :(
Message has been deleted

Alain Bloch

unread,
Oct 23, 2013, 3:23:10 PM10/23/13
to change-...@googlegroups.com
This might have been parsing error on your end. Perhaps a boolean value was been appended to the JSON object after the request was made? This seems to be an issue for people trying to consume JSON responses. I'd check stackoverflow.com for some examples.

John Moss

unread,
Dec 22, 2013, 8:13:42 AM12/22/13
to change-...@googlegroups.com
I don't think so I stripped my code back right down to the Github example and I still get the '1' at the end.

John Moss

unread,
Dec 22, 2013, 8:32:07 AM12/22/13
to change-...@googlegroups.com
Found it the code on Github is floored.

https://github.com/change/api_docs/blob/master/v1/examples/get_auth_key.php

Specifically lines 33 and 34. Which basically prints the details with curl_exec but then you print the boolean after it. I'm new to Github but I'll fix it in my code then sort out a pull request for you.


Alain Bloch

unread,
Jan 9, 2014, 4:12:30 PM1/9/14
to change-...@googlegroups.com
Thanks.
Reply all
Reply to author
Forward
0 new messages