Developers / API Documentation / Resources

Users

GET users/:user_id

Returns information about the specified user.

Request Parameters

Parameter Name Type Description
user_id int (In URL) The ID of the user about which information will be retrieved.

Response Data

Field Name Type Description
user_id int The ID of the user about which information was retrieved.
name string The full name of the user.
location string The full location of the user in English. (e.g. San Francisco, CA or Paris, France)
city string Residential city of the user.
state_province string (If available) The standard abbreviation of the state or province of the user.
country_name string Full English name of the country of the user.
country_code string The two-letter code of the country of the user.

Example:

GET https://api.change.org/v1/users/298374
=>  {
"user_id": 298374,
"name": "Pavel Chekov",
"location": "Saint Petersburg, Russia",
"city": "Saint Petersburg",
"country_name", "Russia",
"country_code", "RU"
}

GET users/:user_id/petitions

Returns the array of petitions that were created by the specified user. For more information about the petition information returned, see Petitions.

Request Parameters

Parameter Name Type Description
user_id int (In URL) The ID of the user whose petitions should be returned.
fields string of comma-separated field names (Optional) The fields of the petition data objects that will be returned for each petition in the response. The parameter should include the field names (described in GET petitions/:petition_id), separated by commas. Omitting this parameter will return all available fields.

Example: "title,url,signature_count"
page_size int (Optional) The maximum number of petition data objects to return per request, no more than 500. If omitted, returns the maximum number of petitions.
page int (Optional) The page offset by page_size petitions. If omitted, returns the first page by default.
sort string (Optional) The order by which petitions will be returned. Accepted values are the number of signatures, signatures_asc or signatures_desc, or the date and time the petition was created, time_asc or time_desc. If omitted, returns petitions in the ascending order in which they were created.

Response Data

Field Name Type Description
user_id int The ID of the user whose petitions have been returned.
page int The current page number. Defaults to 1.
prev_page_endpoint string The API endpoint that can be called to retrieve the previous page of petitions. null if there is no previous page.
next_page_endpoint string The API endpoint that can be called to retrieve the next page of petitions. null if there is no next page.
page int The current page number.
total_pages int The total number of pages of petitions (of size specified by page_size)
petitions array of petitions created by the specified user See Petitions for more information about petition data objects.

GET users/:user_id/signatures/petitions

Returns the array of petitions that were signed by the specified user. Signatures that are hidden by the user will not be returned. For more information about the petition information returned, see Petitions.

Request Parameters

Parameter Name Type Description
user_id int (In URL) The ID of the user whose signed petitions should be returned.
fields string of comma-separated field names (Optional) The fields of the petition data objects that will be returned for each petition in the response. The parameter should include the field names (described in GET petitions/:petition_id), separated by commas. Omitting this parameter will return all available fields.

Example: "title,url,signature_count"
page_size int (Optional) The maximum number of petition data objects to return per request, no more than 500. If omitted, returns the maximum number of petitions.
page int (Optional) The page offset by page_size petitions. If omitted, returns the first page by default.
sort string (Optional) The order by which petitions will be returned. Accepted values are the number of signatures, signatures_asc or signatures_desc, or the date and time the petition was created, time_asc or time_desc. If omitted, returns petitions in the ascending order in which they were created.

Response Data

Field Name Type Description
user_id int The ID of the user whose signed petitions have been returned.
page int The current page number. Defaults to 1.
prev_page_endpoint string The API endpoint that can be called to retrieve the previous page of petitions. null if there is no previous page.
next_page_endpoint string The API endpoint that can be called to retrieve the next page of petitions. null if there is no next page.
page int The current page number.
total_pages int The total number of pages of petitions (of size specified by page_size)
petitions array of petitions created by the specified user See Petitions for more information about petition data objects.

GET users/get_id

Returns the unique Change.org ID for the user specified by user_url, which is the URL to the user's Change.org profile. Before performing requests on a user resource, this ID is required because user profile URLs can change.

Request Parameters

Parameter Name Type Description
user_url string The URL to the user's Change.org profile.

Response Data

The ID of the requested user.

Field Name Type Description
user_id int The unique Change.org ID of the user.

Example:

GET https://api.change.org/v1/users/get_id?user_url=http%3A%2F%2Fwww.change.org%2Fmembers%2Fpavelchekov
=> { "user_id": 298374 }

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.