Examples

This is not comprehensive documention for the API, but is a list of useful examples to get you started.

For complete structure check out the full schema documentation.

Queries

channels

REQUEST
Copy
query {
  channels {
    nodes {
      id
      name
      description
      privacyLevel
      imageUrls
      objective
      orgDiscoverable
      analyticsEnabled
      createdOn
      archivedOn
      planId
      members {
        userId
      }
      content {
        id
      }      
    }
  }
}

RESPONSE
{
  "data": {
    "nodes": [
      {
        "id": "channel-id",
        "name": "My Channel",
        "description":, "Channel description goes here",
        "privacyLevel": "private",
        "imageUrls": [
          "https://image.url.com/3223"
        ],
        "objective": null,
        "orgDiscoverable": false,
        "analyticsEnabled": false,
        "createdOn": "2020-02-20T23:23:26.481Z",
        "archivedOn": "2020-02-20T23:23:26.481Z",
        "planId": "my-plan",
        "members": [
          {
            "userId": "31784e54-979f-4b14-813e-4e8f12f1390d"
          }
        ],
        "content": [
          {
            "id": "54824e54-979f-4b14-813e-4e8f12f1845c"
          }
        ]
      }, ...
    ]
  }
}

skillIqs

REQUEST
Copy
query {
  skillIqs {
    nodes {
      id
      userId
      planId
      email
      firstName
      lastName
      approximateLevel
      assessmentId
      measurementType
      skillName
      skillShortName
      totalInteractions
      createdOn
      startedOn
      completedOn
      runNumber
      isCurrentScore
    }
  }
}

RESPONSE
{
  "data": {
    "skillIqs": {
      "nodes": [
        {
          "id": "e0a360ba-f146-4a90-8cca-e496b904bf7b",
          "userId": "80a87ebe-68b0-4683-ba93-dfb3b2f78792",
          "planId": "got-plan",
          "email": "[email protected]",
          "firstName": "Jon",
          "lastName": "Snow",
          "approximateLevel": "Proficient",
          "measurementType": "full run",
          "skillName": "C#",
          "skillShortName": "C#",
          "totalInteractions": 10,
          "createdOn": "2020-01-09T17:27:40.605Z"
          "startedOn": "2020-01-09T17:27:40.605Z"
          "completedOn": "2020-01-09T17:27:40.605Z",
          "runNumber": 1,
          "isCurrentScore": true,
        }, ...
      ]
    }
  }
}

roleIqCatalog

REQUEST
Copy
query { 
  roleIqCatalog {
    nodes {
      id
      name
      createdByUser
      roleIcon
      status
      createdOn
      updatedOn
    }
  }
}

RESPONSE
{
  "data": {
    "roleIqCatalog": {
      "nodes": [
        {
          "id": "2db5e38e-19b6-40e0-b366-c4555467c945",
          "name": "Python Data Scientist",
          "createdByUser": "Grace Hopper",
          "roleIcon": "https://s2.pluralsight.com/roleiq/imgs/badge_tableau_analyst.svg",
          "status": "live",
          "createdOn": "2018-11-13T04:41:36.351Z",
          "updatedOn": "2018-11-13T04:46:49.929Z"
        },...
      ]
    }
  }
}

courseProgress

REQUEST
Copy
query {
  courseProgress {
    nodes {
      userId
      courseId
      courseIdNum
      percentComplete
      isCourseCompleted
      completedOn
      courseSeconds
      totalWatchedSeconds
      totalClipsWatched
      firstViewedClipOn
      lastViewedClipOn
      planId
    }
  }
}

RESPONSE
{
  "data": {
    "courseProgress": {
      "nodes": [
        {
          "userId": "4469333c-5e90-42Bc-9938-dbc4343e5d1",
          "courseId": "042a30dd-be2f-4c11-b44d-49a44cd2a267",
          "courseIdNum": 932040365,
          "percentComplete": 0.604699,
          "isCourseCompleted": false,
          "completedOn": null,
          "courseSeconds": 11576,
          "totalWatchedSeconds": 70,
          "totalClipsWatched": 1,
          "firstViewedClipOn": "2018-02-15T23:51:45.620Z",
          "lastViewedClipOn": "2018-02-15T23:51:45.620Z",
          "planId": "got-plan"
        },...
      ]
    }
  }
}

users

