• Home
  • Resources
  • Objects
  • Guide
    • What is an API
    • Creating an app
    • Using the API
    • Troubleshooting
    • Login
    • IQL query language
    • API Playground
    • Get started
    • Error messages
    • Access scopes
    • Introduction to general concepts
  • Home>
  • Resources>
  • initiatives/ideas/(id)/votes/post

POST initiatives/ideas/(id)/votes/post

Submit a new vote.

Resource information

Request method POST
Response object Vote
Access scope initiative_get
Response format JSON, XML

Parameters

Voting mode can be set to either Thumbs, Like or Stars.
If Thumbs are used set the property "alternative" to either: 1 (thumbs down) or 3 (thumbs up). (see example)
If Like are used set the property "alternative" to 3 (thumbs up).
If Stars are used, set the property "value" to a number between 0 to 6 (or max stars allowed from configuration)

Example

https://api.induct.no/v1/12345/initiatives/ideas/342/votes/

Post data

/* Voting mode "Thumbs" or "Like" */
{
    alternative: 3
}

/* Voting mode "Stars" */
{
    value: 4
}
JSON result:
/* Voting mode "Thumbs" or "Like" */
{
    "id": 24,
    "uri": "https://api.induct.no/v1/12345/initiatives/ideas/342/votes/24",
    "createdAt": "2013-01-15T13:51:02Z",
    "user": {
        "id": 1,
        "uri": "http://api.induct.no/v1/12345/users/1",
        "firstName": "Jane",
        "lastName": "Doe",
        "firstNameLastName": "Jane Doe"
    },
    "value": 0,
    "alternative": 3
}

/* Voting mode "Stars" */
{
    "id": 24,
    "uri": "https://api.induct.no/v1/12345/initiatives/ideas/342/votes/24",
    "createdAt": "2013-01-15T13:51:02Z",
    "user": {
        "id": 1,
        "uri": "http://api.induct.no/v1/12345/users/1",
        "firstName": "Jane",
        "lastName": "Doe",
        "firstNameLastName": "Jane Doe"
    },
    "value": 4,
    "alternative": 0
}

Induct API 1.0

Last API system update:
11/23/2020 8:43:56 AM

↑ Back to top

© Induct Software AS