Introduction
This wiki explains the design for fetching QR code images via DIAL Service
Background & Problem Statement
At the moment LERN is connecting to cassandra ‘dialcodes.dialcode_images’ table for fetching QR Code Image URLs. Ideally this information should be fetched from DIAL service owned by Knowlg BB as this keyspace is owned by knowlgBB. Hence, an API is to be developed where an image or multiple QR code Images information can be fetched from DIAL service.
Design
To resolve above problem, new API can be published in DIAL Service ({{host}}/api/dialcode/v2/image/list) which will accept request in below format and can provide response in below format. Number of QR Codes as input to be controlled via a configuration 'filename_request_limit
'.
{ "request": { "filename": ["0_Q1I5I3"] } }
{ "id": "sunbird.dialcode.images.list", "ver": "3.0", "ts": "2023-02-01T12:16:52Z+05:30", "params": { "resmsgid": "505bce18-1feb-44c3-91c3-07b8324de4f9", "msgid": null, "err": null, "status": "successful", "errmsg": null }, "responseCode": "OK", "result": { "qrcodeImagesInfo": [ { "filename": "0_Q1I5I3", "channel": "b00bc992ef25f1a9a8d63291e20efc8d", "config": {}, "createdOn": null, "dialcode": "Q1I5I3", "publisher": null, "status": 0, "url": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/in.ekstep/0_Q1I5I3.png" } ] } }