/
Migration script for svg templates (release-3.4.0)
Migration script for svg templates (release-3.4.0)
Overview
As of release-3.4.0, all svg template creation and consumption is done using asset APIs.
This document talks about the APIs to be used to migrate the existing svg templates.
Steps
Create the svg template with same identifier and name, with below API
curl -L -X POST 'https://staging.ntp.net.in/api/asset/v1/create' \ -H 'X-Channel-Id: in.ekstep' \ -H 'x-authenticated-user-token: {{authToken}}' \ -H 'Authorization: Bearer {{api-key}}' \ -H 'Content-Type: application/json' \ --data-raw '{ "request": { "asset": { "identifier": "SVG_TEMPLATE_ID", "name": "SVG_TEMPLATE_NAME", "code": "SVG_TEMPLATE_NAME", "mimeType": "image/svg+xml", "license": "CC BY 4.0", "primaryCategory": "Certificate Template", "mediaType": "image", "certType": "cert template layout", "data": { "title": "SVG_TEMPLATE_NAME" } } } }'
Upload the svg template using below API.
curl -L -X POST 'https://staging.ntp.net.in/api/asset/v1/upload/SVG_TEMPLATE_ID' \ -H 'x-authenticated-user-token: {{authToken}}' \ -H 'Authorization: Bearer {{api-key}}' \ -F 'file=@/Users/pradyumna/Downloads/template-1.svg' // absolute path to template
To validate the data, we can use either read API as below, or we can do composite-search using
primaryCategory: Certificate Template
Read API: curl -L -X GET 'https://staging.ntp.net.in/api/asset/v1/read/SVG_TEMPLATE_ID' \ -H 'x-authenticated-user-token: {{authToken}}' \ -H 'Authorization: Bearer {{api-key}}'
NOTE: There are no changes to existing course batches containing svg template, as we are using the same templateIds.
, multiple selections available,
Related content
inQuiry: CSP migration & verification steps
inQuiry: CSP migration & verification steps
More like this
Flink jobs for certificates generation and processing
Flink jobs for certificates generation and processing
Read with this
Knowlg - Add New CSP Storage - Implementation Changes & Testing
Knowlg - Add New CSP Storage - Implementation Changes & Testing
More like this
Replace usage of elasticsearch with cassandra for enrolments - Implementation Design
Replace usage of elasticsearch with cassandra for enrolments - Implementation Design
Read with this
Certificate Creation as Self Service Utility
Certificate Creation as Self Service Utility
More like this
Upload certificate: Using Asset API
Upload certificate: Using Asset API
More like this