Versions Compared

Key

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

...

Create a new v2 endpoint and accept list of activityIds in the input and response is based on the activityId.
Each activity data for a group is cached with key groupId:activityId:activityType:activity-agg and TTL of 1hr.

Request:

Code Block
POST: /v2/group/activity/agg

{
  "request": {
    "groupId": "groupId",
    "activityId": ["assessmentId_1","assessmentId_2"],
    "activityType": "Assessment"
  }
}

...

Code Block
{
  "id": "api.group.activity.agg",
  "ver": "v2",
  "ts": "2021-04-07 05:53:32:742+0000",
  "params": {
    "resmsgid": null,
    "msgid": "62ae69c9-edf7-4486-bbfc-c84454add954",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "assessmentId_1activities": [
      {
        "activity": {
          "id": "assessmentId_1",
          "type": "Assessment",
          "agg": [
            {
              "metric": "score",
              "lastUpdatedOn": 1596647700613,
              "value": 1
            }
          ]
        },
        "groupId": "b0c4a645-807e-41c7-972e-5c48c5b5e5e7",
        "members": [
          {
            "agg": [
              {
                "metric": "score",
                "value": 20,
                "lastUpdatedOn": 1596647700613
              }
            ],
            "name": "Creation",
            "role": "admin",
            "status": "active",
            "createdBy": "874ed8a5-782e-4f6c-8f36-e0288455901e",
            "userId": "874ed8a5-782e-4f6c-8f36-e0288455901e"
          }
        ]
      },
    "assessmentId_2":  {
        "activity": {
          "id": "assessmentId_2",
          "type": "Assessment",
          "agg": [
            {
              "metric": "score",
              "lastUpdatedOn": 1596647700613,
              "value": 1
            }
          ]
        },
        "groupId": "b0c4a645-807e-41c7-972e-5c48c5b5e5e7",
        "members": [
          {
            "agg": [
              {
                "metric": "score",
                "value": 30,
                "lastUpdatedOn": 1596647700613
              }
            ],
            "name": "Creation",
            "role": "admin",
            "status": "active",
            "createdBy": "874ed8a5-782e-4f6c-8f36-e0288455901e",
            "userId": "874ed8a5-782e-4f6c-8f36-e0288455901e"
          }
        ]
      }
    ]
  }
}