Get petition ID of developer docs always returns {"result":"failure","messages":["unauthorized request"]}

47 views
Skip to first unread message

Dr. Dietrich Davidstein

unread,
Mar 7, 2017, 8:33:21 PM3/7/17
to Change.org API

Hello,

i've tried the last example of this site: https://www.change.org/developers/docs/resources/petitions

But everytime i try this out:

https://api.change.org/v1/petitions/get_id?petition_url=http%3A%2F%2Fwww.change.org%2Fpetitions%2Fask-starfleet-to-add-a-purple-uniform&api_key=MY_API_KEY

i get the error

{"result":"failure","messages":["unauthorized request"]}


I've also tried the example from here: https://www.change.org/developers/tutorials/a-basic-request

But the result is the same... I've put in the correct api_key but still get this error:

{"result":"failure","messages":["unauthorized request"]}


Is the API still working? Could you please tell me what i'm doing wrong and/or post a working example code?

I would like to get the petition ID and signature count of a campaign and then include the signature nr. on the offical website for the campaign (not the change.org one of course).



Matthew Kelley

unread,
May 21, 2017, 3:51:33 AM5/21/17
to Change.org API
The API is in fact still working.

Step 1: Make sure you have made an account at Change,org. 

Step 2: Go here and create a new API key. https://www.change.org/developers/api-key

Step 3: Replace 'API_KEY' in the link below with your key and put in your browsers address bar. 


Step 4: You should get a JSON response back as follows:

{"result":"success","petition_id":8719970}


Reply all
Reply to author
Forward
0 new messages