Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note

THIS IS A REPRESENTATIVE QUERY FOR OUR FULLY FUNCTIONAL API. IT WILL NOT WORK UNTIL WE HAVE FULLY LAUNCHED THE API.

This sample query is to help understand complex query structure and the corresponding data returned through the API.

...

Info

The following queries are SAMPLES. As a consumer of the Scope GraphQL API, you can design and use any properly formed query to retrieve the data that you require.

For more information, see “Introduction to the Scope GraphQL API“.

Retrieving A Single Scenario Session’s Data

Code Block
query {
  viewer {
    organization {
      scenarioSessions {
        # INSERT everything below the `... on ScenarioSession` line vvquery SampleScenarioSessionNodeQueryDemonstratingImportantFields($id: ID!) {
  node(id: "ljmnV58GM_c4AEHHiZy0qiSoP9HN3CnK7dbuPMNxx_M="$id) {
    ... on ScenarioSession {
      startedAt
      finishedAtendedAt
      duration
      idleDuration
      numberOfStepsPossible
      numberOfStepsViewed
      percentOfStepsViewed
      state
      externalData # NOTE: this is where thequery dataparams passed from the System of Record can be found
      scenarioRelease {
        author
        publishedAt
        scenario {
          author {
 
          id
 
          name

         }
        publishedAt
 description       scenario  {
 name         author  origin_group {
            nameid
          }         name
 published_at         }
        type  description
      version    name
  }       events {
        nodes originGroup {
          attachments { id
           author name
           fileContentType}
          publishedAt
 fileDownloadCount       }
     fileFingerprint   type
         fileName
 version
          fileSize
            fileUpdatedAt
            fileURL
            fileURLExpiresAt
            name
            organization
            owner
            type          }
          deviceLocationevents {
            altitude
            device nodes {
          id
   identifier       createdAt
       model   receivedAt
          type
organization          externalData
    os      }
      }
      steps {
    isSindowsExe    nodes {
       latitude   scenarioStep {
        longitude    name
        platform    orderIndex
        protocol             version
          }
        }
      }
      steps {
        scenario_step {scenarioSequence {
              name

         orderIndex           scenarioSequence {
            name        }
            }
        }
      }
    }
  }
}

Retrieving

...

Scenario Session Data

Code Block
# To pull ALL scenario sessions for the org associated with currently authenticated user
query query SampleAllScenarioSessionsQueryDemonstratingImportantFields {
  viewer {
    organization {
      scenarioSessions {
        nodes #{
INSERT everything below the `... on ScenarioSession` line vv# To pullstartedAt
the details for a scenario sessions with id = "ljmnV58GM_c4AEHHiZy0qiSoP9HN3CnK7dbuPMNxx_M="
query { endedAt
   node(id: "ljmnV58GM_c4AEHHiZy0qiSoP9HN3CnK7dbuPMNxx_M=") {     ...duration
on ScenarioSession {       startedAt idleDuration
     finishedAt     numberOfStepsPossible
 duration       idleDuration  numberOfStepsViewed
    numberOfStepsPossible      percentOfStepsViewed
numberOfStepsViewed       percentOfStepsViewed   state
   state       externalData # NOTE: this is where thequery dataparams passed from the System of Record can be found
      scenarioRelease {   scenarioRelease {
    author         publishedAt
        scenario author {
          author {
            id
            name           }
          description
          name
          origin_group
{             name
          }
  
       published_at     publishedAt
   }         type
        version
      }
      eventsscenario {
        nodes {           attachmentsauthor {

           author     id
       fileContentType         name
   fileDownloadCount           }
 fileFingerprint             fileNamedescription
            fileSize  name
          fileUpdatedAt    originGroup {
       fileURL         id
   fileURLExpiresAt             name
  
         organization             owner
            type          }
          deviceLocation {             altitude
publishedAt
           device {
              identifier
              model
              organization
              os
            }
            isSindowsExetype
            latitude
            longitude
            platform
            protocol
            version
          }

       }       }
      stepsevents {
   
    scenario_step {           name
          orderIndex
          scenarioSequencenodes {
            name  id
              createdAt
   }         }  receivedAt
    }     }   } }# Example response!
{
  "data": {
    "startedAt": "some value"
    "finishedAt": "some value"
    "duration": "some value" type
     "idleDuration": "some value"     "numberOfStepsPossible": "some value"
    "numberOfStepsViewed": "some value"
    "percentOfStepsViewed": "some value"
    "state": "some value"
    "externalData":
{       # NOTE: this is where the data passed from the System of Record can be "found": "some value"
    }
    "scenarioRelease": {
      "author": "some value"
      "publishedAt": "some value"
      "scenario": { 
        "author": { 
    
     "id": "some value"           "name": "some value"
        }
    
   "description": "some value"         "name": "some value"
        "origin_group": steps {
           "name": "some value"
        }
        "published_at": "some value"
      }
      "type": "some value"
      "version": "some value"
    }
    "events": { 
   nodes {
   "nodes": {          "attachments":scenarioStep {
           "author": "some value"    name
      "fileContentType": "some value"        orderIndex
  "fileDownloadCount": "some value"           "fileFingerprint": "some value"
          "fileName": "some value"
          "fileSize": "some value" scenarioSequence {
           "fileUpdatedAt": "some value"
          "fileURL": "some value"
          "fileURLExpiresAt": "some value"           "name":
"some value"           "organization": "some value"           "owner": "some value"
          "type": "some value"
        }
        "deviceLocation": { 
          "altitude": "some value"
          "device": { 
            "identifier": "some value"
            "model": "some value"
            "organization": "some value"
     
      "os": "some value"           }
          "isSindowsExe": "some value"
          "latitude": "some value"
         
"longitude": "some value"           "platform": "some value"
          "protocol": "some value"
          "version": "some value"
        }
      }
    }
    "steps": {
      scenario_step "{": "some value"
        "name": "some value"
        "orderIndex": "some value"
        scenarioSequence "{": "some value"
          "name": "some value"          
        }
      }
    }
  }
}