-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from souravdey091/1.11
Issue #SB-9178 feat: Adding content service API's
- Loading branch information
Showing
5 changed files
with
820 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ info: | |
contact: | ||
email: [email protected] | ||
description: >- | ||
The Content API resources perform operations related to all the _Content_ on the Sunbird Platform. | ||
The Content API resources perform operations related to all _Content_ on Sunbird Platform | ||
- Each of the endpoints serve a different purpose, so which one to use depends on what you want to do | ||
- Each of the endpoints serve a different purpose. Each of these can be used based on requirements | ||
- The operations include CRUD (Create, Update,Read and Delete) operations and other operations such as upload, publish. | ||
host: staging.open-sunbird.org | ||
|
@@ -759,7 +759,8 @@ paths: | |
- The**_/search/_** endpoint executes "Search Content" request for fetching the contents as results for a particular search criterion. | ||
- It is mandatory to provide values for parameters marked with *. | ||
- Mandatory fields cannot be null or empty. | ||
- Filter can be applied on any [metadata](http://www.sunbird.org/apis/content/#operation/Create%20Content) of content. | ||
- If 'framework=<identifier>&lang=<lang_code>' is passed in the url as query params, then you should get the translations for facets array, while requesting facets. | ||
- Filter can be applied on any [metadata](apis/content/#operation/Create%20Content) of content. | ||
summary: Search Content | ||
tags: | ||
- Content APIs | ||
|
@@ -1655,7 +1656,110 @@ paths: | |
CollectParameters: false | ||
AllowDynamicQueryParameters: false | ||
AllowDynamicFormParameters: false | ||
IsMultiContentStreaming: false | ||
IsMultiContentStreaming: false | ||
|
||
|
||
|
||
/collaborator/update/{Content_ID}: | ||
patch: | ||
description: >- | ||
This API is associated with adding or removing collaborators in a content on the Sunbird Platform . | ||
- **_/collaborator/update/{Content_ID}_** endpoint executes the "Update Collaborators" request based on parameters provided as metadata in the request body. | ||
- {...}refers to a section of endpoint URL path that needs to be replaced by appropriate Id. | ||
- It is a must to provide values for the required parameters | ||
summary: Update Collaborators | ||
tags: | ||
- Content APIs | ||
operationId: Update Collaborators | ||
produces: | ||
- application/json | ||
parameters: | ||
- in: path | ||
name: Content_ID | ||
type: string | ||
required: true | ||
description: 'Please append a valid Content ID To the Request URL' | ||
- name: Body | ||
in: body | ||
required: true | ||
description: >- | ||
The body parameter refers to the format of the request, the request body (payload) takes the following media types to make the payload:' | ||
- JSON | ||
The body is the representation of the resource object for updating the content. | ||
schema: | ||
$ref: '#/definitions/UpdateCollaboratorsRequest' | ||
- name: Content-Type | ||
in: header | ||
required: true | ||
type: string | ||
description: >- | ||
The Content Type entity is the media type of the resource.Possible media types can be:- | ||
- Application/json | ||
- name: X-Authenticated-User-Token | ||
in: header | ||
required: true | ||
type: string | ||
description: 'Represents the authorized User token to execute the API.' | ||
- name: Authorization | ||
in: header | ||
required: true | ||
type: string | ||
description: 'To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.' | ||
responses: | ||
'200': | ||
description: >- | ||
SUCCESS. The **Update Collaborators** operation was successful! | ||
schema: | ||
$ref: '#/definitions/CommonSuccessResponse' | ||
'400': | ||
description: >- | ||
'BAD REQUEST. The **Update Collaborators** operation failed.' | ||
schema: | ||
$ref: '#/definitions/CommonErrorResponse' | ||
'500': | ||
description: >- | ||
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at [email protected].' | ||
schema: | ||
$ref: '#/definitions/CommonErrorResponse' | ||
security: | ||
- bearer: [] | ||
x-unitTests: | ||
- request: | ||
method: PATCH | ||
uri: /content/v1/collaborator/update/{Content_Id} | ||
headers: | ||
Content-Type: application/json | ||
X-Authenticated-User-Token: '{{user_token}}' | ||
Authorization: 'Bearer {{api_key}}' | ||
body: |- | ||
{ | ||
"request": { | ||
"content": { | ||
"collaborators" : ["2f5e33f2-ae46-4494-b60a-03ec59ddf824"] | ||
} | ||
} | ||
} | ||
expectedResponse: | ||
x-allowExtraHeaders: true | ||
x-bodyMatchMode: NONE | ||
x-arrayOrderedMatching: false | ||
x-arrayCheckCount: false | ||
x-matchResponseSchema: true | ||
headers: {} | ||
x-testShouldPass: true | ||
x-testEnabled: true | ||
x-testName: Update Collaborators | ||
x-testDescription: '' | ||
x-operation-settings: | ||
CollectParameters: false | ||
AllowDynamicQueryParameters: false | ||
AllowDynamicFormParameters: false | ||
IsMultiContentStreaming: false | ||
|
||
|
||
|
||
definitions: | ||
CreateContentRequest: | ||
title: Create ContentRequest | ||
|
@@ -2435,6 +2539,12 @@ definitions: | |
allOf: | ||
- $ref: '#/definitions/ResultWithNodeId' | ||
- $ref: '#/definitions/ResponseHeader' | ||
CommonSuccessResponse: | ||
description: Common Content Response | ||
type: object | ||
allOf: | ||
- $ref: '#/definitions/ResultWithNodeId' | ||
- $ref: '#/definitions/ResponseHeader' | ||
ContentUploadResponse: | ||
description: Upload Content Response | ||
type: object | ||
|
@@ -2827,6 +2937,12 @@ definitions: | |
allOf: | ||
- $ref: '#/definitions/EmptyResult' | ||
- $ref: '#/definitions/ResponseHeader' | ||
CommonErrorResponse: | ||
title: Common Error Response | ||
type: object | ||
allOf: | ||
- $ref: '#/definitions/EmptyResult' | ||
- $ref: '#/definitions/ResponseHeader' | ||
CopyContentRequestBody: | ||
title: CopyContentRequest | ||
example: | ||
|
@@ -2928,3 +3044,22 @@ definitions: | |
sourceId: | ||
type: string | ||
example: 'copiedId' | ||
UpdateCollaboratorsRequest: | ||
title: Update Collaborators Request | ||
type: object | ||
properties: | ||
request: | ||
properties: | ||
content: | ||
properties: | ||
collaborators: | ||
description: '' | ||
type: array | ||
items: | ||
type: string | ||
required: | ||
- collaborators | ||
required: | ||
- content | ||
required: | ||
- request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.