Comment on page
Create a Coach
In order to create a coach we require to use a combination of two mutations
createUser
and makeCoach
. createUser
will create the new user inside the console while makeCoach
will grant access to the coaching portal.Both should be run on our "console API", so you will need to generate the "Authorization Token" which is required as an authorization header (example below).
Argument Name | Is required? | Type | Description |
email | Yes | string | Console Admin email |
password | Yes | string | Object that contains the password fields. |
Field Name | Type | Description |
email | String | Coach user email |
name | String | Coach name |
password | String | Coach password |
roles | Array | Viewer |
active | Boolean | True if the coach will be active. Otherwise, False |
Field Name | Type | Description |
email | String | Coach user email |
name | String | Coach name |
isCoachAdmin | Boolean | Set to True to make coach |
The following fields will be displayed in the response:
Field Name | Type | Description |
success | Boolean | True if the coach information has been created successfully. Otherwise, False
|
message | String | Description of the result |
Generate access token
Request
Response
{
"data": {
"login": {
"success": true,
"accessToken": "eyJ0eXAiOiJKV1QiJCJhbGciOiJIUzI1NiJ9.EyJleHAiUjE2NjA4NDMwMzMsImlzcyI6InNnOnBvcnRhbCIsImlhdCI6MTY1ODI1MTAzMywidWlkIjoiMTA2NCIsImVtYWlsIjoicmV2ZXJzZWhlYWx0aEBzdWdnZXN0aWMuY29tIiwidGhpcmRwYXJ0eSI6IjIxNjAiLCJyb2xlcyI6WyJBRE1JTiIsIkNPQUNIX0FETUlOIiwiQ09BQ0hfQUxMX01FTUJFUlMiLCJDT0FDSCJdLCJzZXNzaW9uIjoiZko3bDVldTIzYUhnIn0.T9MtDLrw-l1086R4qNcD3S3HxRZV5HamlVzX_BPMT3s"
}
}
}
Create coach
Request
Headers
Response
mutation {
createUser(
email: "[email protected]"
name: "Scott Pilgrim"
password: "pp455w0rd"
roles: ["VIEWER"]
active: true
) {
success message
}
makeCoach(
email: "[email protected]"
name: "Scott Pilgrim"
isCoachAdmin: true
) {
success message
}
}
{
Authorization: "JWT eyJ0eXAiOiJKV1QiJCJhbGciOiJIUzI1NiJ9.EyJleHAiUjE2NjA4NDMwMzMsImlzcyI6InNnOnBvcnRhbCIsImlhdCI6MTY1ODI1MTAzMywidWlkIjoiMTA2NCIsImVtYWlsIjoicmV2ZXJzZWhlYWx0aEBzdWdnZXN0aWMuY29tIiwidGhpcmRwYXJ0eSI6IjIxNjAiLCJyb2xlcyI6WyJBRE1JTiIsIkNPQUNIX0FETUlOIiwiQ09BQ0hfQUxMX01FTUJFUlMiLCJDT0FDSCJdLCJzZXNzaW9uIjoiZko3bDVldTIzYUhnIn0.T9MtDLrw-l1086R4qNcD3S3HxRZV5HamlVzX_BPMT3s"
}
{
"data": {
"createCoach": {
"success": true
}
"makeCoach":{
"success": true
}
}
}
Last modified 1yr ago