tao-test/app/taoLti/doc/rest.json

509 lines
19 KiB
JSON

{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Lti REST API",
"description": "#### The taoLti REST API\nCurrently this API only allows LTI user lookup. See http://www.imsglobal.org/activity/learning-tools-interoperability for more informations about the LTI standard\n"
},
"schemes": [
"https",
"http"
],
"produces": [
"application/json"
],
"basePath": "/",
"tags": [
{
"name": "user",
"description": "Operations about users"
}
],
"paths": {
"/taoLti/RestService/getUserId": {
"get": {
"description": "Allows the caller to lookup the TAO user identifier (in the form of a URI) for a specified LTI consumer user id. As multiple tool consumer could use the same user id, the tool consumer key is required as well.\n\nAvailable since Tao 3.1.\n",
"tags": [
"user"
],
"responses": {
"200": {
"description": "Request was correctly handled, there is an associated user uri.",
"schema": {
"$ref": "#/definitions/response"
},
"examples": {
"application/json": {
"success": true,
"data": {
"id": "http://tao.local/mytao.rdf#xxxxxxxxxxxxx"
},
"version": "3.1.0"
}
}
},
"400": {
"description": "Bad request Error on request sent to API, occurs in case of missing parameter(s)",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "At least one mandatory parameter was required but found missing in your request",
"version": "3.1.0"
}
}
},
"401": {
"description": "Unauthorized Supplied credentials are not valid"
},
"404": {
"description": "Request was correctly handled, but there are no result for the given consumer key or there are no result for the given user id",
"examples": {
"consumer not found": {
"success": false,
"errorCode": 0,
"errorMsg": "No Credentials for consumer key xxxxx",
"version": "3.1.0"
},
"user not found": {
"success": false,
"errorCode": 0,
"errorMsg": "No data found for the given id",
"version": "3.1.0"
}
}
},
"500": {
"description": "Internal error (should not occur)"
}
},
"parameters": [
{
"name": "user_id",
"in": "query",
"description": "LTI user id",
"type": "string",
"required": true
},
{
"name": "oauth_consumer_key",
"in": "query",
"description": "LTI consumer key",
"type": "string",
"required": true
}
],
"security": [
{
"basic_auth": []
}
]
}
},
"/taoLti/RestService/index": {
"post": {
"description": "Create a consumer with given parameters",
"consumes": ["application/x-www-form-urlencoded"],
"tags": [
"consumer"
],
"parameters": [
{
"name": "label",
"in": "formData",
"description": "Label for the new consumer",
"required": true,
"type": "string"
},{
"name": "oauth-key",
"in": "formData",
"description": "OAuth consumer key",
"required": false,
"type": "string"
},{
"name": "oauth-secret",
"in": "formData",
"description": "Oauth consumer secret",
"required": false,
"type": "string"
},
{
"name": "oauth-callback-url",
"in": "formData",
"description": "OAuth consumer callback URL",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"title": "response",
"format": "json",
"type": "object",
"required": [
"success",
"data",
"version"
],
"properties": {
"success": {
"type": "boolean",
"description": "false on failure, true on success"
},
"version": {
"type": "string",
"description": "tao version"
},
"data": {
"$ref": "#/definitions/data"
},
"errorCode": {
"type": "string",
"description": "error code. it appear if success value is false"
},
"errorMsg": {
"type": "string",
"description": "error description. it appear if success value is false"
}
}
},
"examples": {
"application/json": {
"success": true,
"data": {
"uri": [
"http://tao.local/mytao.rdf#xxxxxxxxxxxxx"
]
},
"version": "3.1.0"
}
}
},
"400": {
"description": "Bad request if you send invalid parameters. Test uri is mandatory.",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "At least one mandatory parameter was required but found missing in your request",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"401": {
"description": "Unauthorized",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "You don't have permission to access this resource.",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"500": {
"description": "Internal error, if delivery class label is found multiple times.",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "Exception error description",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
}
}
},
"delete": {
"description": "Delete given consumer by URI",
"tags": [
"consumer"
],
"parameters": [
{
"name": "uri",
"in": "query",
"description": "A valid URI",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"title": "response",
"format": "json",
"type": "object",
"required": [
"success",
"version"
],
"properties": {
"success": {
"type": "boolean",
"description": "false on failure, true on success"
},
"version": {
"type": "string",
"description": "tao version"
},
"errorCode": {
"type": "string",
"description": "error code. it appear if success value is false"
},
"errorMsg": {
"type": "string",
"description": "error description. it appear if success value is false"
}
}
},
"examples": {
"application/json": {
"success": true,
"version": "3.1.0"
}
}
},
"400": {
"description": "Bad request if you send invalid parameters.",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "At least one mandatory parameter was required but found missing in your request",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"401": {
"description": "Unauthorized",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "You are unauthorized.",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"403": {
"description": "Forbidden",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "You don't have permission to access this resource.",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"404": {
"description": "Not found",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "Consumer with given URI has not been found.",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
},
"500": {
"description": "Internal error.",
"examples": {
"application/json": {
"success": false,
"errorCode": 0,
"errorMsg": "Exception error description",
"version": "3.1.0"
}
},
"schema": {
"$ref": "#/definitions/errorModel"
}
}
}
}
},
"/taoLti/Security/jwks": {
"get": {
"description": "Display the public JWKS used on LTI 1.3 communication",
"tags": [
"security"
],
"responses": {
"200": {
"description": "Display JWKS.",
"schema": {
"$ref": "#/definitions/jwks"
}
},
"500": {
"description": "Internal error (should not occur)"
}
}
}
},
"/taoLti/KeyChainGenerator/generate": {
"post": {
"description": "Generate the key chain used on LTI 1.3 communication",
"tags": [
"security", "KeyChain"
],
"responses": {
"200": {
"description": "Acknowledge key chain generation has been successful"
},
"404": {
"description": "Not found (Http verb not implemented)"
},
"500": {
"description": "Internal error (should not occur)"
}
}
}
}
},
"externalDocs": {
"description": "taoLti on Github",
"url": "https://github.com/oat-sa/extension-tao-lti"
},
"securityDefinitions": {
"basic_auth": {
"type": "basic"
}
},
"definitions": {
"response": {
"type": "object",
"required": [
"success",
"version",
"data"
],
"properties": {
"success": {
"type": "boolean"
},
"data": {
"$ref": "#/definitions/payload"
},
"version": {
"type": "string"
}
}
},
"payload": {
"description": "the actual payload",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
},
"errorModel": {
"type": "object",
"description": "contain error",
"required": [
"success",
"version",
"errorCode",
"errorMsg"
],
"properties": {
"success": {
"type": "boolean",
"description": "false on failure",
"default": false
},
"version": {
"type": "string",
"description": "tao version"
},
"errorCode": {
"type": "integer",
"description": "error code"
},
"errorMsg": {
"type": "string",
"description": "error description"
}
}
},
"data": {
"type": "object",
"description": "Generated delivery URI , it appear if success value is true",
"properties": {
"delivery": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"jwks": {
"type": "object",
"properties": {
"keys": {
"type": "array",
"items": {
"$ref": "#/definitions/jwk"
}
}
}
},
"jwk": {
"type": "object",
"properties": {
"kty": {
"type": "string"
},
"e": {
"type": "string"
},
"n": {
"type": "string"
},
"kid": {
"type": "string"
},
"alg": {
"type": "string"
},
"use": {
"type": "string"
}
}
}
}
}