{ "openapi": "3.0.0", "info": { "description": "Incentive Server APIs", "version": 1.1, "title": "Incentive Server APIs", "contact": { "name": "Daniel Izmaylov", "email": "Izmaylov@post.bgu.ac.il" } }, "tags": [ { "name": "incentive", "description": "get information regarding incentives" }, { "name": "enquiry incentives", "description": "issue a complaint regarding an incentive" }, { "name": "Tasks" }, { "name": "Stream" }, { "name": "norms", "description": "post, update and get norms." }, { "name": "badges" }, { "name": "Badges_Issuers", "description": "An Issuer Profile describes a person that awards Open Badges" }, { "name": "Badges_BadgeClass", "description": "A BadgeClass is a type of badge that an Issuer may award over and over (creating many Assertions of that BadgeClass, each for a different recipient)" }, { "name": "Badges_Assertions", "description": "An Assertion is an instance of a BadgeClass that is awarded to one recipient." }, { "name": "Incentive Messages", "description": "A class of Incentive Messages sent after a defined period of general inactivity, in order to motivate users to earn the Badge whose threshold they are closest to reach" } ], "paths": { "/messages/TaskType": { "post": { "tags": [ "Incentive Messages" ], "summary": "Create a new TaskType Incentive Message class", "description": "'message' field, if threshold counting is desired, must include no more than a single '#', to be substituted with the number of tasks left for the next badge. An empty (not sent, '' or None) 'message' field will result in the default message - 'You are # (TaskType)s away from a new badge!'", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskTypeIncentiveMessagePost" } } } }, "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "type": "object", "properties": { "entityId": { "type": "string", "example": "7NAYV0F76K7J1YKJ9C7K57" }, "status_code": { "type": "integer", "example": 201 } } } } } }, "400": { "description": "Validation Error / Missing Field", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "'taskTypeId' and 'app' are required and must be non-null strings" }, "status_code_1": { "type": "integer", "example": 400 }, "message_2": { "type": "string", "example": "'max_repeat and 'frequency' are required and must be positive integers" }, "status_code_2": { "type": "integer", "example": 400 }, "message_3": { "type": "string", "example": "'message' field must be a string and include no more than a single '#' for threshold counting" }, "status_code_3": { "type": "integer", "example": 400 }, "message_4": { "type": "string", "example": "Duplicate Incentive Message POST aborted - existing combination of 'app', 'taskTypeId', 'label' and 'message' fields" }, "status_code_4": { "type": "integer", "example": 400 } } } } } } } } }, "/messages/TaskType/{entityId}": { "put": { "tags": [ "Incentive Messages" ], "summary": "Update an existing TaskType Incentive Message class", "description": "Fill only the fields you wish to update, remove the rest from the request body (or insert None / empty string). TaskType\n Incentive Message cannot be updated into a TaskTransaction\n Incentive Message (label field is irrelevant).", "parameters": [ { "in": "path", "name": "entityId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IncentiveMessagePut" } } } }, "responses": { "200": { "description": "Successfully updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "updatedFields": { "$ref": "#/definitions/IncentiveMessagePut200" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/InvalidField" } } } }, "404": { "description": "Incentive Message not found", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/IncentiveMessageNotFound" } } } } } } }, "/messages/TaskTransaction": { "post": { "tags": [ "Incentive Messages" ], "summary": "Create a new TaskTransaction Incentive Message class", "description": "'message' field, if threshold counting is desired, include no more than a single '#', to be substituted with the number of tasks left for the next badge. An empty (not sent, '' or None) 'message' field will result in the default message - 'You are # (label)s away from a new badge!'", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskTransactionIncentiveMessagePost" } } } }, "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "type": "object", "properties": { "entityId": { "type": "string", "example": "CUOQ62MR8SOSRIDB82QC2H" }, "status_code": { "type": "integer", "example": 201 } } } } } }, "400": { "description": "Validation Error / Missing Field", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "'taskTypeId' and 'app' are required and must be non-null strings" }, "status_code_1": { "type": "integer", "example": 400 }, "message_2": { "type": "string", "example": "'max_repeat and 'frequency' are required and must be positive integers" }, "status_code_2": { "type": "integer", "example": 400 }, "message_3": { "type": "string", "example": "'message' field must be a string and include no more than a single '#' for threshold counting" }, "status_code_3": { "type": "integer", "example": 400 }, "message_4": { "type": "string", "example": "Duplicate Incentive Message POST aborted - existing combination of 'app', 'taskTypeId', 'label' and 'message' fields" }, "status_code_4": { "type": "integer", "example": 400 } } } } } } } } }, "/messages/TaskTransaction/{entityId}": { "put": { "tags": [ "Incentive Messages" ], "summary": "Update an existing TaskTransaction Incentive Message class", "description": "Fill only the fields you wish to update, remove the rest from the request body (or insert None / empty string). TaskTransaction\n Incentive Message cannot be updated into a TaskType\n Incentive Message (empty string / None inserted to the\nlabel field will result in an unchanged label).", "parameters": [ { "in": "path", "name": "entityId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IncentiveMessagePut" } } } }, "responses": { "200": { "description": "Successfully updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "updatedFields": { "$ref": "#/definitions/IncentiveMessagePut200" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/InvalidField" } } } }, "404": { "description": "Incentive Message not found", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/IncentiveMessageNotFound" } } } } } } }, "/messages/TaskType/": { "get": { "tags": [ "Incentive Messages" ], "summary": "Get all Incentive Message classes", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "IncentiveMessage": { "$ref": "#/components/schemas/TaskTypeIncentiveMessageGet" }, "status_code": { "type": "integer", "example": 200 } } } } } } } } } }, "/messages/{entityId}": { "get": { "tags": [ "Incentive Messages" ], "summary": "Get a Incentive Message class", "parameters": [ { "in": "path", "name": "entityId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "IncentiveMessage": { "$ref": "#/components/schemas/TaskTypeIncentiveMessageGet" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "404": { "description": "Incentive Message not found", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/IncentiveMessageNotFound" } } } } } }, "delete": { "tags": [ "Incentive Messages" ], "summary": "Delete a Incentive Message class", "parameters": [ { "in": "path", "name": "entityId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "IncentiveMessage": { "$ref": "#/components/schemas/TaskTypeIncentiveMessageGet" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "404": { "description": "Incentive Message not found", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/definitions/IncentiveMessageNotFound" } } } } } } }, "/norm/apps/{app_id}/users/{user_id}": { "post": { "tags": [ "norms" ], "summary": "adds a user norm", "operationId": "user_norm_update", "description": "adds a user norm.", "parameters": [ { "in": "path", "name": "user_id", "description": "The identifier of the user.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "The added norm.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/norm" } } } }, "responses": { "200": { "description": "norm saved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } }, "400": { "description": "wrong user id.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_user_id" } } } } } }, "get": { "tags": [ "norms" ], "summary": "get the user norms", "operationId": "get_user_norms", "description": "get the user norms", "parameters": [ { "in": "path", "name": "user_id", "description": "The identifier of the user.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/norms" } } } } }, "400": { "description": "wrong user id.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_user_id" } } } } } } }, "/Tasks/TaskTypeStatus": { "post": { "tags": [ "Tasks" ], "summary": "Post data about an event of a TaskType", "description": "Without label field.", "operationId": "Post Data the task status", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/taskType_status_body" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/task_status_200" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/Tasks/TaskTransactionStatus": { "post": { "tags": [ "Tasks" ], "summary": "Post data about an event of a TaskTransaction", "description": "With label field. if label is removed - the event counts as of a TaskType.", "operationId": "Post Data the task transaction status", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/taskTransaction_status_body" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/task_status_200" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/Stream/locationevent": { "post": { "tags": [ "Stream" ], "summary": "Post stream data I-log location", "operationId": "Post stream data I-log location", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/locationevent" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/locationevent" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/Stream/SocialRelation": { "post": { "tags": [ "Stream" ], "summary": "Post stream data I-log SocialRelation", "operationId": "Post stream data I-log SocialRelation", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/socialrelations" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/socialrelations" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/Stream/touchevent": { "post": { "tags": [ "Stream" ], "summary": "Post stream data I-log touchevent", "operationId": "Post stream data I-log touchevent", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/touchevent" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/touchevent" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/Stream/TimeDiariesAnswers": { "post": { "tags": [ "Stream" ], "summary": "Post stream data I-log TimeDiariesAnswers", "operationId": "Post stream data I-log TimeDiariesAnswers", "requestBody": { "description": "The request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/timediariesanswers" } } } }, "responses": { "200": { "description": "successfuly post", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/timediariesanswers" } } } }, "400": { "description": "BAD REQUEST", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BAD_REQUEST" } } } } } } }, "/norm/apps/{app_id}community/{community_id}": { "post": { "tags": [ "norms" ], "summary": "adds a community norm", "operationId": "community_norm_update", "description": "adds a community norm", "parameters": [ { "in": "path", "name": "community_id", "description": "The identifier of the community.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "norm saved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } }, "400": { "description": "wrong community_id parameter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_community_id" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/norm" } } }, "description": "norm to add" } }, "get": { "tags": [ "norms" ], "summary": "get the community norms", "operationId": "get_community_norms", "description": "get the community norms", "parameters": [ { "in": "path", "name": "community_id", "description": "The identifier of the community.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/norms" } } } } }, "400": { "description": "wrong community_id parameter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_community_id" } } } } } } }, "/norm/apps/{app_id}": { "post": { "tags": [ "norms" ], "summary": "Adds a general norm", "operationId": "general_norm_update", "description": "adds an general norm", "parameters": [ { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/norm" } } } }, "responses": { "200": { "description": "norm saved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } } } }, "get": { "tags": [ "norms" ], "summary": "get a general norm", "operationId": "get_general_norm", "description": "get a general norm", "parameters": [ { "in": "header", "name": "norm_id", "description": "The identifier of the norm.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/norm" } } } } }, "400": { "description": "wrong community id.", "content": { "application/json": { "examples": { "Default Response": { "value": { "code": 125, "message": "wrong norm id" } } } } } } } } }, "/norms/apps/{app_id}/{norm_id}": { "put": { "tags": [ "norms" ], "summary": "Update the values by norm ID", "description": "Update a norm by id.", "operationId": "update_norm", "parameters": [ { "name": "norm_id", "in": "path", "description": "The identifier of the norm", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/norm" } } } }, "responses": { "200": { "description": "The updated community", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/norm" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/norm" } } } }, "400": { "description": "wrong norm id.", "content": { "application/json": { "examples": { "Default Response": { "value": { "code": 125, "message": "wrong norm id" } } } } } } } }, "get": { "tags": [ "norms" ], "summary": "get norm by id.", "operationId": "get_norm", "description": "get norm by id.", "parameters": [ { "in": "path", "name": "norm_id", "description": "The identifier of the norm.", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The identifier of the app.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/norm" } } } } }, "400": { "description": "wrong norm id.", "content": { "application/json": { "examples": { "Default Response": { "value": { "code": 125, "message": "wrong norm id" } } } } } } } } }, "/incentive/apps/{app_id}/community/{community_id}": { "get": { "tags": [ "incentive" ], "summary": "searches for all incentive infos of a community of users", "operationId": "community_incentive", "description": "searches for a community of users of a specific application and returns incentive information of the users.\n", "parameters": [ { "in": "path", "name": "community_id", "description": "the community id to search", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "the app that the user pagination", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/incentive_info_user" } } } }, "400": { "description": "wrong community_id parameter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_community_id" } } } }, "401": { "description": "wrong app_id parameter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_app_id" } } } } } } }, "/incentive/apps/{app_id}/users/{user_id}": { "get": { "tags": [ "incentive" ], "summary": "searches for user incentive info", "operationId": "user_incentive", "description": "searches for a user of a specific application and returns incentive information of that user.\n", "parameters": [ { "in": "path", "name": "user_id", "description": "the user id to search", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "the app that the user pagination", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful search", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/incentive_info_user" } } } }, "400": { "description": "wrong user_id.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_user_id" } } } }, "401": { "description": "wrong app_id.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/wrong_app_id" } } } } } } }, "/incentive/disable_incentive": { "post": { "tags": [ "incentive" ], "summary": "Disable the incentive server", "operationId": "disable_incentive", "requestBody": { "description": "The request body for disabling the incentive server", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/disable_incentive" } } } }, "description": "Disable the incentive server\n", "responses": { "200": { "description": "successfuly disabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } }, "403": { "description": "The server is already disabled" }, "404": { "description": "Reason not found" } } } }, "/enquiry_incentives/app/{app_id}/users/{user_id}": { "post": { "tags": [ "enquiry incentives" ], "summary": "submit complaint", "operationId": "enquiry_incentives", "parameters": [ { "in": "path", "name": "user_id", "description": "The user id that issue complaint", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "app_id", "description": "The app id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "The added norm.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/complaint" } } } }, "responses": { "200": { "description": "submit completed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } }, "404": { "description": "Content not found" } } } }, "/incentive/enable_incentive": { "post": { "tags": [ "incentive" ], "summary": "enable the incentive server", "operationId": "enable_incentive", "requestBody": { "description": "The request body for enabling the incentive server", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enable_incentive" } } } }, "description": "Enable the incentive server\n", "responses": { "200": { "description": "successfuly enabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/successful_operation" } } } }, "403": { "description": "The server is already enabled" }, "404": { "description": "Reason not found" } } } }, "/badges/apps/{app_id}": { "get": { "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "app_id", "in": "path" } ], "summary": "Get all badges for a specific app", "tags": [ "badges" ], "description": "Get all available badges for a specific app.\n", "responses": { "200": { "description": "success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/badges" } } } } } } }, "/badges/issuers": { "post": { "security": [ { "oauth2": [ "rw:issuer" ] } ], "summary": "Create a new Issuer", "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "$ref": "#/definitions/Issuer" } } } }, "400": { "description": "Validation error" } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/definitions/Issuer" } } } }, "tags": [ "Badges_Issuers" ] } }, "/badges/BadgeClasses/TaskType": { "post": { "security": [ { "oauth2": [ "rw:issuer" ] } ], "summary": "Create a new TaskTypeBadgeClass", "description": "A BadgeClass associated with a TaskType. no label field", "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "type": "object", "properties": { "entityId": { "type": "string", "example": "ONeLMeSsTXae-x9RIfJbmA" }, "status_code": { "type": "integer", "example": 201 } } } } } }, "400": { "description": "Validation Error / Missing Field", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "app, taskTypeId, description and message are required and must be non-null strings" }, "status_code_1": { "type": "integer", "example": 400 }, "message_2": { "type": "string", "example": "threshold is required and must to be a positive integer" }, "status_code_2": { "type": "integer", "example": 400 }, "message_3": { "type": "string", "example": "Invalid image (incompatible with badgr server)" }, "status_code_3": { "type": "integer", "example": 400 }, "message_4": { "type": "string", "example": "Duplicate BadgeClass POST aborted - existing name or existing taskTypeId, label and threshold combination" }, "status_code_4": { "type": "integer", "example": 400 } } } } } }, "403": { "description": "Invalid URL - either broken or not HTTPS", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "An invalid URL was posted" }, "status_code_1": { "type": "integer", "example": 403 }, "message_2": { "type": "string", "example": "Only HTTPS URLs are allowed" }, "status_code_2": { "type": "integer", "example": 403 }, "message_3": { "type": "string", "example": "URL must end with .png or .svg" }, "status_code_3": { "type": "integer", "example": 403 }, "message_4": { "type": "string", "example": "URL not found" }, "status_code_4": { "type": "integer", "example": 403 } } } } } }, "413": { "description": "Request Entity Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Uploaded image is too large" }, "status_code": { "type": "integer", "example": 413 } } } } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "Twelve Answers" }, "description": { "type": "string", "example": "awarded after answering 12 questions" }, "message": { "type": "string", "example": "Way to go! You have answered 12 questions!" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "threshold": { "type": "integer", "example": 12 }, "image": { "type": "string", "example": "https://wenetbadgesimages.s3.amazonaws.com/curious_level_1.png", "format": "url" }, "app": { "type": "string", "example": "I2AFRCOXx3" } } } } } }, "tags": [ "Badges_BadgeClass" ] } }, "/badges/BadgeClasses/TaskType/{entityId}": { "put": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Update an existing TaskTypeBadgeClass. Previously issued assertions will NOT be updated", "description": "Fill only the fields you wish to update, remove the rest from the request body (or insert None / empty string). TaskTypeBadgeClass cannot be updated into a TaskTransactionBadgeClass (label field is irrelevant).", "responses": { "200": { "description": "Successfully updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "updatedFields": { "properties": { "app": { "type": "string", "example": "I2AFRCOXx4" }, "name": { "type": "string", "example": "Thirteen Accepted Answers" }, "description": { "type": "string", "example": "awarded after 13 answers were accepted" }, "message": { "type": "string", "example": "Your answers were accepted for 13 questions!" }, "taskTypeId": { "type": "string", "example": "ask5help" }, "threshold": { "type": "integer", "example": 13 } } }, "status_code": { "type": "integer", "example": 200 } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Validation Error - Invalid field in body request: {field}" }, "status_code": { "type": "integer", "example": 400 } } } } } }, "404": { "description": "BadgeClass not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "BadgeClass not found - Invalid entityId" }, "status_code": { "type": "integer", "example": 404 } } } } } }, "413": { "description": "Request Entity Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Uploaded image is too large" }, "status_code": { "type": "integer", "example": 413 } } } } } } }, "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "app": { "type": "string", "example": "I2AFRCOXx4" }, "name": { "type": "string", "example": "Thirteen Accepted Answers" }, "description": { "type": "string", "example": "awarded after 13 answers were accepted" }, "message": { "type": "string", "example": "Your answers were accepted for 13 questions!" }, "taskTypeId": { "type": "string", "example": "ask5help" }, "threshold": { "type": "integer", "example": 13 }, "image": { "type": "string", "example": null, "format": "url" } } } } } }, "tags": [ "Badges_BadgeClass" ] } }, "/badges/BadgeClasses/TaskTransaction": { "post": { "security": [ { "oauth2": [ "rw:issuer" ] } ], "summary": "Create a new TaskTransactionBadgeClass", "description": "A BadgeClass associated with a TaskTransaction. if label field inserted as None or an empty string - A TaskTypeBadgeClass will be posted.", "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "type": "object", "properties": { "entityId": { "type": "string", "example": "ONeLMeSsTXae-x9RIfJbmA" }, "status_code": { "type": "integer", "example": 201 } } } } } }, "400": { "description": "Validation Error / Missing Field", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "app, taskTypeId, description and message are required and must be non-null strings" }, "status_code_1": { "type": "integer", "example": 400 }, "message_2": { "type": "string", "example": "threshold is required and must to be a positive integer" }, "status_code_2": { "type": "integer", "example": 400 }, "message_3": { "type": "string", "example": "Invalid image (incompatible with badgr server)" }, "status_code_3": { "type": "integer", "example": 400 }, "message_4": { "type": "string", "example": "Duplicate BadgeClass POST aborted - existing name or existing taskTypeId, label and threshold combination" }, "status_code_4": { "type": "integer", "example": 400 } } } } } }, "403": { "description": "Invalid URL - either broken or not HTTPS", "content": { "application/json": { "schema": { "type": "object", "properties": { "message_1": { "type": "string", "example": "An invalid URL was posted" }, "status_code_1": { "type": "integer", "example": 403 }, "message_2": { "type": "string", "example": "Only HTTPS URLs are allowed" }, "status_code_2": { "type": "integer", "example": 403 }, "message_3": { "type": "string", "example": "URL must end with .png or .svg" }, "status_code_3": { "type": "integer", "example": 403 }, "message_4": { "type": "string", "example": "URL not found" }, "status_code_4": { "type": "integer", "example": 403 } } } } } }, "413": { "description": "Request Entity Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Uploaded image is too large" }, "status_code": { "type": "integer", "example": 413 } } } } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "Twelve Answers" }, "description": { "type": "string", "example": "awarded after answering 12 questions" }, "message": { "type": "string", "example": "Way to go! You have answered 12 questions!" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "label": { "type": "string", "example": "answerTransaction" }, "threshold": { "type": "integer", "example": 12 }, "image": { "type": "string", "example": "https://wenetbadgesimages.s3.amazonaws.com/curious_level_1.png", "format": "url" }, "app": { "type": "string", "example": "I2AFRCOXx3" } } } } } }, "tags": [ "Badges_BadgeClass" ] } }, "/badges/BadgeClasses/TaskTransaction/{entityId}": { "put": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Update an existing TaskTransactionBadgeClass. Previously issued assertions will NOT be updated", "description": "Fill only the fields you wish to update, remove the rest from the request body (or insert None / empty string). TaskTransactionBadgeClass cannot be updated into a TaskTypeBadgeClass (empty string / None inserted to the label field will result in an unchanged label).", "responses": { "200": { "description": "Successfully updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "updatedFields": { "properties": { "app": { "type": "string", "example": "I2AFRCOXx4" }, "name": { "type": "string", "example": "Thirteen Accepted Answers" }, "description": { "type": "string", "example": "awarded after 13 answers were accepted" }, "message": { "type": "string", "example": "Your answers were accepted for 13 questions!" }, "taskTypeId": { "type": "string", "example": "ask5help" }, "label": { "type": "string", "example": "AnswersPickedMessage" }, "threshold": { "type": "integer", "example": 13 } } }, "status_code": { "type": "integer", "example": 200 } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Validation Error - Invalid field in body request: {field}" }, "status_code": { "type": "integer", "example": 400 } } } } } }, "404": { "description": "BadgeClass not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "BadgeClass not found - Invalid entityId" }, "status_code": { "type": "integer", "example": 404 } } } } } }, "413": { "description": "Request Entity Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Uploaded image is too large" }, "status_code": { "type": "integer", "example": 413 } } } } } } }, "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "app": { "type": "string", "example": "I2AFRCOXx4" }, "name": { "type": "string", "example": "Thirteen Accepted Answers" }, "description": { "type": "string", "example": "awarded after 13 answers were accepted" }, "message": { "type": "string", "example": "Your answers were accepted for 13 questions!" }, "taskTypeId": { "type": "string", "example": "ask5help" }, "label": { "type": "string", "example": "AnswersPickedMessage" }, "threshold": { "type": "integer", "example": 13 }, "image": { "type": "string", "example": null, "format": "url" } } } } } }, "tags": [ "Badges_BadgeClass" ] } }, "/badges/BadgeClasses/": { "get": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Get all available badges", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "badge": { "$ref": "#/definitions/BadgeClass" }, "status_code": { "type": "integer", "example": 200 } } } } } } } }, "tags": [ "Badges_BadgeClass", null ] } }, "/badges/BadgeClasses/{entityId}": { "get": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Get a BadgeClass", "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "badge": { "$ref": "#/definitions/BadgeClass" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "404": { "description": "BadgeClass not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "BadgeClass not found - Invalid entityId" }, "status_code": { "type": "integer", "example": 404 } } } } } } }, "tags": [ "Badges_BadgeClass" ] }, "delete": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Delete a BadgeClass and all its assertions (instances)", "description": "Note: assertions (badge instances) of deleted BadgeClasses will be revoked.", "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "in": "path" } ], "responses": { "200": { "description": "Successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "badge": { "$ref": "#/definitions/BadgeClass" }, "status_code": { "type": "integer", "example": 200 } } } } } }, "404": { "description": "BadgeClass not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "BadgeClass not found - Invalid entityId" }, "status_code": { "type": "integer", "example": 404 } } } } } } }, "tags": [ "Badges_BadgeClass" ] } }, "/badges/BadgeClasses/{entityId}/assertions": { "post": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Issue an Assertion to a single recipient", "responses": { "201": { "description": "Successfully created", "content": { "application/json": { "schema": { "$ref": "#/definitions/Assertion" } } } }, "400": { "description": "Validation error" } }, "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "description": "BadgeClass entityId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/definitions/Assertion" } } } }, "tags": [ "Badges_Assertions" ] }, "get": { "security": [ { "oauth2": [ "rw:issuer", "rw:issuer:*" ] } ], "summary": "Get a list of Assertions for a single BadgeClass", "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "items": { "$ref": "#/definitions/Assertion" }, "type": "array" } } } } }, "parameters": [ { "required": true, "schema": { "type": "string" }, "name": "entityId", "in": "path" }, { "description": "A recipient identifier to filter by", "schema": { "type": "string" }, "name": "recipient", "in": "query" }, { "description": "Request pagination of results", "schema": { "type": "string" }, "name": "num", "in": "query" } ], "tags": [ "Badges_Assertions" ] } } }, "components": { "schemas": { "badges": { "properties": { "badges": { "type": "array", "items": { "properties": { "id": { "type": "string", "example": "1Wr05MLcT82mD_jkEelH3w" }, "name": { "type": "string", "example": "Twelve Answers" }, "description": { "type": "string", "example": "awarded after answering 12 questions" }, "message": { "type": "string", "example": "Way to go! You have answered 12 questions!" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "label": { "type": "string", "example": "answerTransaction" }, "threshold": { "type": "integer", "example": 12 }, "createdAt": { "type": "string", "example": "2021-02-15T14:57:37.696791Z" }, "image": { "type": "string", "example": "https://wenetbadgesimages.s3.amazonaws.com/first_question.png" } } } }, "status_code": { "type": "integer", "example": 200 } } }, "successful_operation": { "type": "object", "properties": { "message_id": { "type": "integer", "example": 145 }, "message": { "type": "string", "example": "successful operation" } } }, "BAD_REQUEST": { "type": "object", "properties": { "field": { "type": "string", "example": "the field X is required" } } }, "touchevent": { "type": "object", "properties": { "touchevent": { "type": "object", "properties": { "experimentId": { "type": "string", "example": "wenetTest" }, "userid": { "type": "string", "example": 1 }, "timestamp": { "type": "string", "example": 2020052105142943 }, "day": { "type": "string", "example": 20200521 } } } } }, "timediariesanswers": { "type": "object", "properties": { "timediariesanswers": { "type": "object", "properties": { "experimentId": { "type": "string", "example": "wenetTest" }, "userId": { "type": "string", "example": 1 }, "instanceid": { "type": "string", "example": "instance26141" }, "instancetimestamp": { "type": "string", "example": 20200525221719000 }, "notificationtimestamp": { "type": "string", "example": 20200525221719000 }, "answertimestamp": { "type": "string", "example": 20200525221719000 }, "delta": { "type": "integer", "format": "int32", "example": 6141 }, "answerduration": { "type": "integer", "format": "int32", "example": 550 }, "answer": { "type": "array", "items": { "type": "array", "items": { "type": "object", "properties": { "cnt": { "type": "string", "example": "reading" }, "qid": { "type": "integer", "format": "int32", "example": 1 }, "aid": { "type": "integer", "format": "int32", "example": 4 }, "cid": { "type": "integer", "format": "int32", "example": 3405 } } } } }, "payload": { "type": "array", "items": { "type": "object", "properties": { "payload": { "type": "object", "properties": null }, "qid": { "type": "string", "example": 1 } } } }, "day": { "type": "string", "example": 20200525 } } } } }, "socialrelations": { "type": "object", "properties": { "socialrelations": { "type": "object", "properties": { "experimentid": { "type": "string", "example": "wenetTest" }, "userid": { "type": "string", "example": 1 }, "day": { "type": "string", "example": 20200521 }, "timestamp": { "type": "string", "example": 202004212357000 }, "source": { "type": "string", "example": "twitter" }, "content": { "type": "object", "properties": { "eventtype": { "type": "string", "example": "follows" }, "value": { "type": "string", "example": 1 }, "userdestinationid": { "type": "string", "example": 8 } } } } } } }, "locationevent": { "type": "object", "properties": { "locationeventpertime": { "type": "object", "properties": { "experimentId": { "type": "string", "example": "wenetTest" }, "userid": { "type": "string", "example": 1 }, "timestamp": { "type": "string", "example": 201908252357000 }, "day": { "type": "string", "example": 20190825 }, "accuracy": { "type": "number", "example": 23.2 }, "lucene": { "type": "string", "example": "lucene" }, "provider": { "type": "string", "example": "gps" }, "speed": { "type": "number", "example": 2.3 }, "point": { "type": "object", "properties": { "latitude": { "type": "number", "example": 22.1492 }, "longitude": { "type": "number", "example": -101.03609 }, "altitude": { "type": "number", "example": 1845.29208 } } } } } } }, "TaskTypeIncentiveMessagePost": { "type": "object", "properties": { "taskTypeId": { "type": "string", "example": "ask4help" }, "max_repeat": { "type": "integer", "example": 6 }, "frequency": { "type": "integer", "example": 2 }, "inactivity_period": { "type": "integer", "example": 1 }, "app": { "type": "string", "example": "xAcauSmrhd" }, "message": { "type": "string", "example": "you are # Questions away from a new badge!" } }, "required": [ "taskTypeId", "max_repeat", "frequency", "inactivity_period", "app" ] }, "TaskTransactionIncentiveMessagePost": { "type": "object", "properties": { "taskTypeId": { "type": "string", "example": "ask4help" }, "label": { "type": "string", "example": "answerTransaction" }, "max_repeat": { "type": "integer", "example": 6 }, "frequency": { "type": "integer", "example": 2 }, "inactivity_period": { "type": "integer", "example": 1 }, "app": { "type": "string", "example": "xAcauSmrhd" }, "message": { "type": "string", "example": "you are # Answers away from a new badge!" } }, "required": [ "taskTypeId", "label", "max_repeat", "frequency", "inactivity_period", "app" ] }, "IncentiveMessagePut": { "type": "object", "properties": { "taskTypeId": { "type": "string", "example": "ask5help" }, "label": { "type": "string", "example": null }, "max_repeat": { "type": "integer", "example": null }, "frequency": { "type": "integer", "example": 3 }, "inactivity_period": { "type": "integer", "example": null }, "app": { "type": "string", "example": "I2AFRCOXx3" }, "message": { "type": "string", "example": null } } }, "TaskTypeIncentiveMessageGet": { "type": "object", "properties": { "createdAt": { "type": "string", "example": "2021-08-22T06:55:44.509Z" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "max_repeat": { "type": "integer", "example": 6 }, "frequency": { "type": "integer", "example": 2 }, "inactivity_period": { "type": "integer", "example": 1 }, "app": { "type": "string", "example": "xAcauSmrhd" }, "message": { "type": "string", "example": "you are # Questions away from a new badge!" } } }, "taskType_status_body": { "type": "object", "properties": { "user_id": { "type": "string", "example": "WeNet_user5" }, "community_id": { "type": "string", "example": "WeNet_community_5" }, "app_id": { "type": "string", "example": "xAcauSmrhd" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "count": { "type": "integer", "example": 10 } }, "required": [ "user_id", "app_id", "taskTypeId", "count" ] }, "taskTransaction_status_body": { "type": "object", "properties": { "user_id": { "type": "string", "example": "WeNet_user5" }, "community_id": { "type": "string", "example": "WeNet_community_5" }, "app_id": { "type": "string", "example": "xAcauSmrhd" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "label": { "type": "string", "example": "answerTransaction" }, "count": { "type": "integer", "example": 10 } }, "required": [ "user_id", "app_id", "taskTypeId", "count" ] }, "task_status_200": { "type": "object", "properties": { "message_1": { "type": "string", "example": "No badges to issue" }, "status_code_1": { "type": "integer", "example": 200 }, "message_2": { "type": "string", "example": "The user already owns this badge" }, "status_code_2": { "type": "integer", "example": 200 }, "message_3": { "type": "object", "properties": { "status": { "type": "object", "properties": { "description": { "type": "string", "example": "ok" }, "success": { "type": "boolean", "example": true } } }, "result": { "type": "array", "items": { "type": "object", "properties": { "entityType": { "type": "string", "example": "Assertion" }, "entityId": { "type": "string", "example": "CKQgqOjqTSid5FP9R57OxQ" }, "openBadgeId": { "type": "string", "example": "http://127.0.0.1:8000/dev/badgr/public/assertions/vrpwWb-RRtqRbo7cADKGBg" }, "createdAt": { "type": "string", "example": "2021-07-20T09:41:20.618733Z" }, "createdBy": { "type": "string", "example": "R7Kk2wD3RJaNLVIjqckQWw" }, "badgeclass": { "type": "string", "example": "HxBhPyVDTHiRu2S_ylZ-sA" }, "badgeclassOpenBadgeId": { "type": "string", "example": "http://127.0.0.1:8000/dev/badgr/public/badges/3gWrry4kRSqiJ2GcHDN-Qg" }, "issuer": { "type": "string", "example": "mT7hgXVkQMShRxRWIusVSg" }, "issuerOpenBadgeId": { "type": "string", "example": "http://127.0.0.1:8000/dev/badgr/public/issuers/mT7hgXVkQMShRxRWIusVSg" }, "image": { "type": "string", "example": "http://nginx:8000/dev/badgr/media/uploads/badges/assertion-vrpwWb-RRtqRbo7cADKGBg.png" }, "recipient": { "type": "object", "properties": { "identity": { "type": "string", "example": "sha256$087723329e19d8fae832b375a32780dcbebac95220e71c82c6243354b8ed6ec2" }, "hashed": { "type": "boolean", "example": true }, "type": { "type": "string", "example": "email" }, "plaintextidentity": { "type": "string", "example": "pku@create.aau.dk" }, "salt": { "type": "string", "example": "c75e5191397549a4bde3ef328541c58b" } } }, "issuedOn": { "type": "string", "example": "2021-07-20T09:41:20.611001Z" }, "narrative": { "type": "string", "example": null }, "evidence": { "type": "array", "items": { "type": "string", "example": [] } }, "revoked": { "type": "boolean", "example": false }, "revocationReason": { "type": "string", "example": null }, "expires": { "type": "string", "example": null }, "extensions": { "type": "object" } } } } } } } }, "wrong_community_id": { "type": "object", "properties": { "message_id": { "type": "integer", "example": 12345 }, "message": { "type": "string", "example": "wrong community id" } } }, "wrong_user_id": { "type": "object", "properties": { "message_id": { "type": "integer", "example": 12345 }, "message": { "type": "string", "example": "wrong user id" } } }, "wrong_app_id": { "type": "object", "properties": { "message_id": { "type": "integer", "example": 125 }, "message": { "type": "string", "example": "wrong app id" } } }, "NormOperator": { "type": "string", "description": "The operator of the norm", "enum": [ "EQUALS", "LESS_THAN", "GREATER_THAN", "LESS_EQ_THAN", "GREATER_EQ_THAN" ] }, "norm": { "type": "object", "properties": { "id": { "type": "string", "description": "The identifier of the norm", "example": "15837028-645a-4a55-9aaf-ceb846439eba", "readOnly": true }, "attribute": { "type": "string", "description": "The name of the attribute whose value the norm should be compared to", "example": "has_car" }, "operator": { "$ref": "#/components/schemas/NormOperator" }, "comparison": { "type": "string", "description": "The norm value for the comparison", "example": true }, "nagation": { "type": "boolean", "description": "Specified if a negation operator should be applied", "example": true, "default": true } } }, "disable_incentive": { "type": "object", "properties": { "reason": { "type": "string", "description": "The reason for disabling the incentive server", "example": "good justify for disabling" } }, "required": [ "reason" ] }, "enable_incentive": { "type": "object", "properties": { "reason": { "type": "string", "description": "The reason for enabling the incentive server", "example": "good justify for enabling" } }, "required": [ "reason" ] }, "complaint": { "type": "object", "properties": { "content": { "type": "string", "description": "The content of the complaint", "example": "the incentive was inappropriate" }, "incentive": { "type": "string", "description": "The content of the regard incentive" } }, "required": [ "content" ] }, "norms": { "type": "object", "properties": { "norms": { "type": "array", "items": { "$ref": "#/components/schemas/norm" } } } }, "u_norm": { "type": "object", "properties": { "norm_id": { "type": "string", "example": 6687483 }, "Location": { "type": "string", "example": "Europe" }, "Type": { "type": "string", "example": "message" }, "Size": { "type": "integer", "example": 128 }, "frequncy": { "type": "integer", "example": 500 }, "channel": { "type": "string", "example": "web" } } }, "incentive_info_user": { "properties": { "app_id": { "type": "string", "example": "GnYi1gZEcv" }, "incentives": { "properties": { "badges": { "type": "array", "items": { "$ref": "#/components/schemas/badges" } }, "messages": { "type": "array", "items": { "type": "object", "properties": { "message_content": { "type": "string", "example": "greatjob" } } } } } } } }, "incentive_info_community": { "type": "object", "required": [ "user_id", "incentive_type", "incentive_quantity" ], "properties": { "community_id": { "type": "integer", "example": 12345 }, "incentive_type": { "type": "integer", "example": 2 }, "incentive_quantity": { "type": "number", "format": "float", "example": 0.89 } } } } }, "definitions": { "AccessToken": { "required": [ "token", "issuer", "expires" ], "properties": { "token": { "type": "string", "format": "CharField" }, "issuer": { "type": "string", "format": "CharField" }, "expires": { "type": "string", "format": "DateTimeField" } } }, "Assertion": { "required": [ "recipient" ], "properties": { "entityType": { "type": "string", "description": "\"Assertion\"", "format": "string" }, "entityId": { "type": "string", "description": "Unique identifier for this Assertion", "format": "string" }, "openBadgeId": { "type": "string", "description": "URL of the OpenBadge compliant json", "format": "url" }, "createdAt": { "type": "string", "description": "Timestamp when the Assertion was created", "format": "ISO8601 timestamp" }, "createdBy": { "type": "string", "description": "BadgeUser who created the Assertion", "format": "entityId" }, "BadgeClass": { "type": "string", "description": "BadgeClass that issued this Assertion", "format": "entityId" }, "badgeclassOpenBadgeId": { "type": "string", "description": "URL of the BadgeClass to award", "format": "url" }, "issuer": { "type": "string", "format": "EntityRelatedFieldV2" }, "issuerOpenBadgeId": { "type": "string", "format": "URLField" }, "image": { "type": "string", "description": "URL to the baked assertion image", "format": "url" }, "recipient": { "type": "object", "properties": { "identity": { "type": "string", "description": "Either the hash of the identity or the plaintext value", "format": "string" }, "type": { "enum": [ "email", "openBadgeId", "telephone", "url" ], "type": "string", "description": "Type of identifier used to identify recipient" }, "hashed": { "type": "boolean", "description": "Whether or not the identity value is hashed." }, "plaintextIdentity": { "type": "string", "description": "The plaintext identity" } }, "description": "Recipient that was issued the Assertion" }, "issuedOn": { "type": "string", "description": "Timestamp when the Assertion was issued", "format": "ISO8601 timestamp" }, "narrative": { "type": "string", "description": "Markdown narrative of the achievement", "format": "markdown" }, "evidence": { "items": { "$ref": "#/definitions/AssertionEvidence" }, "type": "array", "description": "List of evidence associated with the achievement" }, "revoked": { "type": "boolean", "description": "True if this Assertion has been revoked" }, "revocationReason": { "type": "string", "description": "Short description of why the Assertion was revoked", "format": "string" }, "expires": { "type": "string", "description": "Timestamp when the Assertion expires", "format": "ISO8601 timestamp" }, "extensions": { "type": "string", "format": "DictField" }, "badgeclassName": { "type": "string", "description": "Name of BadgeClass to create assertion against, case insensitive", "format": "string" } } }, "AssertionEvidence": { "required": [], "properties": { "url": { "type": "string", "description": "URL of a webpage presenting evidence of the achievement", "format": "url" }, "narrative": { "type": "string", "description": "Markdown narrative that describes the achievement", "format": "markdown" } } }, "IncentiveMessagePut200": { "properties": { "taskTypeId": { "type": "string", "example": "ask5help" }, "frequency": { "type": "integer", "example": 3 }, "app": { "type": "string", "example": "I2AFRCOXx3" } } }, "InvalidField": { "properties": { "message_1": { "type": "string", "example": "Validation Error - Invalid field in body request: {field}" }, "status_code_1": { "type": "integer", "example": 400 }, "message_2": { "type": "string", "example": "Validation Error - 'message' field must be a string and include no more than a single '#' for threshold counting" }, "status_code_2": { "type": "integer", "example": 400 }, "message_3": { "type": "string", "example": "TaskTypIncentiveMessage cannot be altered into a TaskTransactionIncentiveMessage" }, "status_code_3": { "type": "integer", "example": 400 }, "message_4": { "type": "string", "example": "TaskTransactionIncentiveMessage cannot be altered into a TaskTypeIncentiveMessage" }, "status_code_4": { "type": "integer", "example": 400 } } }, "IncentiveMessageNotFound": { "properties": { "message": { "type": "string", "example": "Incentive Message not found - Invalid entityId" }, "status_code": { "type": "integer", "example": 404 } } }, "BadgeClass_put": { "properties": { "app": { "type": "string", "example": "I2AFRCOXx4" }, "name": { "type": "string", "example": "Thirteen Answers" }, "description": { "type": "string", "example": "Way to go! You have answered 13 questions!" }, "threshold": { "type": "integer", "example": 13 }, "image": { "type": "string", "example": null, "format": "url" } } }, "BadgeClass": { "required": [ "app", "name", "description", "taskTypeId", "threshold", "image" ], "properties": { "id": { "type": "string", "example": "3tWqCjUNTEqs2jldvjM7Lg" }, "name": { "type": "string", "example": "Twelve Answers" }, "description": { "type": "string", "example": "Way to go! You have answered 12 questions!" }, "taskTypeId": { "type": "string", "example": "ask4help" }, "label": { "type": "string", "example": "answerTransaction" }, "threshold": { "type": "integer", "example": 12 }, "createdAt": { "type": "string", "example": "2021-02-15T14:57:37.696791Z" }, "image": { "type": "string", "example": "https://wenetbadgesimages.s3.amazonaws.com/curious_level_1.png", "format": "url" }, "app": { "type": "string", "example": "I2AFRCOXx3" } } }, "BadgeClassAlignment": { "required": [ "targetName", "targetUrl" ], "properties": { "targetName": { "type": "string", "format": "StripTagsCharField" }, "targetUrl": { "type": "string", "format": "URLField" }, "targetDescription": { "type": "string", "format": "StripTagsCharField" }, "targetFramework": { "type": "string", "format": "StripTagsCharField" }, "targetCode": { "type": "string", "format": "StripTagsCharField" } } }, "BadgeClassExpiration": { "required": [ "amount", "duration" ], "properties": { "amount": { "type": "string", "format": "IntegerField" }, "duration": { "type": "string", "format": "ChoiceField" } } }, "BadgeUser": { "required": [ "firstName", "lastName" ], "properties": { "entityType": { "type": "string", "description": "\"BadgeUser\"", "format": "string" }, "entityId": { "type": "string", "description": "Unique identifier for this BadgeUser", "format": "string" }, "firstName": { "type": "string", "description": "Given name", "format": "string" }, "lastName": { "type": "string", "description": "Family name", "format": "string" }, "emails": { "items": { "$ref": "#/definitions/BadgeUserEmail" }, "type": "array" }, "url": { "type": "string", "format": "ListField" }, "telephone": { "type": "string", "format": "ListField" }, "agreedTermsVersion": { "type": "string", "format": "IntegerField" }, "marketingOptIn": { "type": "string", "format": "BooleanField" }, "badgrDomain": { "type": "string", "format": "CharField" }, "hasPasswordSet": { "type": "string", "format": "SerializerMethodField" } } }, "BadgeUserEmail": { "required": [ "email" ], "properties": { "entityType": { "type": "string", "format": "CharField" }, "entityId": { "type": "string", "format": "CharField" }, "email": { "type": "string", "description": "Email address associated with a BadgeUser", "format": "email" }, "verified": { "type": "boolean", "description": "True if the email address has been verified" }, "primary": { "type": "boolean", "description": "True for a single email address to receive email notifications" } } }, "BadgeUserToken": { "required": [], "properties": { "token": { "type": "string", "description": "Access token to use in the Authorization header", "format": "string" } } }, "Collection": { "required": [ "name" ], "properties": { "entityType": { "type": "string", "description": "\"Collection\"", "format": "string" }, "entityId": { "type": "string", "description": "Unique identifier for this Collection", "format": "string" }, "name": { "type": "string", "description": "Name of the Collection", "format": "string" }, "description": { "type": "string", "description": "Short description of the Collection", "format": "text" }, "share_url": { "type": "string", "description": "A public URL for sharing the Collection", "format": "url" }, "published": { "type": "boolean", "description": "True if the Collection has a public share URL" }, "assertions": { "items": { "$ref": "#/definitions/Assertion" }, "type": "array", "description": "List of Assertions in the collection" }, "createdAt": { "type": "string", "description": "Timestamp when the Collection was created", "format": "ISO8601 timestamp" }, "createdBy": { "type": "string", "description": "BadgeUser who created this Collection", "format": "entityId" } } }, "Issuer": { "required": [ "name", "email", "url" ], "properties": { "entityType": { "type": "string", "description": "\"Issuer\"", "format": "string" }, "entityId": { "type": "string", "description": "Unique identifier for this Issuer", "format": "string" }, "openBadgeId": { "type": "string", "description": "URL of the OpenBadge compliant json", "format": "url" }, "createdAt": { "type": "string", "description": "Timestamp when the Issuer was created", "format": "ISO8601 timestamp" }, "createdBy": { "type": "string", "description": "BadgeUser who created this Issuer", "format": "entityId" }, "name": { "type": "string", "description": "Name of the Issuer", "format": "string" }, "image": { "type": "string", "description": "Base64 encoded string of an image that represents the Issuer", "format": "data:image/png;base64" }, "email": { "type": "string", "description": "must be a verified email on the authenticating user’s Badgr account. Get /v2/users/self to retrieve your profile and see your verified email addresses.", "format": "email" }, "description": { "type": "string", "description": "Short description of the Issuer", "format": "text" }, "url": { "type": "string", "description": "Homepage or website associated with the Issuer", "format": "url" }, "staff": { "items": { "$ref": "#/definitions/IssuerStaff" }, "type": "array" }, "extensions": { "type": "string", "format": "DictField" }, "badgrDomain": { "type": "string", "format": "CharField" } } }, "IssuerStaff": { "required": [ "user", "role" ], "properties": { "entityType": { "type": "string", "format": "CharField" }, "entityId": { "type": "string", "format": "CharField" }, "userProfile": { "type": "string", "format": "StaffUserProfileSerializerV2" }, "user": { "type": "string", "format": "EntityRelatedFieldV2" }, "role": { "enum": [ "staff", "editor", "owner" ], "type": "string" } } } } }