Retrieving your Lumar accounts
To begin fully using the API you will need access to account with an active subcription.
To find out which accounts do you have access to you can run following GraphQL query.
- Query
- Response
- cURL
query getMyAccounts {
me {
accounts(first: 5) {
nodes {
id
name
}
}
}
}
{
"data": {
"me": {
"username": "your.username@usually-email.com",
"accounts": {
"nodes": [
{
"id": "TjAwN0FjY291bnQyMTkyMQ",
"name": "Your Account Name"
}
]
}
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query getMyAccounts { me { accounts(first: 5) { nodes { id name } } } }"}' https://api.lumar.io/graphql
When you have an account id that you want to access to you can skip going through me
and query directly to get a specific account.
- Query
- Variables
- Response
- cURL
query getAccountNode($accountId: ObjectID!) {
node(id: $accountId) {
... on Account {
id
name
}
}
}
{
"accountId": "TjAwN0FjY291bnQ3MTU"
}
{
"data": {
"node": {
"id": "TjAwN0FjY291bnQ3MTU",
"name": "Your Account Name"
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query getAccountNode($accountId: ObjectID!) { node(id: $accountId) { ... on Account { id name } } }","variables":{"accountId":"TjAwN0FjY291bnQ3MTU"}}' https://api.lumar.io/graphql
or you can use getAccount
query.
- Query
- Variables
- Response
- cURL
query getSpecificAccount($accountId: ObjectID!) {
getAccount(id: $accountId) {
... on Account {
id
name
}
}
}
{
"accountId": "TjAwN0FjY291bnQ3MTU"
}
{
"data": {
"getAccount": {
"id": "TjAwN0FjY291bnQ3MTU",
"name": "Your Account Name"
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query getSpecificAccount($accountId: ObjectID!) { getAccount(id: $accountId) { ... on Account { id name } } }","variables":{"accountId":"TjAwN0FjY291bnQ3MTU"}}' https://api.lumar.io/graphql