> For the complete documentation index, see [llms.txt](https://developer.ideavate.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.ideavate.co.uk/guides/getting-started/example-graphql-queries.md).

# Example GraphQL Queries

## Assets

Get the assets and their associated provisions:

```graphql
{
  getAssets {
    provisions {
      __typename
      lastUpdatedAt
    }
    __typename
    ... on Property {
      postcode
    }
    ... on Vehicle {
      identifier
    }
  }
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getAssets%20%7B%0A%20%20%20%20provisions%20%7B%0A%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20lastUpdatedAt%0A%20%20%20%20%7D%0A%20%20%20%20__typename%0A%20%20%20%20...%20on%20Property%20%7B%0A%20%20%20%20%20%20postcode%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20Vehicle%20%7B%0A%20%20%20%20%20%20identifier%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)

## Accounts

Get the accounts with their logos and deep links to within Onedox:

```graphql
{
  getAccounts {
    id
    name
    provider {
      name
    }
    logoUrl
    appLink {
      universal
    }
  }
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getAccounts%20%7B%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20provider%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%20%20logoUrl%0A%20%20%20%20appLink%20%7B%0A%20%20%20%20%20%20universal%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)

## Provisions

Get provisions along with their type and some more details for vehicles and media packages:

```graphql
{
  getProvisions {
    __typename
    lastUpdatedAt
    account {
      name
      provider {
        name
      }
    }
    startsAt
    endsAt
    ... on VehicleMot {
      motStatus: status
      vehicle {
        identifier
      }
    }
    ... on VehicleTax {
      taxStatus: status
      vehicle {
        identifier
      }
    }
    ... on MediaPackage {
      name
      features
      status
    }
  }
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getProvisions%20%7B%0A%20%20%20%20__typename%0A%20%20%20%20lastUpdatedAt%0A%20%20%20%20account%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20provider%20%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20startsAt%0A%20%20%20%20endsAt%0A%20%20%20%20...%20on%20VehicleMot%20%7B%0A%20%20%20%20%20%20motStatus%3A%20status%0A%20%20%20%20%20%20vehicle%20%7B%0A%20%20%20%20%20%20%20%20identifier%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20VehicleTax%20%7B%0A%20%20%20%20%20%20taxStatus%3A%20status%0A%20%20%20%20%20%20vehicle%20%7B%0A%20%20%20%20%20%20%20%20identifier%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20MediaPackage%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20features%0A%20%20%20%20%20%20status%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A)

## Documents

Get documents for a particular account along with date and charges (where available):

```
{
  getAccount(id: "57dfdfc6ebb350890e60e9b1") {
    documents {
      date
      name
      types
      billMeta {
        dueAt
        totalCharges {
          currency
          amount
        }
      }
    }
  }
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getAccount%28id%3A%20%2257dfdfc6ebb350890e60e9b1%22%29%20%7B%0A%20%20%20%20documents%20%7B%0A%20%20%20%20%20%20date%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20types%0A%20%20%20%20%20%20billMeta%20%7B%0A%20%20%20%20%20%20%20%20dueAt%0A%20%20%20%20%20%20%20%20totalCharges%20%7B%0A%20%20%20%20%20%20%20%20%20%20currency%0A%20%20%20%20%20%20%20%20%20%20amount%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) n.b. you will need to replace the `id` input with one that is valid for your own Onedox account.

Get all accessible documents along with their iOS deep link and the name of the provider that they came from:

```
{
  getDocuments {
    date
    name
    types
    appLink {
      ios
    }
    account {
      provider {
        name
      }
    }
  }
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getDocuments%20%7B%0A%20%20%20%20date%0A%20%20%20%20name%0A%20%20%20%20types%0A%20%20%20%20appLink%20%7B%0A%20%20%20%20%20%20ios%0A%20%20%20%20%7D%0A%20%20%20%20account%20%7B%0A%20%20%20%20%20%20provider%20%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)

## User

Get the authenticated user and access permissions:

```
{
  getCaller {
    fullName
    email
  }

  getAuthorisedRoles
}
```

[Try in Explorer](https://api.ideavate.co/v1/graphql?query=%7B%0A%20%20getCaller%20%7B%0A%20%20%20%20fullName%0A%20%20%20%20email%0A%20%20%7D%0A%20%20%0A%20%20getAuthorisedRoles%0A%7D)
