Versions Compared

Key

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

...

path -: endpoint to the portal-backend layer which download the dataset file - the path can be both parameterized and non parameterized . Portal backend populates the parameters using logged in user context details and downloads the respective file.

...

Proposed Solution

API to get Metadata + Data Files

There is a need to create API in report service that will provide access to the meta data as well as the report data files that are used to generate the reports in the 'Admin dashboards' page on the Sunbird portal with certain access controls.

...

Code Block
languagejson
interface IAccessPath {
  organisation: Array<string> | string;
  role: Array<string> | string;
  tenant: Array<string> | string;
  channel: Array<string> | string;
  group: Array<string> | string;
  userType: Array<string> | string;
  framework: Array<string> | string;
  isSuperAdmin: Array<string> | string;
  board: Array<string> | string;
  userId: Array<string> | string;
  userLocation: {
    state: Array<string> | string;
    district: Array<string> | string;
    block: Array<string> | string;
  };
  ...anyOtherAttribute: any
}

Resources

...

API to get list of Reports

This API is associated with Searching Reports on the Sunbird Platform.

METHOD - POST

URL - /report/list

Expand
titleGet Reports List by passing visibility and accessPath

Example of Request payload with visibility and accessPath

Code Block
{
    "request": {
        "filters": {
            "visibility": "private",
            "accessPath": {
                "organisation": [
                    "ORG_001"
                ],
                "tenant": "tn",
                "role": [
                    "REPORT_ADMIN",
                    "ORG_ADMIN"
                ]
            }
        }
    }
}

Success Response - Status Code 200

Code Block
languagejson
{
  "id": "api.report.list",
  "ver": "1.0.0",
  "params": {
    "resmsgid": "string",
    "msgid": "string",
    "status": "string",
    "err": "string",
    "errmsg": "string"
  },
  "responseCode": "string",
  "result": {
    "reports": [
      {
        ...metadata
      }
    ],
    "count": 1
  }
}

Error Response - Status code 500

Code Block
languagejson
{
  "id": "api.report.list",
  "ver": "v1",
  "ts": "timestamp",
  "params": {
    "resmsgid": null,
    "msgid": "string",
    "err": "string",
    "status": "SERVER_ERROR",
    "errmsg": "string"
  },
  "responseCode": "SERVER_ERROR",
  "result": {}
}

Resources