Voting System

Cast Vote

Cast a vote on a poll.

Method: POST

https://ardr.nownodes.io/nxt?requestType=castVote

Example body (x-www-form-urlencoded)

requestType = castVote
chain = 2
poll = 5916389507928675673
vote02 = 1
secretPhrase = xxx
feeNQT = 100000000
deadline = 60

Example response: 200

{
    "errorDescription": "Unknown poll",
    "errorCode": 5
}

Create Poll

Create a new poll.

Method: POST

https://ardr.nownodes.io/nxt?requestType=createPoll

Example body (x-www-form-urlencoded)

requestType = createPoll
chain = 2
name = Gender Poll
description = What is your gender?
minNumberOfOptions = 1
maxNumberOfOptions = 1
minRangeValue = 0
maxRangeValue = 1
minBalance = 100000000000
minBalanceModel = 1
option00 = Male
option01 = Female
secretPhrase = xxx
feeNQT = 1000000000
deadline = 60
finishHeight = 3365651
votingModel = 2

Example response: 200

{
    "errorDescription": "Unknown account",
    "errorCode": 5
}

Get Poll

Get the details of a poll.

Method: GET

https://ardr.nownodes.io/nxt?requestType=getPoll&chain=2&poll=9096010195498999548

Example response: 200

{
    "errorDescription": "Unknown poll",
    "errorCode": 5
}

Get Poll Result

Get the result of a poll.

Method: GET

https://ardr.nownodes.io/nxt?requestType=getPollResult&chain=2&poll=16742897359122764363

Example response: 200

{
    "errorDescription": "Unknown poll",
    "errorCode": 5
}

Get Poll Vote

Get a poll vote given a poll ID and an account ID.

Method: GET

https://ardr.nownodes.io/nxt?requestType=getPollVote&chain=2&account=9096010195498999548

Example response: 200

{
    "errorDescription": "\"poll\" not specified",
    "errorCode": 3
}

Get Poll Votes

Get all votes on a poll in reverse chronological order.

Method: GET

https://ardr.nownodes.io/nxt?requestType=getPollVotes&chain=2&poll=9096010195498999548&lastIndex=0

Example response: 200

{
    "errorDescription": "Unknown poll",
    "errorCode": 5
}

Get Polls

Get poll details in reverse creation order.

Method: GET

https://ardr.nownodes.io/nxt?requestType=getPolls&chain=2&lastIndex=0

Example response: 200

{
    "polls": [],
    "requestProcessingTime": 1
}

Search Polls

Search for poll details given a name/description query string.

Method: GET

https://ardr.nownodes.io/nxt?requestType=searchPolls&chain=2&query=hello&includeFinished=true

Example response: 200

{
    "polls": [
        {
            "minRangeValue": 0,
            "votingModel": 0,
            "description": "HELLO WORLD",
            "finished": true,
            "poll": "15782508803332293630",
            "minNumberOfOptions": 1,
            "holding": "13666697367314031635",
            "minBalance": "1",
            "accountRS": "ARDOR-D7VC-BSEV-SPKC-DJZ39",
            "name": "Best Fruit",
            "options": [
                "Apple",
                "Banana",
                "Pear",
                "Orange",
                "Strawberry",
                "Watermelon"
            ],
            "finishHeight": 297467,
            "maxNumberOfOptions": 1,
            "minBalanceModel": 2,
            "account": "12936572672874485610",
            "maxRangeValue": 1,
            "timestamp": 17651519
        }
    ],
    "requestProcessingTime": 9
}

Last updated