diff --git a/apis/orgapi/orgapi.yaml b/apis/orgapi/orgapi.yaml index 9ebf5d562d..1b543e152c 100644 --- a/apis/orgapi/orgapi.yaml +++ b/apis/orgapi/orgapi.yaml @@ -1,1106 +1,1124 @@ -swagger: '2.0' -info: - version: '1.0' - title: Org API(s) - termsOfService: 'https://github.com/project-sunbird/sunbird-commons/blob/master/LICENSE' - contact: - email: info@sunbird.org - description: >- - - The Organisation Management API resources perform operations related to management of an Organisation on the Sunbird Platform. - - - The URL for Org API(s) is `/org/v1`. -host: staging.open-sunbird.org -basePath: /api/org/v1 -securityDefinitions: - bearer: - type: apiKey # arbitrary name for the security scheme - in: header # The secrity scheme parameter is in "header" - name: Authorization # name of the header, query parameter or cookie - userToken: - type: apiKey # arbitrary name for the security scheme - in: header # The secrity scheme parameter is in "header" - name: x-authenticated-user-token # name of the header, query parameter or cookie -schemes: - - https -paths: - /create: - post: - description: >- - This API is for creation of a new Organisation on the Sunbird Platform. - - The endpoint for **Create a new Organisation** is `/create` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Create a new Organisation - tags: - - Org APIs - operationId: Organisation Create - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about the new Organisation to be created. - schema: - $ref: "#/definitions/OrgCreateRequest" - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' - schema: - $ref: '#/definitions/OrgCreateResponse' - '400': - description: - 'CLIENT_ERROR. The Organisation Create operation failed due to bad request from client. Possible reasons for failure: - Organisation name is mandatory. - Invalid property . - Channel is mandatory for root organisation. - Either "organisationId" or "provider" and "externalId" values are required for the operation. - Channel value already used by another organisation. Provide different value for channel.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The Organisation Create operation failed due to a server error. Possible reasons for failure: - Channel registration failed.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /read: - post: - description: >- - This API is for viewing details of an existing Organisation on the Sunbird Platform. - - The endpoint for **Read Organisation details** is `/read` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Read Organisation details - tags: - - Org APIs - operationId: Organisation Get - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about the Organisation whose details are required to be viewed. - schema: - $ref: '#/definitions/OrgGetRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgGetResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Either "organisationId" or "provider" and "externalId" values are required for the operation.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '404': - description: >- - 'RESOURCE_NOT_FOUND. The requested operation failed as given resource is not existing on server. Possible reasons for failure: - organisationId is mandatory.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /search: - post: - description: >- - This API is for searching for Organisations on the Sunbird Platform. - - The endpoint for **Search for an Organisation** is `/search` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Search for an Organisation - tags: - - Org APIs - operationId: Organisation Search - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about filters that can be used in Organisation search. - schema: - $ref: '#/definitions/OrgSearchRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgSearchResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Either "organisationId" or "provider" and "externalId" values are required for the operation.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '404': - description: >- - 'RESOURCE_NOT_FOUND. The requested operation failed as given resource is not existing on server. Possible reasons for failure: - organisationId is mandatory.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /update: - patch: - description: >- - This API is for updating details of an existing Organisation on the Sunbird Platform. - - The endpoint for **Update particulars of an existing Organisation** is `/update` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Update particulars of an existing Organisation - tags: - - Org APIs - operationId: Organisation Update - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about an existing Organisation to be updated. - schema: - $ref: '#/definitions/OrgUpdateRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgUpdateResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Either "organisationId" or "provider" and "externalId" values are required for the operation.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: - Channel registration failed.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /status/update: - patch: - description: >- - This API is for updating status of an existing Organisation on the Sunbird Platform. - - The endpoint for **Organisation update status** is `/status/update` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Organisation update status - tags: - - Org APIs - operationId: Organisation Status Update - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about an existing Organisation whose status is required to be updated. - schema: - $ref: '#/definitions/OrgStatusUpdateRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgStatusUpdateResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Either "organisationId" or "provider" and "externalId" values are required for the operation.' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: - Channel registration failed.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: [] - /type/create: - post: - summary: Create New Organisation Type - description: >- - This API is for creation of a new Organisation Type on the Sunbird Platform. - - The endpoint for **Create new Organisation Type** is `/type/create` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - tags: - - Org APIs - operationId: Organisation Type Create - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about the new Organisation Type to be created. - schema: - $ref: '#/definitions/OrgTypeCreateRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' - schema: - $ref: '#/definitions/OrgSuccessResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Organisation type name is mandatory.' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /type/list: - get: - description: >- - This API is for listing all Organisation Types on the Sunbird Platform. - - The endpoint for **List all Organisation Types** is `/type/list` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: List all Organisation Types - tags: - - Org APIs - operationId: Organisation Type List - produces: - - application/json - consumes: - - application/json - parameters: - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' - schema: - $ref: '#/definitions/OrgTypeListResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /type/update: - patch: - description: >- - This API is for updating details of an existing Organisation Type on the Sunbird Platform. - - The endpoint for **Update particulars of an existing Organisation Type** is `/type/update` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Update particulars of an existing Organisation Type - tags: - - Org APIs - operationId: Organisation Type Update - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about an existing Organisation Type to be updated. - schema: - $ref: '#/definitions/OrgTypeUpdateRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' - schema: - $ref: '#/definitions/OrgSuccessResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Organisation type name is mandatory.' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /member/add: - post: - description: >- - This API is for adding a user to an existing organisation on the Sunbird Platform. - - The endpoint for **Add a User to Organisation** is `/member/add` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Add a User to Organisation - tags: - - Org APIs - operationId: Organisation Add User - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about adding a member to an existing Organisation. - schema: - $ref: '#/definitions/OrgAddUserRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgSuccessResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Organisation Id or Provider with External Id values are required for the operation - Role of the user is required - Please provide valid userId or userName and provider - Given Organisation Data doesn't exist in our records. Please provide a valid one - Given User Data doesn't exist in our records. Please provide a valid one' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: - - bearer: [] - /member/remove: - post: - description: >- - This API is for removal of a user who is currently a member of an existing organisation on the Sunbird Platform. - - The endpoint for **Remove a User from Organisation** is `/member/remove` - - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. - - summary: Remove a User from Organisation - tags: - - Org APIs - operationId: Organisation Remove User - produces: - - application/json - consumes: - - application/json - parameters: - - name: Body - in: body - required: true - description: >- - The body contains metadata about removing a user from an existing Organisation. - schema: - $ref: '#/definitions/OrgRemoveUserRequest' - - name: ts - in: header - required: false - type: string - description: 'Timestamp at which given API request is sent.' - - name: X-msgid - in: header - required: false - type: string - description: 'This ID uniquely identifies a request if the same API is executed multiple times.' - - name: X-Authenticated-User-Token - in: header - required: true - type: string - description: 'Access token of registered user performing given API request.' - - name: Authorization - in: header - required: true - type: string - description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' - responses: - '200': - description: 'OK. Successful operation. The requested operation was successfully executed.' - schema: - $ref: '#/definitions/OrgSuccessResponse' - '400': - description: >- - 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: - Organisation Id or Provider with External Id values are required for the operation - Please provide valid userId or userName and provider - Given Organisation Data doesn't exist in our records. Please provide a valid one - Given User Data doesn't exist in our records. Please provide a valid one' - schema: - $ref: '#/definitions/OrgErrorResponse' - '500': - description: >- - 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' - schema: - $ref: '#/definitions/OrgErrorResponse' - security: [] -definitions: - AddressCreateRequest: - description: Request of Sunbird API containing an address - type: object - properties: - addType: - description: 'Type of address. E.g. Present, Permanent etc.' - type: string - addressLine1: - description: 'First line of address' - type: string - addressLine2: - description: 'Second line of address' - type: string - city: - description: 'City' - type: string - state: - description: 'State' - type: string - zipcode: - description: 'Zip code' - type: string - country: - description: 'Country' - type: string - - OrgCreateRequest: - title: Organisation Create API request format - allOf: - - type: object - properties: - request: - type: object - properties: - channel: - description: 'Name identifying a tenant (e.g. APEKX). Channel is mandatory for a root organisation if channel is not passed it will take custodian channel.' - type: string - description: - description: 'Organisation description' - type: string - externalId: - description: 'Organisation specific ID. This parameter is required if provider is given.' - type: string - isRootOrg: - description: 'Set to true for root organisation only' - type: boolean - locationIds: - description: 'ID of location returned using Location Create API , you can either pass locationIds or locationCode' - type: array - items: - type: string - locationCode: - description: 'Code of created state,district,block etc, you can either pass locationIds or locationCode.' - type: array - items: - type: string - description: '["BH"]' - provider: - description: 'Specified by sub-organisations to identify channel of root organisation. This parameter is required if externalId is given.' - type: string - orgName: - description: 'Organisation name' - type: string - orgType: - description: 'Organisation type' - type: string - orgTypeId: - description: 'ID of organisation type returned using Organisation Type Create API' - type: string - rootOrgId: - description: 'Root organisation ID' - type: string - email: - description: 'Contact email of organisation' - type: string - isSSOEnabled: - description: 'This attribute is applicable for rootOrg only. If for any root org SSO is enabled then pass this attribute with value true. incase of disable pass this as false' - type: boolean - address: - $ref: '#/definitions/AddressCreateRequest' - required: - - orgName - - OrgCreateResponse: - title: Organisation Create API response format - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - organisationId: - description: 'ID of the newly created organisation' - type: string - response: - description: 'Response message for successfully created organisation' - type: string - - OrgGetRequest: - title: Organisation Get API request format - allOf: - - type: object - properties: - request: - type: object - properties: - organisationId: - description: 'ID of the organisation whose details to be viewed' - type: string - - Organisation: - type: object - properties: - addressId: - description: 'ID of the organisation address' - type: string - channel: - description: 'Name identifying a tenant (e.g. APEKX).' - type: string - contactDetail: - description: 'Organisation contact details' - type: array - items: - type: object - properties: - phone: - description: 'Organisation phone contact' - type: string - email: - description: 'Organisation email contact' - type: string - createdBy: - description: 'Identifier of user who created organisation' - type: string - createdDate: - description: 'Date and time when organisation is created' - type: string - description: - description: 'Organisation description' - type: string - externalId: - description: 'Organisation specific ID' - type: string - hashTagId: - description: 'Same as organisation ID' - type: string - homeUrl: - description: 'Organisation homepage URL' - type: string - id: - description: 'Same as organisation ID' - type: string - identifier: - description: 'Same as organisation ID' - type: string - imgUrl: - description: 'Organisation image URL' - type: string - isRootOrg: - description: 'Set to true for root organisation' - type: boolean - locationId: - description: 'ID of location' - type: string - noOfMembers: - description: 'Number of users in root organisatio' - type: integer - orgName: - description: 'Organisation name' - type: string - orgType: - description: 'Organisation type' - type: string - orgTypeId: - description: 'ID of organisation type' - type: string - parentOrgId: - description: 'Parent organisation ID' - type: string - preferredLanguage: - description: 'Preferred language' - type: string - provider: - description: 'Specified by sub-organisations to identify channel of root organisation' - type: string - rootOrgId: - description: 'Root organisation ID' - type: string - slug: - description: 'Used to create URL for a root organisation' - type: string - status: - description: 'Organisation status (0: inactive, 1: active, 2: blocked, 3: retired)' - type: integer - thumbnail: - description: 'Organisation thumbnail URL' - type: string - updatedBy: - description: 'Identifier of user who updated organisation' - type: string - updatedDate: - description: 'Date and time when organisation is updated' - type: string - email: - description: 'Contact email of organisation' - type: string - isSSOEnabled: - description: "This is optional attribute and applicable for root org only. if attribute is present with value true then only it's indicate this rootOrg is using SSO, for all other cases SSO is disabled." - type: boolean - - OrgGetResponse: - title: Organisation Get API response format - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - response: - $ref: '#/definitions/Organisation' - - OrgUpdateRequest: - title: Organisation Update API request format - allOf: - - type: object - properties: - request: - type: object - properties: - organisationId: - description: 'ID of organisation(mandatory) whose details are required to be updated' - type: string - address: - description: 'Address of organisation' - type: object - description: - description: 'Organisation description' - type: string - externalId: - description: 'Organisation specific ID. This parameter is required if provider is given.' - type: string - locationId: - description: 'ID of location returned using Location Create API' - type: string - provider: - description: 'Specified by sub-organisations to identify channel of root organisation. This parameter is required if externalId is given.' - type: string - orgName: - description: 'Organisation name' - type: string - orgType: - description: 'Organisation type' - type: string - orgTypeId: - description: 'ID of organisation type returned using Organisation Type Create API' - type: string - email: - description: 'Contact email of organisation' - type: string - isSSOEnabled: - description: 'This attribute is used for root org only. if any rootOrg is suing sso then they can update this attribute value as true' - type: boolean - required: - - organisationId - - OrgUpdateResponse: - title: Organisation Update API response format - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - organisationId: - description: 'ID of the updated organisation' - type: string - response: - description: 'Response message for successfully updated organisation' - type: string - - OrgStatusUpdateRequest: - title: Organisation Status Update API request format - allOf: - - type: object - properties: - request: - type: object - properties: - organisationId: - description: 'ID of organisation whose details are required to be updated' - type: string - status: - description: 'Organisation status (0: inactive, 1: active, 2: blocked, 3: retired)' - type: integer - - OrgStatusUpdateResponse: - title: Organisation Status Update API response format - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - organisationId: - description: 'ID of the updated organisation' - type: string - response: - description: 'Response message for successfully updated organisation status' - type: string - - OrgTypeCreateRequest: - title: Organisation Type Create API request format - allOf: - - type: object - properties: - request: - type: object - properties: - name: - description: 'Organisation type name' - type: string - required: - - name - - OrgTypeListResponse: - title: Organisation Type List API response format - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - response: - type: array - items: - type: object - properties: - id: - description: 'Organisation type ID' - type: string - name: - description: 'Organisation type name' - type: string - - OrgTypeUpdateRequest: - title: Organisation Type Update API request format - allOf: - - type: object - properties: - request: - type: object - properties: - id: - description: 'ID of organisation type whose name is required to be updated' - type: string - name: - description: 'Organisation type name' - type: string - required: - - id - - name - - OrgAddUserRequest: - title: Organisation Add User API request format - allOf: - - type: object - properties: - request: - type: object - properties: - organisationId: - description: 'ID of organisation to which user is required to be added' - type: string - provider: - description: '?. This parameter is mandatory if userId is not provided.' - type: string - roles: - description: 'List of roles. in capital letters EX.PUBLIC list of roles availaible at http://docs.sunbird.org/latest/features-documentation/admin_assigning_users/index.html' - type: array - items: - type: string - userId: - description: 'ID of user who is required to be added if we are not providing the userId then we need to provide userExternalId,userProvider,userIdType' - type: string - required: - - organisationId - - roles - - userId - - OrgRemoveUserRequest: - title: Organisation Remove User API request format - allOf: - - type: object - properties: - request: - type: object - properties: - organisationId: - description: 'ID of organisation from which user is required to be removed' - type: string - userId: - description: 'ID of user who is required to be removed' - type: string - required: - - organisationId - - userId - - OrgSuccessResponse: - title: Common success response for an Organisation Management API - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - properties: - response: - description: 'Response message for successfully performed request' - type: string - - OrgErrorResponse: - title: Common error response for any Organisation Management API - allOf: - - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' - - type: object - properties: - result: - type: object - - OrgSearchRequest: - title: Organisation Search API request format - allOf: - - type: object - properties: - request: - type: object - properties: - filters: - description: 'Organisation search filters inside filters map you can put the attributes, required for your search it also supports the $or attributes' - type: object - properties: - $or: - type: object - description: 'this is additional param which support or condition for search' - limit: - description: 'Limit on the number of results ' - type: integer - offset: - type: integer - description: this is used get the result starting from the offset value - - OrgSearchResponse: - description: Organisation Search API response format - type: object - properties: - response: - type: object - properties: - count: - type: integer - content: - type: array - items: - $ref: '#/definitions/Organisation' +swagger: '2.0' +info: + version: '1.0' + title: Org API(s) + termsOfService: 'https://github.com/project-sunbird/sunbird-commons/blob/master/LICENSE' + contact: + email: info@sunbird.org + description: >- + - The Organisation Management API resources perform operations related to management of an Organisation on the Sunbird Platform. + + - The URL for Org API(s) is `/org/v1`. +host: staging.open-sunbird.org +basePath: /api/org/v1 +securityDefinitions: + bearer: + type: apiKey # arbitrary name for the security scheme + in: header # The secrity scheme parameter is in "header" + name: Authorization # name of the header, query parameter or cookie + userToken: + type: apiKey # arbitrary name for the security scheme + in: header # The secrity scheme parameter is in "header" + name: x-authenticated-user-token # name of the header, query parameter or cookie +schemes: + - https +paths: + /create: + post: + description: >- + This API is for creation of a new Organisation on the Sunbird Platform. + - The endpoint for **Create a new Organisation** is `/create` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Create a new Organisation + tags: + - Org APIs + operationId: Organisation Create + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about the new Organisation to be created. + schema: + $ref: "#/definitions/OrgCreateRequest" + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' + schema: + $ref: '#/definitions/OrgCreateResponse' + '400': + description: + 'CLIENT_ERROR. The Organisation Create operation failed due to bad request from client. Possible reasons for failure: + Organisation name is mandatory. + Invalid property . + Channel is mandatory for root organisation. + Either "organisationId" or "provider" and "externalId" values are required for the operation. + Channel value already used by another organisation. Provide different value for channel.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The Organisation Create operation failed due to a server error. Possible reasons for failure: + Channel registration failed.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /read: + post: + description: >- + This API is for viewing details of an existing Organisation on the Sunbird Platform. + - The endpoint for **Read Organisation details** is `/read` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Read Organisation details + tags: + - Org APIs + operationId: Organisation Get + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about the Organisation whose details are required to be viewed. + schema: + $ref: '#/definitions/OrgGetRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgGetResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Either "organisationId" or "provider" and "externalId" values are required for the operation.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '404': + description: >- + 'RESOURCE_NOT_FOUND. The requested operation failed as given resource is not existing on server. Possible reasons for failure: + organisationId is mandatory.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /search: + post: + description: >- + This API is for searching for Organisations on the Sunbird Platform. + - The endpoint for **Search for an Organisation** is `/search` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Search for an Organisation + tags: + - Org APIs + operationId: Organisation Search + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about filters that can be used in Organisation search. + schema: + $ref: '#/definitions/OrgSearchRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgSearchResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Either "organisationId" or "provider" and "externalId" values are required for the operation.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '404': + description: >- + 'RESOURCE_NOT_FOUND. The requested operation failed as given resource is not existing on server. Possible reasons for failure: + organisationId is mandatory.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /update: + patch: + description: >- + This API is for updating details of an existing Organisation on the Sunbird Platform. + - The endpoint for **Update particulars of an existing Organisation** is `/update` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Update particulars of an existing Organisation + tags: + - Org APIs + operationId: Organisation Update + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about an existing Organisation to be updated. + schema: + $ref: '#/definitions/OrgUpdateRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgUpdateResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Either "organisationId" or "provider" and "externalId" values are required for the operation.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: + Channel registration failed.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /status/update: + patch: + description: >- + This API is for updating status of an existing Organisation on the Sunbird Platform. + - The endpoint for **Organisation update status** is `/status/update` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Organisation update status + tags: + - Org APIs + operationId: Organisation Status Update + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about an existing Organisation whose status is required to be updated. + schema: + $ref: '#/definitions/OrgStatusUpdateRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgStatusUpdateResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Either "organisationId" or "provider" and "externalId" values are required for the operation.' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: + Channel registration failed.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: [] + /type/create: + post: + summary: Create New Organisation Type + description: >- + This API is for creation of a new Organisation Type on the Sunbird Platform. + - The endpoint for **Create new Organisation Type** is `/type/create` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + tags: + - Org APIs + operationId: Organisation Type Create + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about the new Organisation Type to be created. + schema: + $ref: '#/definitions/OrgTypeCreateRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' + schema: + $ref: '#/definitions/OrgSuccessResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Organisation type name is mandatory.' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /type/list: + get: + description: >- + This API is for listing all Organisation Types on the Sunbird Platform. + - The endpoint for **List all Organisation Types** is `/type/list` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: List all Organisation Types + tags: + - Org APIs + operationId: Organisation Type List + produces: + - application/json + consumes: + - application/json + parameters: + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' + schema: + $ref: '#/definitions/OrgTypeListResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /type/update: + patch: + description: >- + This API is for updating details of an existing Organisation Type on the Sunbird Platform. + - The endpoint for **Update particulars of an existing Organisation Type** is `/type/update` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Update particulars of an existing Organisation Type + tags: + - Org APIs + operationId: Organisation Type Update + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about an existing Organisation Type to be updated. + schema: + $ref: '#/definitions/OrgTypeUpdateRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The Organisation Create operation was successfully executed.' + schema: + $ref: '#/definitions/OrgSuccessResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Organisation type name is mandatory.' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /member/add: + post: + description: >- + This API is for adding a user to an existing organisation on the Sunbird Platform. + - The endpoint for **Add a User to Organisation** is `/member/add` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Add a User to Organisation + tags: + - Org APIs + operationId: Organisation Add User + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about adding a member to an existing Organisation. + schema: + $ref: '#/definitions/OrgAddUserRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgSuccessResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Organisation Id or Provider with External Id values are required for the operation + Role of the user is required + Please provide valid userId or userName and provider + Given Organisation Data doesn't exist in our records. Please provide a valid one + Given User Data doesn't exist in our records. Please provide a valid one' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: + - bearer: [] + /member/remove: + post: + description: >- + This API is for removal of a user who is currently a member of an existing organisation on the Sunbird Platform. + - The endpoint for **Remove a User from Organisation** is `/member/remove` + - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty. + + summary: Remove a User from Organisation + tags: + - Org APIs + operationId: Organisation Remove User + produces: + - application/json + consumes: + - application/json + parameters: + - name: Body + in: body + required: true + description: >- + The body contains metadata about removing a user from an existing Organisation. + schema: + $ref: '#/definitions/OrgRemoveUserRequest' + - name: ts + in: header + required: false + type: string + description: 'Timestamp at which given API request is sent.' + - name: X-msgid + in: header + required: false + type: string + description: 'This ID uniquely identifies a request if the same API is executed multiple times.' + - name: X-Authenticated-User-Token + in: header + required: true + type: string + description: 'Access token of registered user performing given API request.' + - name: Authorization + in: header + required: true + type: string + description: 'Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.' + responses: + '200': + description: 'OK. Successful operation. The requested operation was successfully executed.' + schema: + $ref: '#/definitions/OrgSuccessResponse' + '400': + description: >- + 'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: + Organisation Id or Provider with External Id values are required for the operation + Please provide valid userId or userName and provider + Given Organisation Data doesn't exist in our records. Please provide a valid one + Given User Data doesn't exist in our records. Please provide a valid one' + schema: + $ref: '#/definitions/OrgErrorResponse' + '500': + description: >- + 'INTERNAL SERVER ERROR. The requested operation failed due to a server error.' + schema: + $ref: '#/definitions/OrgErrorResponse' + security: [] +definitions: + AddressCreateRequest: + description: Request of Sunbird API containing an address + type: object + properties: + addType: + description: 'Type of address. E.g. Present, Permanent etc.' + type: string + addressLine1: + description: 'First line of address' + type: string + addressLine2: + description: 'Second line of address' + type: string + city: + description: 'City' + type: string + state: + description: 'State' + type: string + zipcode: + description: 'Zip code' + type: string + country: + description: 'Country' + type: string + + OrgCreateRequest: + title: Organisation Create API request format + allOf: + - type: object + properties: + request: + type: object + properties: + channel: + description: 'Name identifying a tenant (e.g. APEKX). Channel is mandatory for a root organisation if channel is not passed it will take custodian channel.' + type: string + description: + description: 'Organisation description' + type: string + externalId: + description: 'Organisation specific ID. This parameter is required if provider is given.' + type: string + isRootOrg: + description: 'Set to true for root organisation only' + type: boolean + locationIds: + description: 'ID of location returned using Location Create API , you can either pass locationIds or locationCode' + type: array + items: + type: string + locationCode: + description: 'Code of created state,district,block etc, you can either pass locationIds or locationCode.' + type: array + items: + type: string + description: '["BH"]' + provider: + description: 'Specified by sub-organisations to identify channel of root organisation. This parameter is required if externalId is given.' + type: string + orgName: + description: 'Organisation name' + type: string + orgType: + description: 'Organisation type' + type: string + orgTypeId: + description: 'ID of organisation type returned using Organisation Type Create API' + type: string + rootOrgId: + description: 'Root organisation ID' + type: string + email: + description: 'Contact email of organisation' + type: string + license: + description: 'This attribute will be used for rootOrg create/update time only. License attribute will be used for content creation time. User will be always part of one rootOrg, so during content creation time he/she can see what license value set by his/her rootOrg.' + type: string + isSSOEnabled: + description: 'This attribute is applicable for rootOrg only. If for any root org SSO is enabled then pass this attribute with value true. incase of disable pass this as false' + type: boolean + address: + $ref: '#/definitions/AddressCreateRequest' + required: + - orgName + - channel + + OrgCreateResponse: + title: Organisation Create API response format + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + organisationId: + description: 'ID of the newly created organisation' + type: string + response: + description: 'Response message for successfully created organisation' + type: string + + OrgGetRequest: + title: Organisation Get API request format + allOf: + - type: object + properties: + request: + type: object + properties: + organisationId: + description: 'ID of the organisation whose details to be viewed' + type: string + + Organisation: + type: object + properties: + addressId: + description: 'ID of the organisation address' + type: string + channel: + description: 'Name identifying a tenant (e.g. APEKX).' + type: string + contactDetail: + description: 'Organisation contact details' + type: array + items: + type: object + properties: + phone: + description: 'Organisation phone contact' + type: string + email: + description: 'Organisation email contact' + type: string + createdBy: + description: 'Identifier of user who created organisation' + type: string + createdDate: + description: 'Date and time when organisation is created' + type: string + description: + description: 'Organisation description' + type: string + externalId: + description: 'Organisation specific ID' + type: string + hashTagId: + description: 'Same as organisation ID' + type: string + homeUrl: + description: 'Organisation homepage URL' + type: string + id: + description: 'Same as organisation ID' + type: string + identifier: + description: 'Same as organisation ID' + type: string + imgUrl: + description: 'Organisation image URL' + type: string + isRootOrg: + description: 'Set to true for root organisation' + type: boolean + locationId: + description: 'ID of location' + type: string + noOfMembers: + description: 'Number of users in root organisatio' + type: integer + orgName: + description: 'Organisation name' + type: string + orgType: + description: 'Organisation type' + type: string + orgTypeId: + description: 'ID of organisation type' + type: string + parentOrgId: + description: 'Parent organisation ID' + type: string + preferredLanguage: + description: 'Preferred language' + type: string + provider: + description: 'Specified by sub-organisations to identify channel of root organisation' + type: string + rootOrgId: + description: 'Root organisation ID' + type: string + slug: + description: 'Used to create URL for a root organisation' + type: string + status: + description: 'Organisation status (0: inactive, 1: active, 2: blocked, 3: retired)' + type: integer + thumbnail: + description: 'Organisation thumbnail URL' + type: string + updatedBy: + description: 'Identifier of user who updated organisation' + type: string + updatedDate: + description: 'Date and time when organisation is updated' + type: string + email: + description: 'Contact email of organisation' + type: string + isSSOEnabled: + description: "This is optional attribute and applicable for root org only. if attribute is present with value true then only it's indicate this rootOrg is using SSO, for all other cases SSO is disabled." + type: boolean + + OrgGetResponse: + title: Organisation Get API response format + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + response: + $ref: '#/definitions/Organisation' + + OrgUpdateRequest: + title: Organisation Update API request format + allOf: + - type: object + properties: + request: + type: object + properties: + organisationId: + description: 'ID of organisation(mandatory) whose details are required to be updated' + type: string + address: + description: 'Address of organisation' + type: object + description: + description: 'Organisation description' + type: string + externalId: + description: 'Organisation specific ID. This parameter is required if provider is given.' + type: string + isRootOrg: + description: 'Set to true for root organisation' + type: boolean + locationIds: + description: 'ID of location returned using Location Create API , you can either pass locationIds or locationCode.During update you need to pass complete data, it will directly replace with stored locations' + type: array + items: + type: string + locationCode: + description: 'Code of created state,district,block etc, you can either pass locationIds or locationCode.During update you need to pass complete data, it will directly replace with stored locations' + type: array + items: + type: string + description: '["BH"]' + provider: + description: 'Specified by sub-organisations to identify channel of root organisation. This parameter is required if externalId is given.' + type: string + orgName: + description: 'Organisation name' + type: string + orgType: + description: 'Organisation type' + type: string + orgTypeId: + description: 'ID of organisation type returned using Organisation Type Create API' + type: string + email: + description: 'Contact email of organisation' + type: string + license: + description: 'This attribute will be used for rootOrg create/update time only. License attribute will be used for content creation time. User will be always part of one rootOrg, so during content creation time he/she can see what license value set by his/her rootOrg.' + type: string + isSSOEnabled: + description: 'This attribute is used for root org only. if any rootOrg is suing sso then they can update this attribute value as true' + type: boolean + required: + - organisationId + + OrgUpdateResponse: + title: Organisation Update API response format + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + organisationId: + description: 'ID of the updated organisation' + type: string + response: + description: 'Response message for successfully updated organisation' + type: string + + OrgStatusUpdateRequest: + title: Organisation Status Update API request format + allOf: + - type: object + properties: + request: + type: object + properties: + organisationId: + description: 'ID of organisation whose details are required to be updated' + type: string + status: + description: 'Organisation status (0: inactive, 1: active, 2: blocked, 3: retired)' + type: integer + + OrgStatusUpdateResponse: + title: Organisation Status Update API response format + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + organisationId: + description: 'ID of the updated organisation' + type: string + response: + description: 'Response message for successfully updated organisation status' + type: string + + OrgTypeCreateRequest: + title: Organisation Type Create API request format + allOf: + - type: object + properties: + request: + type: object + properties: + name: + description: 'Organisation type name' + type: string + required: + - name + + OrgTypeListResponse: + title: Organisation Type List API response format + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + description: 'Organisation type ID' + type: string + name: + description: 'Organisation type name' + type: string + + OrgTypeUpdateRequest: + title: Organisation Type Update API request format + allOf: + - type: object + properties: + request: + type: object + properties: + id: + description: 'ID of organisation type whose name is required to be updated' + type: string + name: + description: 'Organisation type name' + type: string + required: + - id + - name + + OrgAddUserRequest: + title: Organisation Add User API request format + allOf: + - type: object + properties: + request: + type: object + properties: + organisationId: + description: 'ID of organisation to which user is required to be added' + type: string + provider: + description: '?. This parameter is mandatory if userId is not provided.' + type: string + roles: + description: 'List of roles. in capital letters EX.PUBLIC list of roles availaible at http://docs.sunbird.org/latest/features-documentation/admin_assigning_users/index.html' + type: array + items: + type: string + userId: + description: 'ID of user who is required to be added if we are not providing the userId then we need to provide userExternalId,userProvider,userIdType' + type: string + required: + - organisationId + - roles + - userId + + OrgRemoveUserRequest: + title: Organisation Remove User API request format + allOf: + - type: object + properties: + request: + type: object + properties: + organisationId: + description: 'ID of organisation from which user is required to be removed' + type: string + userId: + description: 'ID of user who is required to be removed' + type: string + required: + - organisationId + - userId + + OrgSuccessResponse: + title: Common success response for an Organisation Management API + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + properties: + response: + description: 'Response message for successfully performed request' + type: string + + OrgErrorResponse: + title: Common error response for any Organisation Management API + allOf: + - $ref: 'https://raw.githubusercontent.com/project-sunbird/project-sunbird.github.io/dev/apis/definitions/envelope.yaml#/ApiResponse' + - type: object + properties: + result: + type: object + + OrgSearchRequest: + title: Organisation Search API request format + allOf: + - type: object + properties: + request: + type: object + properties: + filters: + description: 'Organisation search filters inside filters map you can put the attributes, required for your search it also supports the $or attributes' + type: object + properties: + $or: + type: object + description: 'this is additional param which support or condition for search' + limit: + description: 'Limit on the number of results ' + type: integer + offset: + type: integer + description: this is used get the result starting from the offset value + + OrgSearchResponse: + description: Organisation Search API response format + type: object + properties: + response: + type: object + properties: + count: + type: integer + content: + type: array + items: + $ref: '#/definitions/Organisation'