Skip to content

Instantly share code, notes, and snippets.

@StefSchenkelaars
Created July 18, 2017 12:59
Show Gist options
  • Save StefSchenkelaars/3414d13e3b1a7b70cd92506911793559 to your computer and use it in GitHub Desktop.
Save StefSchenkelaars/3414d13e3b1a7b70cd92506911793559 to your computer and use it in GitHub Desktop.
{
"info":{
"title":"StudyCoach",
"description":"Allows you to change roles in StudyCoach a.k.a. Canvan Dashboard.",
"contact":{
"name":"Stef Schenkelaars",
"email":"[email protected]",
"url":"https://drieam.com"
},
"version":"0.0.1"
},
"swagger":"2.0",
"produces":[
"application/json"
],
"securityDefinitions":{
"api_key":{
"type":"apiKey",
"name":"Authorization",
"in":"header",
"description":"Provide your api_key prepended by Bearer. So for example: `Bearer 86cf303b366adea6c17812f86e3ff92e`"
}
},
"security":[
{
"api_key":[
]
}
],
"host":"v2.studycoachapp.com",
"schemes":[
"https"
],
"tags":[
{
"name":"roles",
"description":"Operations about roles"
}
],
"paths":{
"/api/v1/roles/coaches":{
"get":{
"summary":"Get all coaches of a user (probably a student)",
"description":"Get all coaches of a user (probably a student)",
"produces":[
"application/json"
],
"parameters":[
{
"in":"query",
"name":"canvas_login_id",
"description":"The login_id of the user as used in canvas",
"type":"string",
"required":true
}
],
"responses":{
"200":{
"description":"Get all coaches of a user (probably a student)",
"schema":{
"type":"array",
"items":{
"$ref":"#/definitions/Role"
}
}
},
"401":{
"description":"Unauthorized",
"schema":{
"$ref":"#/definitions/Error"
}
},
"404":{
"description":"Record not found",
"schema":{
"$ref":"#/definitions/Error"
}
},
"412":{
"description":"Precondition failed",
"schema":{
"$ref":"#/definitions/Error"
}
}
},
"tags":[
"roles"
],
"operationId":"getApiV1RolesCoaches"
}
},
"/api/v1/roles/students":{
"get":{
"summary":"Get all students of a user (probably a coach)",
"description":"Get all students of a user (probably a coach)",
"produces":[
"application/json"
],
"parameters":[
{
"in":"query",
"name":"canvas_login_id",
"description":"The login_id of the user as used in canvas",
"type":"string",
"required":true
}
],
"responses":{
"200":{
"description":"Get all students of a user (probably a coach)",
"schema":{
"type":"array",
"items":{
"$ref":"#/definitions/Role"
}
}
},
"401":{
"description":"Unauthorized",
"schema":{
"$ref":"#/definitions/Error"
}
},
"404":{
"description":"Record not found",
"schema":{
"$ref":"#/definitions/Error"
}
},
"412":{
"description":"Precondition failed",
"schema":{
"$ref":"#/definitions/Error"
}
}
},
"tags":[
"roles"
],
"operationId":"getApiV1RolesStudents"
}
},
"/api/v1/roles":{
"post":{
"summary":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach.",
"description":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach.",
"produces":[
"application/json"
],
"consumes":[
"application/json"
],
"parameters":[
{
"name":"ApiV1Roles",
"in":"body",
"required":true,
"schema":{
"$ref":"#/definitions/postApiV1Roles"
}
}
],
"responses":{
"201":{
"description":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach.",
"schema":{
"$ref":"#/definitions/Role"
}
},
"401":{
"description":"Unauthorized",
"schema":{
"$ref":"#/definitions/Error"
}
},
"404":{
"description":"Record not found",
"schema":{
"$ref":"#/definitions/Error"
}
},
"412":{
"description":"Precondition failed",
"schema":{
"$ref":"#/definitions/Error"
}
}
},
"tags":[
"roles"
],
"operationId":"postApiV1Roles"
}
}
},
"definitions":{
"Role":{
"type":"object",
"properties":{
"started_at":{
"type":"string",
"format":"date",
"description":"The date when this coach started"
},
"ended_at":{
"type":"string",
"format":"date",
"description":"The date when this coach stopped (null when still active)"
},
"student":{
"$ref":"#/definitions/User"
},
"coach":{
"$ref":"#/definitions/User"
}
},
"description":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach."
},
"User":{
"type":"object",
"properties":{
"canvas_login_id":{
"type":"string"
}
}
},
"Error":{
"type":"object",
"properties":{
"code":{
"type":"string"
},
"message":{
"type":"string"
}
},
"description":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach."
},
"postApiV1Roles":{
"type":"object",
"properties":{
"coach":{
"type":"object",
"properties":{
"canvas_login_id":{
"type":"string",
"description":"The login_id of the coach as used in canvas"
}
},
"required":[
"canvas_login_id"
]
},
"student":{
"type":"object",
"properties":{
"canvas_login_id":{
"type":"string",
"description":"The login_id of the student as used in canvas"
}
},
"required":[
"canvas_login_id"
]
}
},
"description":"Create a new coaching role. This automatically sets the ended_at to yesterday for the current coach."
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment