Upload the .csv data file for state specific programs using ingestion API

Events, Dimensions can be uploaded into respective cloud storage via the ingestion APIs. The event upload is done for only state programs using this API.

The jwt token has to be passed in the API headers.

Step 1: create a postman request and add details.

API Endpoint: <domain_name>/api/ingestion/new_programs

HTTP Method: POST

This API will import the dimension csv and upload it into the process_input folder in the cloud if there are no errors.

Step 2: Build the request body with reference to YAML file. The request body for the above API is attached here for yaml: https://github.com/Sunbird-cQube/spec-ms/blob/dev/spec.yaml Provide valid input details for the parameters shown below.

  • file : Attach the CSV file for the importing

  • ingestion_type : Specify the type of ingestion (value should be event when uploading the event data file. If it is a dimension data file it should be dimension)

  • ingestion_name : Name of the event or dimension

  • program_name: Name of the state program (This key is required only for ingestion_type = β€˜event’)

Note: The value for the key program_name should be the same name as the folder name present inside ingest->VSK or NVSK->programs folder in processing-ms.

Example: https://github.com/Sunbird-cQube/processing-ms/blob/dev/impl/c-qube/ingest/VSK/config.json

The above link has a list of programs array.

Example: For a school attendance program the folder name is school-attendance so the same name should be given while passing the value for program_name.

"files": "./ingest/VSK/programs/school-attendance" => The folder name can be identified as school-attendance.

Step 3:

Click on the send button for request and if the request is successful the user should see a response message. Please refer to the below screenshot.

After successful execution of the csv import api we get the response and we can see the file status indicating if the file is uploaded or not using GET file status API. If the file is successfully uploaded we will get the response as uploaded and if there are any errors it will send us the response indicating there was an error in the file.

Last updated