APIs
API Document:
Activity Related API
This API is used for reading the current progress of the course (content) consumed by group members. For example, the mentor/user can view and check the progress of a specific activity.
The endpoint for Group Activity Aggregator is
/agg
The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
'The Content Type entity is the media type of the resource.Possible
\ media types can be:- \n - application/json'
application/json
'The registered user token/key to authenticate user and execute the API.'
{{authToken}}
'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.'
{{api-key}}
POST /api/data/v1/group/activity/agg HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{api-key}}
Content-Type: application/json
x-authenticated-user-token: {{authToken}}
Accept: */*
Content-Length: 93
{
"request": {
"groupId": "{{group-id}}",
"activityId": "{{activity-id}}",
"activityType": "Course"
}
}
{
"id": "api.group.activity.agg",
"ver": "v1",
"ts": "2020-11-27 16:29:46:161+0000",
"params": {
"resmsgid": null,
"msgid": "849f418c-7f6e-4a10-9c5c-16b15f8ea86e",
"err": null,
"status": "success",
"errmsg": null
},
"responseCode": "OK",
"result": {
"activity": {
"id": "{{activity-id-invalid}}",
"type": "Course",
"agg": [
{
"metric": "enrolmentCount",
"lastUpdatedOn": 1606494586160,
"value": 0
}
]
},
"groupId": "b0c4a645-807e-41c7-972e-5c48c5b5e5e7",
"members": []
}
}
Group API
This API is used to create a group
The endpoint for Create Group is
/group/v1/create
The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Timestamp at which given API request is sent.
This ID uniquely identifies a request if the same API is executed multiple times.
To make use of any Group 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.
It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password
Managed User token of registered MUA user performing given API request.
Create Group Object
POST /api/group/v1/create HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 86
{
"request": {
"name": "Study Group",
"description": "This groups belongs to group study"
}
}
{
"id": "api.group.create",
"ver": "v1",
"ts": "2020-12-01 20:52:25:226+0000",
"params": null,
"result": {
"groupId": "682473c2-12ba-4a89-b8db-67c2c65ca97a"
},
"responseCode": 200
}
This API is used for updating the group related details. This can also be used to add/edit/remove members of a group and also to add/remove activitties of a group. This API can add details partially as well, for example, one member in the request could not be added, because that member is inactive or id doesn't exist, still other properties in the request is updated. If a member is not added, only the status of that will be shown in the “errors” array in response.
The endpoint for Update Group is
/group/v1/update
The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Once group suspended following operation can only be performed :-
All member are eligible to leave the group.
Creator will be able to delete the group.
Admin will be able to reactivate the group.
All other operations are not permitted once group is suspended.
Timestamp at which given API request is sent.
This ID uniquely identifies a request if the same API is executed multiple times.
Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.
Access token of registered user performing given API request.
Managed User token of registered MUA user performing given API request.
Update response for a Group API
PATCH /api/group/v1/update HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 108
{
"request": {
"groupId": "groupid",
"name": "Demo Group",
"description": "Group name is changed for demo purpose"
}
}
{
"id": "d1232323",
"ver": "3.0",
"ets": "139832389023",
"responseCode": "200",
"result": {
"response": "success"
}
}
This API is used for listing groups of a particular user.
The endpoint for List Group is
/group/v1/list
The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
To make use of any Group 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.
It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password
Managed User token of registered MUA user performing given API request. From this LUA and MUA id are seperated and LUA is validated against user_id in x-authenticated-user-token
Timestamp is a sequence of characters or encoded information identifying when the list group API call occurred, usually it gives date and time of day, mostly accurate to a small fraction of a second.
This ID uniquely identifies a request if the same API is executed multiple times.
List group request
POST /api/group/v1/list HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"reuqest": {
"userId": "userid"
}
}
{
"id": "api.group.list",
"ts": "2020-12-02 12:57:58:595+0530",
"ver": "v1",
"params": null,
"result": {
"group": [
{
"activities": [
{
"id": "do_2130548011728240641164",
"type": "Course"
},
{
"id": "do_21301074192677273611434",
"type": "Course"
}
],
"createdBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
"createdOn": "2020-07-14 15:04:14:075+0530",
"id": "01460efa-ee58-4c3a-b171-810999128b8c",
"memberRole": "admin",
"membershipType": "invite_only",
"name": "Maths class 2",
"status": "active",
"updatedBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
"updatedOn": "2020-07-17 18:07:53:603+0530"
},
{
"activities": [
{
"id": "do_21308363397050368012",
"type": "Course"
}
],
"createdBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
"createdOn": "2020-08-11 10:56:14:680+0530",
"description": "do_21308363397050368012",
"id": "1481a7d2-00fb-43d3-915b-5251a328e08c",
"memberRole": "admin",
"membershipType": "invite_only",
"name": "Vk-3.2NestedCourse",
"responseCode": 200,
"status": "active",
"updatedBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
"updatedOn": "2020-08-11 10:57:13:052+0530"
}
]
}
}
This API is used for deleting the groups .
The endpoint for Delete Group is
/group/v1/delete
The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
To make use of any Group 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.
It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password
Managed User token of registered MUA user performing given API request. From this LUA and MUA id are seperated and LUA is validated against user_id in x-authenticated-user-token
Timestamp is a sequence of characters or encoded information identifying when the list group API call occurred, usually it gives date and time of day, mostly accurate to a small fraction of a second.
This ID uniquely identifies a request if the same API is executed multiple times.
Delete response for a Group API
POST /api/group/v1/delete HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"request": {
"groupId": "6da747d8-c19f-40cb-9938-fcf0913e301f"
}
}
{
"id": "api.group.delete",
"ver": null,
"ts": "2020-12-02 11:09:52:748+0530",
"params": null,
"result": {
"response": "SUCCESS"
},
"responseCode": 200
}
Last updated
Was this helpful?