Example GraphQL Queries

Some sample GraphQL queries to get you started

Assets

Get the assets and their associated provisions:

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

Try in Explorer

Accounts

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

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

Try in Explorer

Provisions

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

{
  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

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 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

User

Get the authenticated user and access permissions:

{
  getCaller {
    fullName
    email
  }

  getAuthorisedRoles
}

Try in Explorer

Last updated