LIST vote {#list}
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: {pagecount}
Sample value: 5
order
optional |A SQL style string that specifies the order the records should return in.
Sample value: "datecreated ASC, ideaid DESC".
Accepted attributes: "ideaid", "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 {#listPermission}
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
~~~ { "votelist": [ { "datecreated": "2013-04-18 12:10:12.110", "type": "promote", "member": { "id": "B471BFED-BCC2-49CC-A917-5F09AA73EEB3", "screenname": "Max Power", "firstname": "Max", "lastname": "Power", "jobtitle": "Safety Inspector", "address": "742 Evergreen Terrace Springfield IL", "phone": "123456-7890", "mobilephone": "987654-3210", "skills": "Boxer, Mascot, Astronaut, Baby proofer, Truck driver, Hippie, Plow Driver, Food Critic", "workhistory": "Conceptual Artist, Mayor, Country Western Manager, Garbage Commissioner, Mountain Climber", "photourl": null, "datecreated": "2013-04-18 11:27:48.537", "datemodified": null }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "datecreated": "2013-04-18 12:10:10.187", "datemodified": "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, "ideacode": "D634", "score": "0", "member": { "id": null, "screenname": "Anonymous", "jobtitle": null, "address": null, "phone": null, "mobilephone": null, "externaluserid": null, "skills": null, "workhistory": null, "photourl": null, "datecreated": null, "datemodified": null }, "campaign": { "id": "0A140858-AD8A-4F97-9926-D80AD156A130", "name": "Sample Campaign", "description": "Sample Campaign Description", "datecreated": "2013-03-07 17:10:38.107" } } }, { "datecreated": "2013-04-18 18:45:33.193", "type": "demote", "member": { "id": "866144B1-E302-42EF-AF80-75DE988885AE", "email": "jdoe@brightidea.com", "screenname": "John Doe", "firstname": "John", "lastname": "Doe", "jobtitle": "Sales", "address": "123 fake street", "phone": "123 456-789", "mobilephone": "987 654-3210", "skills": "Selling Software", "workhistory": "Worked at sales.com", "photourl": null, "datecreated": "2013-03-07 19:09:54.563", "datemodified": "2013-04-18 13:14:21.067", "active": true, "photofileid": "02F11D0E-BA74-4A7D-B1BE-4F7F651B2507" }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "datecreated": "2013-04-18 12:10:10.187", "datemodified": "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, "ideacode": "D634", "score": "0", "member": { "id": null, "screenname": "Anonymous", "jobtitle": null, "address": null, "phone": null, "mobilephone": null, "externaluserid": null, "skills": null, "workhistory": null, "photourl": null, "datecreated": null, "datemodified": null }, "campaign": { "id": "0A140858-AD8A-4F97-9926-D80AD156A130", "name": "Sample Campaign", "description": "Sample Campaign Description", "datecreated": "2013-03-07 17:10:38.107" } } } ], "stats": { "total": "2", "pagecount": 1, "current_page": 1 } } ~~~
CREATE vote {#create}
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": { "datecreated": "2013-04-19 11:55:07.907", "member": { "id": "8FA49B96-3693-4282-8919-014618D7B3B8", "email": "lbondarenko@brightidea.com", "screenname": "Lillian Smith", "firstname": "Lillian", "lastname": "Smith", "jobtitle": "", "address": "", "phone": "", "mobilephone": "", "externaluserid": "", "skills": "", "workhistory": "", "photourl": "", "datecreated": "2013-03-07 17:10:13.627", "datemodified": "2013-04-16 15:42:16.430", "active": true }, "idea": { "id": "01D31322-EDF4-4C88-A928-333C9EA4A352", "datecreated": "2013-04-18 12:10:10.187", "datemodified": "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, "ideacode": "D634", "score": "1", "member": { "id": "B471BFED-BCC2-49CC-A917-5F09AA73EEB3", "screenname": "Max Power", "firstname": "Max", "lastname": "Power", "jobtitle": "Safety Inspector", "address": "742 Evergreen Terrace Springfield IL", "phone": "123456-7890", "mobilephone": "987654-3210", "externaluserid": "0072", "skills": "Boxer, Mascot, Astronaut, Baby proofer, Truck driver, Hippie, Plow Driver, Food Critic", "workhistory": "Conceptual Artist, Mayor, Country Western Manager, Garbage Commissioner, Mountain Climber", "photourl": null, "datecreated": "2013-04-18 11:27:48.537", "datemodified": 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}
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 {#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.