Skip to content

Commit

Permalink
Merge pull request #390 from souravdey091/1.11
Browse files Browse the repository at this point in the history
Issue #SB-9178 feat: Adding content service API's
  • Loading branch information
Sunitashelar authored Dec 21, 2018
2 parents 1996ff0 + c860664 commit 00f4197
Show file tree
Hide file tree
Showing 5 changed files with 820 additions and 4 deletions.
143 changes: 139 additions & 4 deletions apis/content/contentapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
205 changes: 205 additions & 0 deletions apis/dialapi/dialapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,178 @@ paths:
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
/reserve:
post:
description: >-
This API is creates dial codes with process id and links with contents.
- The **_/reserve_** endpoint executes the "Reserve DIAL code" request based on parameters provided as metadata in the request body
- Required fields cannot be left null or empty
summary: Reserve DIAL code
tags:
- DIAL APIs
operationId: ReservePost
produces:
- application/json
parameters:
- name: Body
in: body
required: true
description: >-
The body refers to the format of the request.
- The body contains metadata about the request for Generating DIAL code.
schema:
$ref: '#/definitions/GenerateReserveDialcoderequest'
- name: X-Channel-ID
in: header
required: true
type: string
description: 'It the Unique Id to identify the root organization to which the user belongs'
- 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: Authorization
in: header
required: true
type: string
description: 'All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.'
- name: X-Authenticated-User-Token
in: header
required: true
type: string
description: 'Represents the authorized User ID to execute the API'
responses:
'200':
description: 'OK ! Successful operation."Generate DIAL code" operation was successfully executed.'
schema:
$ref: '#/definitions/ContentCreateResponse'
'207':
description: 'PARTIAL_SUCCESS ! Dial code is generated without process id'
'400':
description: 'BAD REQUEST. The "Generate DIAL code" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.'
schema:
$ref: '#/definitions/ContentCreateErrorResponse'
'500':
description: 'INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.'
security:
- bearer: []
x-unitTests:
- request:
method: POST
uri: /generate
headers:
Content-Type: application/json
X-Channel-ID: sunbird
Authorization: Bearer {{api_key}}
body: >-
{
"request": {
"dialcodes": {
"count": 1,
"publisher": "Sunbird"
}
}
}
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: Generate dialcode
x-operation-settings:
CollectParameters: false
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
/release:
patch:
description: >-
This API is removes the reserved dial code linked with a content.
- The **_/release_** endpoint executes the "Release DIAL code" request based on parameters provided as metadata in the request body
- Required fields cannot be left null or empty
summary: Release DIAL code
tags:
- DIAL APIs
operationId: ReleasePost
produces:
- application/json
parameters:
- name: X-Channel-ID
in: header
required: true
type: string
description: 'It the Unique Id to identify the root organization to which the user belongs'
- 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: Authorization
in: header
required: true
type: string
description: 'All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.'
- name: X-Authenticated-User-Token
in: header
required: true
type: string
description: 'Represents the authorized User ID to execute the API'
responses:
'200':
description: 'OK ! Successful operation."Generate DIAL code" operation was successfully executed.'
schema:
$ref: '#/definitions/ContentCreateResponse'
'400':
description: 'BAD REQUEST. The "Generate DIAL code" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.'
schema:
$ref: '#/definitions/ContentCreateErrorResponse'
'500':
description: 'INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.'
security:
- bearer: []
x-unitTests:
- request:
method: POST
uri: /generate
headers:
Content-Type: application/json
X-Channel-ID: sunbird
Authorization: Bearer {{api_key}}
body: >-
{
"request": {
"dialcodes": {
"count": 1,
"publisher": "Sunbird"
}
}
}
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: Generate dialcode
x-operation-settings:
CollectParameters: false
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
definitions:
GenerateDialcoderequest:
title: Generate dialcodeRequest
Expand Down Expand Up @@ -1371,3 +1543,36 @@ definitions:
allOf:
- $ref: '#/definitions/EmptyResult'
- $ref: '#/definitions/ResponseHeader'
GenerateReserveDialcoderequest:
title: Generate dialreservecodeRequest
type: object
properties:
request:
properties:
dialcodes:
properties:
count:
description: ''
example: 1
type: integer
format: int32
publisher:
description: 'Represents the entity who who owns the DIAL code'
example: Sunbird
type: string
qrCodeSpec:
properties:
errCorrectionLevel:
description: ''
example: "H"
type: string
required:
- errCorrectionLevel
required:
- count
- publisher
- qrCodeSpec
required:
- dialcodes
required:
- request
Loading

0 comments on commit 00f4197

Please sign in to comment.