Polls

/polls

Create a poll

POST https://api.coodo.xyz/polls

Headers

Name
Type
Description

Authorization*

String

Bearer token

Request Body

Name
Type
Description

buttons*

Array

Buttons array

anonymous*

Boolean

Hide users ids on results

multiples*

Boolean

Multiples choices

choices_max*

Integer

How many options users can select

hide_results*

Boolean

Hide results while the poll is in progress

title*

String

Poll title

timestamp_close

Integer

Set an end date

description

String

Poll description

channelID

String

Discord channel ID

image

String

Poll image

guild*

Object

Guild id and name

{
    "message": "Created",
    "data": {
	"pollID": <string>,
	"channelID": <string>,
	"guild": {
	    "id": <string>,
	    "name": <string>
	},
	"buttons": <array>,
	"multiples": <boolean>,
	"choices_max": <int>,
	"anonymous": <boolean>,
	"ended": <boolean>,
	"title": <string>,
	"ownerID": <string>,
	"timestamp": <string>,
	"timestamp_close": <int>,
	"hide_results": <boolean>,
	"description": <string>,
	"image": <string>
    }
}

/polls/:id

Find a poll by ID

GET https://api.coodo.xyz/polls/:id

Path Parameters

Name
Type
Description

id*

String

ID of the poll to find

Headers

Name
Type
Description

Authorization

String

Bearer token

{
    "message": "OK",
    "data": {
	"pollID": <string>,
	"guild": {
	    "id": <string>,
	    "name": <string>
	},
	"channelID": <string>,
	"buttons": [], // Array is empty (-> polls/:id/results)
	"multiples": <boolean>,
	"choices_max": <int>,
	"anonymous": <boolean>,
	"ended": <boolean>,
	"title": <string>,
	"ownerID": <string>,
	"timestamp": <string>,
	"timestamp_close": <int>,
	"hide_results": <boolean>,
	"description": <string>,
	"image": <string>
    }
}

Find poll results by ID

GET https://api.coodo.xyz/polls/:id/results

Path Parameters

Name
Type
Description

id*

String

ID of the poll to find

Headers

Name
Type
Description

Authorization*

String

Bearer token

{
    "message": "OK",
    "data": {
	"pollID": <string>,
	"channelID": <string>,
	"guild": {
	    "id": <string>,
	    "name": <string>
	},
	"buttons": [
	    {
                "title": <string>,
                "name": <string>,
                "ids": [
                    {
                        "id": <string>,
                        "username": <string>,
                        "server_name": <string>
                    },
                    ...
                ]
            },
            ...
	]
	"multiples": <boolean>,
	"choices_max": <int>,
	"anonymous": <boolean>,
	"ended": <boolean>,
	"title": <string>,
	"ownerID": <string>,
	"timestamp": <string>,
	"timestamp_close": <int>,
	"hide_results": <boolean>,
	"description": <string>,
	"image": <string>
    }
}

Update a poll by ID

PUT https://api.coodo.xyz/polls/:id

Path Parameters

Name
Type
Description

id*

String

ID of the poll to update

Headers

Name
Type
Description

Authorization*

String

Bearer token

Request Body

Name
Type
Description

ended

Boolean

Poll state

title

String

Poll title

timestamp_close

Integer

Set an end date

description

String

Poll description

image

String

Poll image

{
    "message": "OK",
    "data": {
	"pollID": <string>,
	"channelID": <string>,
	"guild": {
	    "id": <string>,
	    "name": <string>
	},
	"buttons": [], // Array is empty (-> polls/:id/results)
	"multiples": <boolean>,
	"choices_max": <int>,
	"anonymous": <boolean>,
	"ended": <boolean>,
	"title": <string>,
	"ownerID": <string>,
	"timestamp": <string>,
	"timestamp_close": <int>,
	"hide_results": <boolean>,
	"description": <string>,
	"image": <string>
    }
}

Delete a poll by ID

DELETE https://api.coodo.xyz/polls/:id

Path Parameters

Name
Type
Description

id*

String

ID of the poll to delete

Headers

Name
Type
Description

Authorization*

String

Bearer token

{
    "message": "OK",
    "data": {
	"pollID": <string>,
	"channelID": <string>,
	"guild": {
	    "id": <string>,
	    "name": <string>
	},
	"buttons": <array>,
	"multiples": <boolean>,
	"choices_max": <int>,
	"anonymous": <boolean>,
	"ended": <boolean>,
	"title": <string>,
	"ownerID": <string>,
	"timestamp": <string>,
	"timestamp_close": <int>,
	"hide_results": <boolean>,
	"description": <string>,
	"image": <string>
    }
}

/polls/:id/vote/:choiceId

Vote for a poll using ID

PUT https://api.coodo.xyz/polls/:id/vote/:choiceId

Path Parameters

Name
Type
Description

id*

String

ID of the user to delete

choiceId*

String

ID of the choice to vote

Headers

Name
Type
Description

Authorization*

String

Bearer token

{
    "error": "Not Found"
}

Last updated

Was this helpful?