LIST vote
Get data on a list of vote objects. Objects are order by created date descending by default.
On retrieving large set of data, requester should use pagination parameters such as page
and page_size
to manage multiple requests.
Parameters
Parameters | Detail |
---|---|
idea_id optional |
Filter return by idea ID Sample value: "11111111-1111-1111-1111-111111111111" |
member_id optional |
Filter return by ID of vote submitter Sample value: "11111111-1111-1111-1111-111111111111" |
type optional |
Filter return by vote type Accepted Value: "promote", "demote" |
page_size optional |
Specifies number of records returns per page. Default: 20. Minimum: 1. Maximum: 100 Sample value: 50 |
page optional |
Specifies which page of records to return. Default: 1. Minimum: 1. Maximum: {page_count} Sample value: 5 |
order optional |
A SQL style string that specifies the order the records should return in. Sample value: "date_created ASC, idea_id DESC". Accepted attributes: "idea_id", "type", "date_created" |
format optional |
Specifies returned data format Accepted value: "json", "xml" |
Resource Information
Authentication
: See Access Permission for LIST vote
HTTP Methods
: GET
Request URL Format
: https://{api_domain}/api3/vote
Access Permission
Access to data varies base on system setting and requester roles. See Authentication for detail on authentication.
Private WebStorms: Requester must authenticate to get data.
Public WebStorms: No authentication required to get data.
Errors
- Invalid object ID or you don't have access to this object
Example Request
- Method: GET
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
URL:
https://example.brightidea.com/api3/idea?idea_id=01D31322-EDF4-4C88-A928-333C9EA4A352
{ "vote_list": [ { "date_created": "2013-04-18 12:10:12.110", "type": "promote", "member": { "id": "B471BFED-BCC2-49CC-A917-5F09AA73EEB3", "screen_name": "Max Power", "first_name": "Max", "last_name": "Power", "job_title": "Safety Inspector", "address": "742 Evergreen Terrace Springfield IL", "phone": "123456-7890", "mobile_phone": "987654-3210", "skills": "Boxer, Mascot, Astronaut, Baby proofer, Truck driver, Hippie, Plow Driver, Food Critic", "work_history": "Conceptual Artist, Mayor, Country Western Manager, Garbage Commissioner, Mountain Climber", "photo_url": null, "date_created": "2013-04-18 11:27:48.537", "date_modified": null }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "date_created": "2013-04-18 12:10:10.187", "date_modified": "2013-04-18 18:45:33.240", "title": "Test Idea for the activity feed #2", "description": "Test Idea for the activity feed #2", "visible": true, "anonymous": true, "idea_code": "D634", "score": "0", "member": { "id": null, "screen_name": "Anonymous", "job_title": null, "address": null, "phone": null, "mobile_phone": null, "external_user_id": null, "skills": null, "work_history": null, "photo_url": null, "date_created": null, "date_modified": null }, "campaign": { "id": "0A140858-AD8A-4F97-9926-D80AD156A130", "name": "Sample Campaign", "description": "Sample Campaign Description", "date_created": "2013-03-07 17:10:38.107" } } }, { "date_created": "2013-04-18 18:45:33.193", "type": "demote", "member": { "id": "866144B1-E302-42EF-AF80-75DE988885AE", "email": "jdoe@brightidea.com", "screen_name": "John Doe", "first_name": "John", "last_name": "Doe", "job_title": "Sales", "address": "123 fake street", "phone": "123 456-789", "mobile_phone": "987 654-3210", "skills": "Selling Software", "work_history": "Worked at sales.com", "photo_url": null, "date_created": "2013-03-07 19:09:54.563", "date_modified": "2013-04-18 13:14:21.067", "active": true, "photo_file_id": "02F11D0E-BA74-4A7D-B1BE-4F7F651B2507" }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "date_created": "2013-04-18 12:10:10.187", "date_modified": "2013-04-18 18:45:33.240", "title": "Test Idea for the activity feed #2", "description": "Test Idea for the activity feed #2", "visible": true, "anonymous": true, "idea_code": "D634", "score": "0", "member": { "id": null, "screen_name": "Anonymous", "job_title": null, "address": null, "phone": null, "mobile_phone": null, "external_user_id": null, "skills": null, "work_history": null, "photo_url": null, "date_created": null, "date_modified": null }, "campaign": { "id": "0A140858-AD8A-4F97-9926-D80AD156A130", "name": "Sample Campaign", "description": "Sample Campaign Description", "date_created": "2013-03-07 17:10:38.107" } } } ], "stats": { "total": "2", "page_count": 1, "current_page": 1 } }
CREATE vote
Create a vote object.
Requester must have access to the Campaign in order to create an vote in it.
Parameters
Parameters | Detail |
---|---|
idea_id required |
This is the ID of the idea where the vote applies Sample value: "11111111-1111-1111-1111-111111111111" |
type required |
This is the type of vote Accepted Value: "promote", "demote" |
format optional |
Specifies returned data format Accepted value: "json", "xml" |
Resource Information
Authentication
: Required. See Authentication for detail on authentication.
HTTP Methods
: POST
Request URL Format
: https://{api_domain}/api3/vote
Access Permission
Requester must have access to the Campaign in order to create an idea in it. See Authentication for detail on authentication.
Request can only create vote for himself. Only one vote is allowed per member per idea.
Errors
Invalid idea ID
Missing required parameter
Vote type must one of these values: "promote", "demote"
Example Request
- Method: POST
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
- URL:
https://example.brightidea.com/api3/vote
Form data:
- idea_id=01D31322-EDF4-4C88-A928-333C9EA4A352
- type=promote
{ "vote": { "date_created": "2013-04-19 11:55:07.907", "member": { "id": "8FA49B96-3693-4282-8919-014618D7B3B8", "email": "lbondarenko@brightidea.com", "screen_name": "Lillian Smith", "first_name": "Lillian", "last_name": "Smith", "job_title": "", "address": "", "phone": "", "mobile_phone": "", "external_user_id": "", "skills": "", "work_history": "", "photo_url": "", "date_created": "2013-03-07 17:10:13.627", "date_modified": "2013-04-16 15:42:16.430", "active": true }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "date_created": "2013-04-18 12:10:10.187", "date_modified": "2013-04-19 11:55:08.037", "title": "Test Idea for the activity feed #2", "description": "Test Idea for the activity feed #2", "visible": true, "anonymous": true, "idea_code": "D634", "score": "1", "member": { "id": "B471BFED-BCC2-49CC-A917-5F09AA73EEB3", "screen_name": "Max Power", "first_name": "Max", "last_name": "Power", "job_title": "Safety Inspector", "address": "742 Evergreen Terrace Springfield IL", "phone": "123456-7890", "mobile_phone": "987654-3210", "external_user_id": "0072", "skills": "Boxer, Mascot, Astronaut, Baby proofer, Truck driver, Hippie, Plow Driver, Food Critic", "work_history": "Conceptual Artist, Mayor, Country Western Manager, Garbage Commissioner, Mountain Climber", "photo_url": null, "date_created": "2013-04-18 11:27:48.537", "date_modified": null, "active": true }, "campaign": { "id": "0A140858-AD8A-4F97-9926-D80AD156A130", "name": "Sample Campaign", "description": "Sample Campaign Description", "date_created": "2013-03-07 17:10:38.107" } } }, "score": 1 }
DELETE vote
Delete a vote object.
Requester can delete his own submitted vote.
Parameters
Parameters | Detail |
---|---|
idea_id required |
This is the ID of the idea where the vote applies Sample value: "11111111-1111-1111-1111-111111111111" |
format optional |
Specifies returned data format Accepted value: "json", "xml" |
Resource Information
Authentication
: Required. See Authentication for detail on authentication.HTTP Methods
: DELETERequest URL Format
: https://{api_domain}/api3/vote
Access Permission
Requester can delete his own submitted vote.
Errors
- Invalid GUID received
Example Request
- Method: DELETE
- Header: Authorization=Bearer 85f7b2462570acdde9a458ba6495b8763dcd040c
URL:
https://example.brightidea.com/api3/vote
{ "message": "success", "code": 200 }
FAQ
Question: LIST vote only return 100 objects maximum per request. How do I retrieve more results.
Answer: LIST vote response is automatically paginated. You can specify which page of the result a request should return. For example, if you requested for 100 idea objects in the initial request, pass "page_size=100&page=2" to get the next 100. page_count
is returned with every LIST request so your application can figure out when it hits the end.