Mutation
mutation AssignTrainingToUsers($input: AssignTrainingInput!) {
assignTrainingToUsers(input: $input) {
action {
assigned {
allowedLocations {
__typename
}
avatarUrl
department
email
firstName
groups {
__typename
}
}
assignment {
__typename
}
canChangeStatus
completedDate
createdAt
dueDate
}
actionId
assignment {
actions {
__typename
}
id
latestAction {
assigned {
__typename
}
assignment {
__typename
}
canChangeStatus
completedDate
createdAt
dueDate
}
latestActionId
nextAt
nextTraining {
anchor
assignedGroups {
__typename
}
assignedUsers {
__typename
}
followup {
__typename
}
id
materials {
__typename
}
}
}
assignmentId
present
progressPct
}
}Variables
{
"input": {
"trainingId": "string",
"trainingVersion": 1,
"userIds": [
"string"
]
}
}Response
{
"data": {
"assignTrainingToUsers": [
{
"action": {
"assigned": {
"allowedLocations": [
{
"__typename": "Location"
}
],
"avatarUrl": "string",
"department": "string",
"email": "string",
"firstName": "string",
"groups": [
{
"__typename": "UserGroup"
}
]
},
"assignment": {
"__typename": "ActionToTrainingAssignment"
},
"canChangeStatus": true,
"completedDate": "value",
"createdAt": "value",
"dueDate": "value"
},
"actionId": "id",
"assignment": {
"actions": [
{
"__typename": "ActionToTrainingAssignment"
}
],
"id": "id",
"latestAction": {
"assigned": {
"__typename": "User"
},
"assignment": {
"__typename": "ActionToTrainingAssignment"
},
"canChangeStatus": true,
"completedDate": "value",
"createdAt": "value",
"dueDate": "value"
},
"latestActionId": "id",
"nextAt": "value",
"nextTraining": {
"anchor": "string",
"assignedGroups": [
{
"__typename": "UserGroup"
}
],
"assignedUsers": [
{
"__typename": "User"
}
],
"followup": {
"__typename": "Training"
},
"id": "id",
"materials": [
{
"__typename": "TrainingMaterial"
}
]
}
},
"assignmentId": "id",
"present": true,
"progressPct": 1
}
]
}
}Mutations
assignTrainingToUsers
Assigns the latest published version of a training to users and returns the occurrence created for each of them.
MUTATION
assignTrainingToUsers(input: AssignTrainingInput!): [ActionToTrainingAssignment!]!Arguments
input
required
The training and the users to assign it to.
Returns
action
The action that tracks this occurrence.
actionId
ID!
Id of the 'TRAINING' action that tracks this occurrence.
assignment
The training assignment this occurrence was issued under.
assignmentId
ID!
Id of the training assignment this occurrence belongs to.
present
Boolean
Whether the learner was marked as attended, for in-person trainings.
progressPct
Int
How much of the training content the learner has viewed, from 0 to 100.
quizAnswers
JSON
The answers the learner submitted to the training quiz.
scormNotPassed
Boolean!
Whether the SCORM package reported that the learner failed it.
training
The training, at the version the occurrence was issued against.
Mutation
mutation AssignTrainingToUsers($input: AssignTrainingInput!) {
assignTrainingToUsers(input: $input) {
action {
assigned {
allowedLocations {
__typename
}
avatarUrl
department
email
firstName
groups {
__typename
}
}
assignment {
__typename
}
canChangeStatus
completedDate
createdAt
dueDate
}
actionId
assignment {
actions {
__typename
}
id
latestAction {
assigned {
__typename
}
assignment {
__typename
}
canChangeStatus
completedDate
createdAt
dueDate
}
latestActionId
nextAt
nextTraining {
anchor
assignedGroups {
__typename
}
assignedUsers {
__typename
}
followup {
__typename
}
id
materials {
__typename
}
}
}
assignmentId
present
progressPct
}
}Variables
{
"input": {
"trainingId": "string",
"trainingVersion": 1,
"userIds": [
"string"
]
}
}Response
{
"data": {
"assignTrainingToUsers": [
{
"action": {
"assigned": {
"allowedLocations": [
{
"__typename": "Location"
}
],
"avatarUrl": "string",
"department": "string",
"email": "string",
"firstName": "string",
"groups": [
{
"__typename": "UserGroup"
}
]
},
"assignment": {
"__typename": "ActionToTrainingAssignment"
},
"canChangeStatus": true,
"completedDate": "value",
"createdAt": "value",
"dueDate": "value"
},
"actionId": "id",
"assignment": {
"actions": [
{
"__typename": "ActionToTrainingAssignment"
}
],
"id": "id",
"latestAction": {
"assigned": {
"__typename": "User"
},
"assignment": {
"__typename": "ActionToTrainingAssignment"
},
"canChangeStatus": true,
"completedDate": "value",
"createdAt": "value",
"dueDate": "value"
},
"latestActionId": "id",
"nextAt": "value",
"nextTraining": {
"anchor": "string",
"assignedGroups": [
{
"__typename": "UserGroup"
}
],
"assignedUsers": [
{
"__typename": "User"
}
],
"followup": {
"__typename": "Training"
},
"id": "id",
"materials": [
{
"__typename": "TrainingMaterial"
}
]
}
},
"assignmentId": "id",
"present": true,
"progressPct": 1
}
]
}
}