Ploi API
Ploi API

Get database

Get the selected database

GET api/servers/{server}/databases/{id}

Example request:

curl -X GET "https://ploi.io/api/servers/{server}/databases/{id}" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 1,
        "type": "mysql",
        "name": "my_database",
        "server_id": 1,
        "status": "active",
        "created_at": "2019-07-19 08:20:30"
    }
}

Example response when you have attached a site to a database:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 2,
        "type": "mysql",
        "name": "my_database_with_site",
        "server_id": 1,
        "status": "active",
        "site": {
            "id": 1,
            "root_domain": "domain.com"
        },
        "created_at": "2022-02-16 13:55:26"
    }
}