Intent
Need to create an interface for enabling Access to Content on Sunbird across different apps like Read Along,Games etc.
Note: Assumption of this specification is based on the apps being able to support these intents as part of their implementation.
Documentation is categorised into multiple sections:
WorkFlow
Vendor Registration of Apps to Sunbird
Global Vendor Registration API
Local Vendor Registration by Deep Linking
Technical Specification for third party apps
Param Data Supported
Summary Event Spec
API Documentation
Intent Handling
Approaches
Work Flow
Registration of External Apps
Sunbird Third Party App Interaction
Vendor registration of Apps to Sunbird
Global Vendor Registration API
Each Vendor can be registered as part of Global Configuration for Sunbird to have app links being enabled.
Vendor CRUD API (or) Form Configuration Supported.
Local Vendor Registration by Deep Linking
Enabling of Deep link in Sunbird for local registration restricted to device.
Device hears for deep links to register vendor apps locally (Restricted to particular device).Steps
Vendor app needs to call a deep link of Sunbird app.
Sunbird App as part of handling deep link will try to persist vendor information locally on app’s data.
Any subsequent invocation of intent from Sunbird will show globally registered apps for Sunbird along with locally registered apps in devices.
deeplink Url :
diksha://register?name: "", logo: "", appName: "", packageId: "",mimeType:””
Parameter
DataType
Description
name (M)
String
Name of the vendor
logo (M)
String
App logo Url
appName (M)
String
App Name
packageId (M)
String
PackageID of the app
mimeType (O)
String
Mime Type of the Content
extra (O)
String
Misceallaneous Information to be sent
Approaches
title | Approach 1 : (Deeper Integration) |
---|
Approach 1 : (Deeper Integration)
Intent provides basic information such as content do_id, telemetry context information.Targeted Application need to fetch the data from platform. Understand the Content Metadata and play the content.
Targeted Application need to respond back with Summary Data
Params
Description
resourceID
Content ID of the resource
context
Context of the play - like did, sid, uid etc
Pros
It can enable bazaar apps to index the content in their own environment.
It could open up the Sunbird APIs for most of the bazaar players.
Cons
Data to be sent might be huge
Spec is rigid. If the spec changes there can be inconsistency between various version of both apps
title | Approach 2 : (Lighter Integration) |
---|
Approach 2 : (Lighter Integration)
Intent provides basic information such as content do_id, context information & artifactUrl and mimeType.
Bazaar Apps can launch the artifactUrl directly based on mimeType.
Params
Description
resourceID
Content ID of the resource
context
Context of the play - like did, sid, uid etc
mimeType
Mime type of the content
artifactUrl
The URL to download the content
Pros
Least Effort in integrating the Intent for bazaar apps.
Need to develop a secure mechanism to serve only sun bird specific resources.
Cons
Data to be sent might be huge
Spec is rigid. If the spec changes there can be inconsistency between various version of both apps
title | Approach 3 : (A Hybrid approach between 1 & 2) |
---|
Intent provides the basic information such as content URL, mimeType & user/session context.
Params
Description
resourceID
Content ID of the resource
context
Context of the play - like did, sid, uid etc
mimeType
Mime type of the content
contentUrl
The public Sunbird content url or a dial url (https://<domain>/content/v1/read/do_xxxx => https://<domain>/dial/XC40VV)
Pros
The spec doesn’t need to change if more content metadata needs to be sent
The integration apps need to understand our content model and can also index the content in their apps
Context Information
Following are the contextual params passed to the reader app
Device ID
User ID
Session ID
Collection ID
Batch ID
Reference ID
Technical Specification for Third Party Apps
title | Params Data Supported |
---|
Params
Description
Data type
resourceId
identifier of the resource to be served in bazaar apps
String
collectionId
CollectionID of textbook,course
String
referrerPackageId
package details of referrer app
String
referenceID
String
mimeType
Content MimeType
String
vendorCode
Vendor ID to validate the referrer
String
contentCategory
contentCategory
String
contentUrl
Url of the Content
String
profileContext
Name and Avatar
String
Expand | |||||
---|---|---|---|---|---|
| |||||
https://github.com/sunbird-specs/Telemetry/blob/main/v3_event_details.md/#summary
All the reader apps need to send summary data back to Sunbird app via intent data. |
title | API Information |
---|
API:
https://<domain>/api/data/v1/dial/assemble
Request Object:
Code Block | ||
---|---|---|
| ||
{"request":{"source":"web","name":"DIAL Code Consumption","filters":{"dialcodes":"XC40VV","contentType":["Collection","TextBook","TextBookUnit","Resource","Course"]},"userProfile":{}}} |
Response Object:
Code Block |
---|
{"id":"api.dial.assemble","ver":"v1","ts":"2021-02-10 04:27:14:674+0000","params":{"resmsgid":null,"msgid":"90e184d1-c52c-106b-c410-6a168900ef05","err":null,"status":"success","errmsg":null},"responseCode":"OK","result":{"response":{"ignoredSections":[],"name":"DIAL Code Consumption","id":"01265699913956556871","sections":[{"display":"{\"name\":{\"en\":\"Linked Content\"}}","alt":null,"count":0,"description":null,"index":1,"sectionDataType":"content","facets":[{"values":[],"name":"primaryCategory"},{"values":[],"name":"subject"},{"values":[],"name":"grade"},{"values":[],"name":"domain"},{"values":[],"name":"language"},{"values":[],"name":"medium"},{"values":[],"name":"contentType"}],"imgUrl":null,"resmsgId":"406a3b50-6b58-11eb-ae68-add1f2666d9e","contents":null,"searchQuery":"{\"request\":{\"facets\":[\"language\",\"grade\",\"domain\",\"contentType\",\"primaryCategory\",\"subject\",\"medium\"],\"filters\":{\"primaryCategory\":[\"Digital Textbook\",\"Textbook Unit\",\"Course\"],\"mimeType\":[\"application/vnd.ekstep.content-collection\"],\"status\":[\"Live\"],\"compatibilityLevel\":{\"max\":4,\"min\":1},\"dialcodes\":\"XC40VV\",\"contentType\":[\"Collection\",\"TextBook\",\"TextBookUnit\",\"Resource\",\"Course\"]},\"mode\":\"collection\",\"userProfile\":{},\"limit\":10},\"limit\":10,\"sort_by\":{\"lastUpdatedOn\":\"desc\"}}","name":"Linked Content","id":"01265699616802406427","dynamicFilters":null,"dataSource":null,"apiId":"api.content.search","group":1}]}}} |
Vendor registration of Apps to Sunbird
Global Vendor Registration API
Each Vendor can be registered as part of Global Configuration for Sunbird to have app links being enabled.
Code Block | ||
---|---|---|
| ||
{
identifier: "",
name: "",
logo: "",
appName: "",
packageId: "",
target: {
mimeType : [],
contentType : [],
.... // All content attributes
},
appDetails: {
organization: "",
id: "",
version: ""
},
vendorCode: "" // Internally assigned
} |
Vendor CRUD API (or) Form Configuration Supported.
Local Vendor Registration by Deep Linking
Enabling of Deep link in Sunbird for local registration restricted to device.
Device hears for deep links to register vendor apps locally (Restricted to particular device).Steps
Vendor app needs to call a deep link of Sunbird app.
Sunbird App as part of handling deep link will try to persist vendor information locally on app’s data.
Any subsequent invocation of intent from Sunbird will show globally registered apps for Sunbird along with locally registered apps in devices.
deeplink Url :
sunbird://register?name: "", logo: "", appName: "", packageId: "",target:”{}”,appDetails:”{}”
Parameter | DataType | Description |
---|---|---|
name (M) | String | Name of the vendor |
logo (M) | String | App logo Url |
appName (M) | String | App Name |
packageId (M) | String | PackageID of the app |
target (M) | String | Targeted content query |
appDetails (O) | String | App details |
extra (O) | String | Misceallaneous Information to be sent |
Approaches
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
Approach 1 : (Deeper Integration)
Targeted Application need to fetch the data from platform. Understand the Content Metadata and play the content. Targeted Application need to respond back with Summary Data
Pros It can enable bazaar apps to index the content in their own environment. It could open up the Sunbird APIs for most of the bazaar players. Cons Data to be sent might be huge Spec is rigid. If the spec changes there can be inconsistency between various version of both apps |
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Approach 2 : (Lighter Integration)Intent provides basic information such as content do_id, context information & artifactUrl and mimeType. Bazaar Apps can launch the artifactUrl directly based on mimeType.
Pros Need to develop a secure mechanism to serve only sun bird specific resources. Cons Data to be sent might be huge Spec is rigid. If the spec changes there can be inconsistency between various version of both apps |
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Intent provides the basic information such as content URL, mimeType & user/session context.
Pros
Context Information Following are the contextual params passed to the reader app
|
Technical Specification for Third Party Apps
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
https://github.com/sunbird-specs/Telemetry/blob/main/v3_event_details.md/#summary
All the reader apps need to send summary data back to Sunbird app via intent data. |
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
The third party apps should do a HTTP GET call on the contentUrl parameter sent via the intent data
Response Data Structure
For More Details on the content model refer Sunbird Documentation |
Expand | ||||
---|---|---|---|---|
| ||||
Intent Handling
|
Parameter
DataType
Description
name (M)
String
logo (M)
String
appName (M)
String
packageId (M)
String
mimeType (O)
String
extra (O)
String