Clan API Documentation

Create Clan

URL: /api/user/create/clan

Method: POST

Body:

{
    "name": "string",
    "id": "string"
}
            

Responses:

On Success

{
    "status": "success",
    "data": {
        "id": "string",
        "name": "string",
        "createdById": "string"
    },
    "message": "Clan created successfully"
}
                

If Clan Already Exists

{
    "message": "Clan with this name already exists"
}
                

On Error

{
    "error": "Error message"
}
                

Join Clan

URL: /api/user/join/clan

Method: POST

Body:

{
    "name": "string",
    "wallet_id": "string"
}
            

Responses:

On Success

{
    "status": "success",
    "data": {
        "id": "string",
        "name": "string",
        "createdById": "string"
    },
    "message": "Player joined clan successfully"
}
                

If Player Already Joined

{
    "message": "Player already joined this clan"
}
                

On Error

{
    "error": "Error message"
}
                

Get All Clans

URL: /api/user/clans

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": [
        {
            "id": "string",
            "name": "string",
            "createdById": "string",
            "createdAt": "date",
            "updatedAt": "date",
            "players": "number"
        },
        ...
    ]
}
                

On Error

{
    "error": "Error message"
}
                

Get Players by Clan Name

URL: /api/player/clan/:clan

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "id": "string",
        "name": "string",
        "createdById": "string",
        "players": [
            {
                "id": "string",
                "name": "string",
                "wallet_id": "string"
            },
            ...
        ]
    }
}
                

On Error

{
    "error": "Error message"
}
                

Get Clans by Player Wallet ID

URL: /api/player/clan/player/:wallet_id

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "id": "string",
        "wallet_id": "string",
        "clans": [
            {
                "id": "string",
                "name": "string",
                "createdById": "string"
            },
            ...
        ]
    }
}
                

On Error

{
    "error": "Error message"
}
                

Get Total Points of Players In A Clan by Clan Name

URL: /api/clan/points/:clan_name

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "total_points": "number"
    }
}
                

On Error

{
    "error": "Error message"
}
                

Get Top Five All Time Highest Clan Points (Highest First)

URL: /api/clan/top-points

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "topFiveClans": {
            name: string,
            total_points: number
        }[]
    }
}
                

On Error

{
    "error": "Error message"
}
                

Get Total Battle Points of Clans For Last Battle

URL: /api/clan/battle/points

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "clansBattlePoints": {
            name: string,
            points: number
        }[]
    }
}
                

On Error

{
    "error": "Error message"
}
                

Get Total Event Battle Points of Clans For Last Battle Event

URL: /api/clan/event/battle/points

Method: GET

Responses:

On Success

{
    "status": "success",
    "data": {
        "clansBattlePoints": {
            name: string,
            points: number
        }[]
    }
}
                

On Error

{
    "error": "Error message"
}