Skip to content
On this page

Speed dating API

EndpointMethodDescription
social:startSpeedDatingwebsocketStart speed dating
social:stopSpeedDatingwebsocketStop speed dating
social:getSpeedDatingStatuswebsocketGet speed dating status
social:speedDatingStartedwebsocketEventStart speed dating event
social:speedDatingStoppedwebsocketEventStop speed dating event

Start speed dating

Method: websocket

Endpoint: social:startSpeedDating

Description: Endpoint prepares map of participants and list of rounds for speed dating, and sends event with speed dating status to all participants.

User must be an owner of the room in order to start speed dating process and become moderator.

Endpoint could return following errors:

  • 8201 - Invalid speed dating shuffle mode * 8202 - Invalid speed dating participants * 8203 - Invalid speed dating seating limit * 8204 - Invalid speed dating round duration * 8205 - Speed dating already exists in hub

Request:

{
    "data": {
        "speedDating": {
            "roomId": string
            "hubId": string
            "shuffleMode": string  // default - speedDating
            "seatingLimit": int  // max amount of dating pairs per round
            "roundDuration": int  // duration of each round in seconds
            "participantGroups": [ string ]  // list of participant group names
            "participantLists": [ [ string ] ]  // lists of participant user ids per group
        }
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "speedDatingMap": {
            "speedDatingId": string
            "roundStartDates": [ timestamp ]  // list of all round start dates
            "encounters": map[string]{  // map of encounters per participant
                "group": string  // group name of current participant
                "opponents": [ (int, string, string), ... ]  // list of encounters for current participant, each encounter contains sequential number, opponent id and opponent group
            }
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Stop speed dating

Method: websocket

Endpoint: social:stopSpeedDating

Request:

{
    "data": {
        "roomId": string
        "speedDatingId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

Get speed dating status

Method: websocket

Endpoint: social:getSpeedDatingStatus

Description: Endpoint returns speed dating status in room, in case if user participates in one.

Endpoint returns encounters for all participants in case if user is moderator, and only current user encounters in case if user is participant.

Each encounter contains a list of round sequential number, opponent id and opponent group. In case if user doesn't have encounter for the round, list will be null.

Encounter opponents example: [[1, "opponentId1", "Candidate"], null, [2, "opponentId2", "Candidate"]]

Request:

{
    "data": {
        "roomId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "speedDatingStatus": {
            "roomId": string
            "hubId": string
            "moderatorId": string  // user id of moderator
            "shuffleMode": string  // default - speedDating
            "roundDuration": int  // duration of each round in seconds
            "participantGroups": [ string ]  // list of participant group names
            "speedDatingId": string
            "roundStartDates": [ timestamp ]  // list of all round start dates
            "encounters": map[string]{  // map of encounters per participant
                "group": string  // group name of current participant
                "opponents": [ (int, string, string), ... ]  // list of encounters for current participant, each encounter contains sequential number, opponent id and opponent group
            }
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Start speed dating event

Event: social:speedDatingStarted

Data:

{
    "data": {
        "speedDatingStatus": {
            "roomId": string
            "hubId": string
            "moderatorId": string  // user id of moderator
            "shuffleMode": string  // default - speedDating
            "roundDuration": int  // duration of each round in seconds
            "participantGroups": [ string ]  // list of participant group names
            "speedDatingId": string
            "roundStartDates": [ timestamp ]  // list of all round start dates
            "encounters": map[string]{  // map of encounters per participant
                "group": string  // group name of current participant
                "opponents": [ (int, string, string), ... ]  // list of encounters for current participant, each encounter contains sequential number, opponent id and opponent group
            }
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Stop speed dating event

Event: social:speedDatingStopped

Data:

{
    "data": {
        "roomId": string
        "speedDatingId": string
    }
    "error": { "status": bool, "code": int, "message": string }
}