EdGamers Logo

EdGamers API Documentation

Introduction

Welcome to the EdGamers API documentation. This API allows developers to integrate their games seamlessly with our platform. Below you will find detailed information about the available endpoints and how to use them.

Authentication

All API requests must be authenticated using an API key. You can obtain your API key from the EdGamers developer portal.

Authentication Header

Authorization: Bearer YOUR_API_KEY

Endpoints

Get All Games

Retrieve a list of all available games on the EdGamers platform.

GET /games

Response

[
    {
        "id": "game_1",
        "title": "Bouncy Blob Adventure",
        "url": "https://create-games-edgamers.s3.amazonaws.com/game_1.html"
    },
    {
        "id": "game_2",
        "title": "Elemental Escape",
        "url": "https://create-games-edgamers.s3.amazonaws.com/game_2.html"
    }
]

Get Game Details

Retrieve detailed information about a specific game.

GET /games/{game_id}

Parameters

{
    "game_id": "The unique identifier of the game."
}

Response

{
    "id": "game_1",
    "title": "Bouncy Blob Adventure",
    "description": "A fun and challenging platformer game.",
    "url": "https://create-games-edgamers.s3.amazonaws.com/game_1.html",
    "developer": "Jane Doe",
    "release_date": "2024-06-15"
}

Create a New Game

Upload and create a new game on the EdGamers platform.

POST /games

Request Body

{
    "title": "The title of the game.",
    "description": "A brief description of the game.",
    "file": "The game file (HTML, CSS, JS) to upload."
}

Response

{
    "id": "game_3",
    "title": "New Game Title",
    "url": "https://create-games-edgamers.s3.amazonaws.com/game_3.html"
}

Update Game Details

Update the details of an existing game.

PUT /games/{game_id}

Parameters

{
    "game_id": "The unique identifier of the game."
}

Request Body

{
    "title": "The new title of the game.",
    "description": "The new description of the game."
}

Response

{
    "id": "game_1",
    "title": "Updated Game Title",
    "description": "Updated description of the game."
}

Delete a Game

Remove a game from the EdGamers platform.

DELETE /games/{game_id}

Parameters

{
    "game_id": "The unique identifier of the game."
}

Response

{
    "message": "Game deleted successfully."
}

Error Codes

Common Error Codes

{
    "400": "Bad Request - The request could not be understood or was missing required parameters.",
    "401": "Unauthorized - Authentication failed or user does not have permissions for the requested operation.",
    "404": "Not Found - The requested resource could not be found.",
    "500": "Internal Server Error - An error occurred on the server."
}