Get all petitions signed by myself

34 views
Skip to first unread message

Geraldo Netto

unread,
May 1, 2015, 12:51:20 PM5/1/15
to change-...@googlegroups.com

Hello Folks,

I'm playing with change.org API (first time)
because i want to add at my site (http://exdev.sourceforge.net) a new section with all my signed petitions

and i would like to ask if you have any suggestions
because when i run it (code below), it returns a json saying   result:failure messages: unauthorized request

I'm using the following code saved as html
and of course api_{key/secret} is omitted :P

<script type="text/javascript" src="./sha256.js"></script>
<script type="text/javascript" src="./changeorgapi.min.js"></script>
<script type="text/javascript">
function getAllPetitions() {
var client  = new ChangeOrgApiClient({
  api_key   : "...",
  api_secret: "..."
});

var user = new ChangeOrgApiUser(client);

user.setCallback(function(response) {
    alert(JSON.stringify(response.getData()));
});

user.getSignedPetitions({
    user_id  : 31368676,
    fields   : 'title,url,signature_count',
    page_size: 5,
    page     : 1,
    sort     : 'signatures_asc'
});
}

getAllPetitions();
</script>

Any suggestion is very welcomed :P


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
São Paulo, Brasil, -3gmt
site: http://exdev.sf.net/
Reply all
Reply to author
Forward
0 new messages