Skip to main content

Example Queries and Mutations

Example queries and mutations using the Devii Portal's API.

Auth Connection

Refer to Auth Endpoint documentation.

Tenant ID: 14

Queries and Mutations

Refer to Query and Role PBAC Endpoints documentation.

Get Tenant ID

Tenant ID is needed to login to your Devii API and it's available in the database table. This query will only show database available to you.

{
database {
id
tenantid
name
}
}

Response

{
"data": {
"database": [
{
"id": "199",
"tenantid": 1001,
"name": "Test DB 1"
},
{
"id": "200",
"tenantid": 1002,
"name": "Test DB 2"
},
]
}
}

Get Project ID

You may need Project ID.

From the Database Table

{
database {
id
projectid
tenantid
name
}
}

Response

{
"data": {
"database": [
{
"id": "199",
"projectid": 10,
"tenantid": 1001,
"name": "Test DB 1"
},
{
"id": "200",
"projectid": 10,
"tenantid": 1002,
"name": "Test DB 2",
},
]
}
}

From the Project Table

{
project {
id
name
}
}

Response

{
"data": {
"project": [
{
"id": "10",
"name": "DemoUser"
}
]
}
}