Developers / API Documentation / Resources / Petitions

Updates on Petitions

GET petitions/:petition_id/updates

Returns the news updates on a petition.

Request Parameters

Parameter Name Type Description
petition_id int (In URL) The petition from which updates should be retrieved.
page_size int (Optional)The maximum number of updates to return per request, but no more than 100. If omitted, returns a maximum of 10 updates.
page int (Optional) The page offset by page_size updates. If omitted, returns the first page by default.
sort string (Optional) The order by which updates will be returned. Accepted values are time_asc and time_desc. If omitted, returns most recent updates in order.

Response Data

Field Name Type Description
update_count int The number of total news updates on this petition.
prev_page_endpoint string The API endpoint that can be called to retrieve the previous page of updates. null if there is no previous page.
next_page_endpoint string The API endpoint that can be called to retrieve the next page of updates. null if there is no next page.
page int The current page number.
total_pages int The total number of pages of updates (of size specified by page_size)
reasons array The array of news updates.

The updates array contains objects with the following data:

Field Name Type Description
created_on string of ISO-8601 datetime The date and time when this update was posted to the petition.
content string The content of the update to the petition.
author_name string The name of the author of the update.
author_url string The URL to the Change.org profile page of the update author.

Example:

GET https://api.change.org/v1/petitions/48503/updates?page_size=2&page=3
=> {
"update_count": 8,
"prev_page_endpoint": "https://api.change.org/v1/petitions/48503/updates?page=2&page_size=2&sort=time_desc",
"next_page_endpoint": "https://api.change.org/v1/petitions/48503/updates?page=4&page_size=2&sort=time_desc",
"page": 3,
"total_pages": 4,
"updates":[{
"created_on": "2012-03-14T03:32:39Z",
"content": "We hit 2,000 signatures!",
"author_name": "Jean-Luc Picard",
"author_url": "http://www.change.org/members/233311"
},
{
"created_on": "2012-03-23T15:22:21Z",
"content": "Check out this great media coverage in the Times",
"link": "http://www.thestarfleettimes.co.uk/petition-targets-starfleet",
"author_name": "Jean-Luc Picard",
"author_url": "http://www.change.org/members/233311"
}]
}

Note: A public API key is a required parameter on all requests, and a timestamp, endpoint, and request signature are required on certain requests. For readability, these parameters have been omitted from the tables and examples above.