REQUEST
Copy
query {
  users {
    totalCount
    nodes {
      id
      email
      firstName
      startedOn
    }
  }
}

RESPONSE
{
  "data": {
    "users": {
      "nodes": [
        {
          "id": "faaa75f3-5555-47b5-b9cb-d409f338fcad",
          "email": "[email protected]",
          "firstName": "Obidiah Dogberry",
          "startedOn": "2017-08-29T20:11:01.750Z"
        }
      ]
    }
  }
}

Mutations

addChannel

REQUEST
Copy
mutation {
  addChannel(input: {
    createdByUserHandle: "dse84kfi-ace3-4c87-9608-2346957839c2"
    description: "My New Channel"
    planId: "got-plan"
    privacyLevel: "private"
  }) {
    channel {
      id
      privacyLevel
      archivedDate
      description
      imageUrls
      objective
      orgDiscoverable
      analyticsEnabled
      createdDate
      content {
        channelId
      }
    }
  }
}

RESPONSE
{
  "data": {
    "addChannel": {
      "channel": {
        "id": "0175eeb5-a7ae-46a5-912d-24ba9b9be188",
        "privacyLevel": "private",
        "archivedDate": null,
        "description": "My New Channel",
        "imageUrls": [],
        "objective": null,
        "orgDiscoverable": false,
        "analyticsEnabled": false,
        "createdDate": "2019-06-18T22:52:29.805Z",
        "content": []
      }
    }
  }
}

addTeam

REQUEST
Copy
mutation {
  addTeam(input: {
    name: "My New Team"
    description: "team description"
  }) {
    id
    name
    description
    groupId
  }
}

RESPONSE
{
  "data": {
    "addTeam": {
      "id": "83852b29-3443-4061-81bb-a51c5bcde91e",
      "name": "My New Team",
      "description": "team description",
      "groupId": null
    }
  }
}

Interfaces

For more complete documentation about querying Interfaces please reference this Apollo Documentation.

channelContent and channelContentSection

Here is a useful example of how you can query our channelContent Interface using the on syntax to collect specific information belonging to each subfield (Section, External Link Section, and External Link)

REQUEST
Copy
query {
  channelContent 
  {
    nodes {
      id
      channelId
      index
      type
      ... on Section {
        name
        description
        content { 
          id
          index
          type
          ... on ExternalLinkSection {
            url
            title
            contentType
            level
            durationInSeconds
          }
        }
      }
      ... on ExternalLink {
        url
        title
        contentType
        level
        durationInSeconds
      }
    }
  }
  
}

RESPONSE
{
  "data": {
    "channelContent": {
      "nodes": [
        {
          "id": "4b0e87b1-b9c0-49fe-8887-37e4a7bd02d4",
          "channelId": "00090c61-26d9-4cfd-bc7a-eb85c9e01813",
          "index": 1,
          "type": "skill-assessment"
        },
        {
          "id": "b22e9b04-9778-4a1d-882a-9b84a30869f9",
          "channelId": "57e637ed-6e78-48d9-9281-6475c8c82617",
          "index": 3,
          "type": "course"
        },
        {
          "id": "4e65f933-0e21-4c5f-a177-01f9620b8f43",
          "channelId": "0063b512-469e-4dc7-9f34-1449f869cd58",
          "index": 0,
          "type": "section",
          "name": "This is a Section!,
          "description": "This is a Section Description",
          "content": [
            {
              "id": "62443150-2c87-43b2-9d81-f9b79fd624b7",
              "index": 1,
              "type": "course"
            },
            {
              "id": "2365049d-fb66-4ffd-b768-031ff7d13d26",
              "index": 2,
              "type": "external-link",
              "url": "https://learn.pluralsight.com/resource/tutorial/how-to-use-pluralsight",
              "title": "How to use Pluralsight",
              "contentType": "External Link",
              "level": null,
              "durationInSeconds": 60
            }
        },
        {
          "id": "65b73e3e-296b-4e53-bbb8-ab8da1ff66f9",
          "channelId": "00cdd9aa-363a-4b65-a347-ac365b608baa",
          "index": 7,
          "type": "external-link",
          "url": "https://blog.angular.io/",
          "title": "Angular Blog",
          "contentType": "Article",
          "level": null,
          "durationInSeconds": 60
        }
      ]
    }
  }
}