Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleAPI Information

API:

https://<domain>/api/data/v1/dial/assemble

Request Object:

Code Block
languageactionscript3
{"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}]}}}

For More Details Refer Sunbird Documentation
Object Types

Expand
titleIntent Handling

Intent Handling

  • Need to implement an activity which is capable of calling API and read the content metadata to launch the content in their respective apps. Following is the API request,response structure to be adhered to.

  • Need to create an intent filter in Android Manifest as follows :

  • Code Block
    <activity
        android:name="com.example.ExampleActivity"
        android:label="@string/title_example" >
        <intent-filter android:label="@string/play_view_web_example">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- Accepts URIs that begin with "http://sunbird.staginged.in/play” -->
            <data android:scheme="https"
                  android:host="sunbird.staginged.in"
                  android:pathPrefix="/play" />
        </intent-filter>
        <intent-filter android:label="@string/play_view_app_example">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- Accepts URIs that begin with "example://play” -->
            <data android:scheme="example"
                  android:host="play" />
        </intent-filter>
    </activity>


    Implement Activity as follows

  • Code Block
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        Intent intent = getIntent();
        String action = intent.getAction();
        Uri data = intent.getData();
        <!-- Trigger the Business Logic of App -->
    }

...