Add a signature to a petition always getting {"result":"failure","messages":["Invalid request signature."]}

106 views
Skip to first unread message

Azraar Azward

unread,
Jul 23, 2015, 4:50:47 AM7/23/15
to Change.org API
I am trying to make a sign in using the API. 

My API Key is - 32cf9810f982f95613cec5cce3154dc83966f2a89111661e6355938ad70bXXXX

My Secret Token - 6acc5384782f8449e2775c3abf7688ec89cfa1ac76c710f2a745ad5c323e5XXXX

My Auth Key for Petition (Petition id 3623702) - 0f34758d6fe16a866ccadfef6ebcc9d531b913a23c9c155a0ee8606c1d830XXXX

Please note last four digits are masked on above keys.

The URL i am making the request is: https://api.change.org/v1/petitions/3623702/signatures

The POST Body is: api_key=32cf9810f982f95613cec5cce3154dc83966f2a89111661e6355938ad70b20f6&address=123+Sesame+St&city=New+York&country_code=US&first_name=Amarn&last_name=Dev&postal_code=12345&state_province=NY&source=test_source&email=aruna%40gmail.com&timestamp=2015-07-23T08%3A36%3A00Z&endpoint=%2Fv1%2Fpetitions%2F3623702%2Fsignatures&rsig=9ebf3171483174e6de937a058e641141d3086f1a64654d80e61f0ed1de3ded0c

I have attached the source code to this post. signin.php

I have no clue why it always returns {"result":"failure","messages":["Invalid request signature."]}

I tried this in localhost as well is in server.

appreciate any prompt response to fix this problem.

Azraar Azward

unread,
Jul 23, 2015, 4:54:58 AM7/23/15
to Change.org API, mazr...@gmail.com
Attached the PHP Code. 


signin.php

Rob Weatherall

unread,
Dec 8, 2015, 2:24:45 PM12/8/15
to Change.org API
Did you get this corrected?
I am having same failure.

Rob Weatherall

unread,
Dec 9, 2015, 5:01:01 PM12/9/15
to Change.org API
for me, in the example code I used there was an error in stripping "auth key" so I ended up hard coding my petition auth key in request.
In doing so I had an extra space at the end of my auth key
I would check there.

I have since corrected both issues.

Rob Weatherall

unread,
Dec 9, 2015, 5:05:53 PM12/9/15
to Change.org API
OK, try this (obviously change the XXXX to your actual key)

$params['auth_key'] = "0f34758d6fe16a866ccadfef6ebcc9d531b913a23c9c155a0ee8606c1d83XXXX";

try double " quote from single ' quote
Reply all
Reply to author
Forward
0 new messages