LogoLogo
DocsHomeSupportContact
  • Getting Started
    • Introduction
    • Build on DIMO
  • DEVELOPER GUIDE
    • Developer Overview
    • Developer Console
    • Authentication
    • DIMO Developer SDKs
      • Data SDK
      • Login with DIMO SDK
        • React Component
        • Login with DIMO Redirect
        • Core Functionalities
      • TypeScript: Transactions SDK
      • SDK Release Notes
    • Low Code Tools
      • n8n: Getting Started
    • Permissions Contract: SACD
    • DIMO Credits
    • Response Types
    • Rate Limits
    • Developer FAQ
    • Developer Changelogs
    • Troubleshooting Common Issues
  • API References
    • Overview of DIMO API
    • Attestation API
    • Device Definitions API
    • Identity API
      • Schema & Types
      • Scalars
      • Nodes & Objects
        • AftermarketDevice
        • AftermarketDeviceConnection
        • DCN
        • DCNConnection
        • DeveloperLicense
        • DeviceDefinition
        • Earning
        • EarningsConnection
        • Manufacturer
        • Sacd
        • SyntheticDevice
        • Vehicle
        • VehicleConnection
        • VehicleEarnings
        • UserRewards
      • Common Queries
    • Telemetry API
      • Schema & Types
      • Scalars
      • Nodes & Objects
        • Signals
        • SignalsLatest
      • Common Queries
    • Token Exchange API
    • Trips API
    • Valuations API
  • DIMO Hardware
    • Introduction
    • DIMO Hardware Application
    • DIMO Manufacturing License
    • Development & Certification
    • Audits & Assessments
      • Hardware & Security Audit
      • Customer Experience Assessment
      • Integration Testing & Quality Control
      • Final Approval
    • DIMO Device License
      • Device Minting Certificates
    • Essential Documents
      • Hardware & Security Audit Checklist
      • Approved Hardware Auditors
      • DIMO Memorandum of Understanding (MOU)
  • Additional References
    • Developer License
    • DIMO GraphQL Basics
  • Deprecated Resources
    • Guides
      • Developer Journey
      • Quick Start Guide
      • Hello World
      • Code Exchange Flow
    • Data Availability
Powered by GitBook
On this page
  • General Info
  • Developer License Info
  • Vehicle Ownership Info
  • Vehicle Basic Info
  • Vehicle Permissions (SACD) Info
  • Rewards
  • Vehicle Device Definitions
  • Some Old Queries

Was this helpful?

  1. API References
  2. Identity API

Common Queries

Cheat sheet to get you started on the Identity API

General Info

Getting the total count of vehicles on the DIMO Network
query GetTotalVehicles { 
  vehicles (first: 10) {
    totalCount
  }
}

Developer License Info

Getting information on Developer License for a given License Token ID
query GetDevLicenseByTokenId {
  developerLicense (by: { tokenId: <dev_license_token_id> } ) {
    owner
    tokenId
    alias
    clientId
    mintedAt
    redirectURIs (first: 10) {
      nodes {
        uri
        enabledAt
      }
    }
  }
}
Getting a list of Vehicle Token IDs granted from to a given Developer License
query GetVehicleByDevLicense {
  vehicles(filterBy: { privileged: "<dev_license_0x>" }, first: 100) {
    nodes {
      owner
      tokenId
      definition {
        make
        model
        year
      }
    }
  }
}

Vehicle Ownership Info

Getting the total count of vehicles for a given owner
query GetVehiclesByOwner {
  vehicles(filterBy: {owner: "<0x_address>"}, first: 100) {
    totalCount
  }
}
Getting a Make/Model/Year and vehicle tokenId list for a given owner
query GetVehicleMMYByOwner {
  vehicles(filterBy: {owner: "<0x_Address>"}, first: 100) {
    nodes {
      tokenId
      definition {
        make
        model
        year
      }
    }
  }
}

Vehicle Basic Info

Getting Make/Model/Year and owner address for a given Vehicle Token ID
query GetVehicleMMYByTokenId {
  vehicle (tokenId: <token_id>) {
    owner
    definition {
      make
      model
      year
    }
  }
}
Getting permissions shared for a given Vehicle Token ID
query GetSacdForVehicle {
  vehicle (tokenId: 3) {
    sacds (first: 10) {
      nodes {
        permissions
        grantee
        source
        createdAt
        expiresAt
      }
    }
  }
}

Rewards

Getting the Rewards data for a given owner
query GetRewardsByOwner {
  rewards (user: "<0x_address>") {
    totalTokens
  }
}
Getting the Reward history for a given owner
query GetRewardHistoryByOwner {
  vehicles(filterBy: {owner: "<0x_address>"}, first: 10) {
    nodes {
      earnings {
        history (first: 10) {
          edges {
            node {
              week
              aftermarketDeviceTokens
              syntheticDeviceTokens
              sentAt
              beneficiary
              connectionStreak
              streakTokens
            }
          }
        }
        totalTokens
      }
    }
  }
}

Vehicle Device Definitions

Getting the Device Definition ID by a given Vehicle Token ID
query GetDDIdByVehicleTokenId {
  vehicle(tokenId: <vehicle_token_id>) {
    definition {
      id
    }
  }
}
Getting the Device Definitions by Device Definition ID
query GetDefinitionByDeviceId {
  deviceDefinition (by: { id: "<device_definition_id>"})  {
    year
    model
    attributes {
      name
      value
    }
  }
}

Some Old Queries

Getting a list of Vehicle Token IDs and privileges granted by a given owner
{
  vehicles(filterBy: {owner: "<0x_address>"}, first: 100) {
    nodes {
      tokenId
      privileges(first: 10) {
        nodes {
          setAt
          expiresAt
          id
        }
      }
    }
  }
}
Getting a list of Vehicle Token IDs granted from a given owner to a given developer
{
  vehicles(filterBy: {privileged: "<0x_address>", owner: "<0x_address>"} first: 100) {
    totalCount
    nodes {
      tokenId
      definition {
        make
      }
      aftermarketDevice {
        manufacturer {
          name
        }
      }
    }
  }
}
Getting a list of DCNs attached to the vehicles owned for a given owner
{
  vehicles(filterBy: {owner: "<0x_address>"}, first: 100) {
    nodes {
      dcn {
        node
        name
        vehicle {
          tokenId
        }    
      }
    }
}}
PreviousUserRewardsNextTelemetry API

Last updated 2 days ago

Was this helpful?

Vehicle Permissions () Info

Permissions are encoded in hexadecimals - reference the for details.

SACD
common permissions table