Skip to content

Gateway🔗

Connecting to the gateway🔗

The gateway is available at wss://proghour.com/api/gateway.

Gateway reponse🔗

The gateway should always return responses according to the format below, any deviations from this model should be reported as an issue in the service repository.

{
    "response": {
        "op": "...",
        "d": {...}
    },
    "status": true | false,
    "error": {...}
}

response and error fields may not be included in the response. If, for example there's an error then the response field will not be included in the response, only the error and status fields will be included.

The status field is always set to true if there is a response, and false if an error occured.

Response examples🔗

Success response🔗

{
    "response": {
        "op": "...",
        "d": {...}
    },
    "status": true
}

Error response🔗

{
    "status": false,
    "error": {...}
}

Gateway authentication 🚧🔗

🚧 The authentication service is not finished and the Token cookie can therefore not be validated.

Clients are authenticated to their accounts through the Cookie header with a cookie named Token. The token is validated on the server and incase the token is invalid the client is disconnected with the following error response.

{
    "status": false,
    "error": {
        "code": "NotAuthenticated",
        "reason": "The client was not authenticated"
    }
}

New connections ✅🔗

A newly connected client will immedietly receive a Hello response according to the format below.

{
    "response": {
        "op": "Hello",
        "d": {
            "client_id": Uuid
        }
    },
    "status": false
}
Back to top