Endpoints

Lists available endpoints for the client

Session

Create a session

POST http://localhost:8080/session/new

This endpoint allows you to create a session

Query Parameters

NameTypeDescription

voters

number

Planed number of voters

name

string

The name of the session.

{
    "session created"
}

Change a session

PUT http://localhost:8080/session/update

This endpoint allows you to change the name of the session.

Query Parameters

NameTypeDescription

name

string

The new name of the session

id

string

Id of the session to change

{
    "Session updated"
}

Start a session

POST http://localhost:8080/session/start

This endpoint allows you to start a session

Query Parameters

NameTypeDescription

id

string

The id of the session to start

{
    "Session is started"
}

Close a session

POST http://localhost:8080/session/close

This endpoint allows you to close an open session

Query Parameters

NameTypeDescription

id

string

The id of the session to close

{
    "Session is closed"
}

Get all sessions

GET http://localhost:8080/session

This endpoint allows you to get all sessions

[ 
    {
        id    : "session Id"
        name  : "name of session"
        voters: "planed voters"
        state : "state of the session"
    }
]

Get a session

GET http://localhost:8080/session/:id

This endpoint allows you to get a specific session

Path Parameters

NameTypeDescription

id

string

The id of the session

{
        id    : "session Id"
        name  : "name of session"
        voters: "planed voters"
        state : "state of the session"
}

Question

Create a question

POST http://localhost:8080/question/new

This endpoint allows you to create a new question

Query Parameters

NameTypeDescription

session

string

id of session, where this question belongs to

sentense

string

The question to ask

{
    "Question created"
}

Change a question

PUT http://localhost:8080/question/update

This endpoint allows you to update a question

Query Parameters

NameTypeDescription

sentense

string

The new question

id

string

The id of the question

{
    "Question updated"
}

Start a vote

POST http://localhost:8080/question/startVote

This endpoint allows to open the vote for a question

Query Parameters

NameTypeDescription

id

string

The id of the question

{
    "Vote is opened"
}

Close a vote

POST http://localhost:8080/question/closeVote

This endpoint allows you to close an open vote

Query Parameters

NameTypeDescription

id

string

id of the question

{
    "Vote is closed"
}

Vote a question

POST http://localhost:8080/question/vote

This endpoint allows you to vote a question

Query Parameters

NameTypeDescription

user

string

user id of the voter

decision

string

Yes or No or NoIdea

question

string

The id of the to voted question

{
    "success"
}

Get a question

GET http://localhost:8080/question/:question

This method allows you to request a question by its id

Path Parameters

NameTypeDescription

question

string

id of the question

{ 
       id : "question Id" 
       sentence : "The question to ask."
       Yes : ["user id"] 
       No : ["user id"]
       NoIdea : ["user id"]
       Voted : true or flase
       Session : "session id" 
 }

Get all questions of a session

GET http://localhost:8080/question/:session

This endpoint allows you to request all questions of a specific session

Path Parameters

NameTypeDescription

session

string

id of the session containing the questions

[
    {
        id        :"question id"
        sentense  : "the question"
        yes       : ["user id"]
        no        : ["user id"]
        noIdea    : ["user id"]
        voted     : true or false
        session    : "session id"
    }
]

Last updated