DIVOC
DIVOC 3.5
DIVOC 3.5
  • Introduction to DIVOC
    • What DIVOC is and what it's not
    • DIVOC Docs Index
  • Platform
    • Release Notes
      • DIVOC 2.0 Release Features
      • DIVOC 3.0 Release Features
      • DIVOC 3.1 Release Features
      • DIVOC 3.5 Release Notes
    • Specification
      • API Documentation
      • Setting up DIVOC development environment
    • DIVOC's Verifiable Certificate Features 2.0
      • Creating a DIVOC Certificate
        • Overview of DIVOC’s digital certificates
        • What information is included in the DIVOC certificate?
        • DIVOC’s certificate generation service: How does it work?
        • Compliance with internationally used COVID-19 certificate schemas
      • Distributing a DIVOC Certificate
      • Updating a DIVOC Certificate
      • Revoking a DIVOC Certificate
      • Verifying a DIVOC Certificate
      • DIVOC's Native COVID-19 Certificate Specification
      • DIVOC’s EU-DCC Adapter Service
      • DIVOC’s SHC Adapter Service
      • Adding a User Type in DIVOC
      • Printing Certificates at a Facility
      • Normal QR Code Versus Signed/Verifiable QR Code
      • What Information Goes Into a QR Code?
      • WHO Master Vaccine Checklist
      • EU Master Vaccine Checklist
    • DIVOC's Verifiable Certificate Features 3.0
      • How to Configure a New Tenant?
      • How to Access the VC System and Generate Tokens
      • How to Generate Certificates
      • How to Fetch Certificates
      • How to Update Certificates
      • How to Revoke Certificates
      • How to Suspend Certificates
    • DIVOC's Verifiable Certificate Features 3.1
      • How to Verify Certificates
    • DIVOC's Verifiable Certificate Features 3.5
      • How to Create New Schemas
      • How to Manage Schemas?
    • DIVOC Architecture
    • Installation
      • Skills needed to set up DIVOC
      • Implementation Checklist
      • Setting Up DIVOC in k8 Cluster
        • How to Install DIVOC
        • How to Install DIVOC for V3.0
        • Backup & Restore: Postgres, Clickhouse, Kafka, & Redis
        • Infrastructure Recovery
        • Server Hardening
    • Verifiable Credential (VC): Production Deployment
    • Configuration
      • Configuring the Certification and Verification Component
        • Generating Signed Key Pairs
        • Configuring certificates
          • Step 1: Create a certification generation request
          • Step 2: Configure the QR code content
          • Step 3: Configure the certificate template
        • How to set up the verification portal for implementation
        • How to configure the update certificate API
        • Configuring Environment Variables in 2.0
      • Configuration Management Via ETCD
        • Adding a New Vaccine and ICD-11 Mapping
          • Adding a New Vaccine and ICD-11 Mapping Using ETCD CLI
        • PDF Template Change for Vaccine Certificates
          • PDF Template Change for Vaccine Certificates via ETCD CLI
        • EU Vaccine Configurations
          • Adding a New Vaccine and its Mapping via ETCD CLI
        • Payload Changes in the QR Code
          • Payload Changes in the QR Code via ETCD CLI
    • Performance Report
  • Products
    • Issuing COVID-19 Vaccination Certificates in India
    • Issuing COVID-19 Test Reports in India
    • Issuing COVID-19 Vaccination Certificates in Sri Lanka
    • Issuing COVID-19 Vaccination Certificates in the Philippines
    • Issuing COVID-19 Vaccination Certificates in Jamaica
      • Troubleshooting
    • Issuing COVID-19 Vaccination Certificates in Indonesia
    • Open Events
      • Past Events
      • DIVOC in the Media
  • DIVOC Demo
    • Program Setup (Via Orchestration Module)
    • Facility App
    • Issue and Verify Certificates
    • Citizen Portal
    • Feedback
    • Analytics
  • Community
    • Roadmap
    • Partner Support
      • Terms and Conditions of Using the DIVOC Site
      • Privacy Policy: Short Version for Display
      • Privacy Policy: Detailed
      • Platform Policy Guidelines
      • Privacy Policy Recommendations
      • Troubleshooting Guide
    • Source Code
    • Discussion Forum
    • Issues
    • Project Repo
Powered by GitBook
On this page
  • Purpose
  • Steps
  • Steps to Create Schema Using JSON
  • Step 1: Create the context using API call
  • Step 2: Upload Templates
  • Step 3: Create and Upload Schema.json file
  • Steps to Create Schema Manually
  1. Platform
  2. DIVOC's Verifiable Certificate Features 3.5

How to Create New Schemas

PreviousDIVOC's Verifiable Certificate Features 3.5NextHow to Manage Schemas?

Last updated 2 years ago

Purpose

The purpose of this document is to demonstrate how to create new schemas.

Steps

  • For creating a new schema, the user needs to click on the “Manage Schema” button on the home page.

  • Next, click on “Create Schema” in the next page

  • If the user already has a schema in JSON format, he/she can click on “Upload JSON” (refer to section on "Steps to Create Schema Using JSON" for more details).

  • If the user wants to create a new schema manually click on ‘Add Manually’ (refer to the section on “Create Schema Manually” for more details).

Steps to Create Schema Using JSON

Step 1: Create the context using API call

  • Request method: POST

  • Request URL:{{baseUrl}}/vc-management/v1/context/

  • Request body

  • Key: Files

  • Value: ContextFile.json(should be in json format)

Content for the ContextFile.json

{
    "@context": {
        "@version": 1.1,
        "@protected": true,
        "id": "@id",
        "type": "@type",
        "schema": "https://schema.org/",
        "hp": "https://council.gov.in/credentials/healthProfessional/v1",
        "ProofOfHealthProfessionalCredential": {
            "@id": "schema:ProofOfHealthProfessionalCredential",
            "@context": {
                "@version": 1.1,
                "@protected": true,
                "nonTransferable": "vac:nonTransferable"
            }
        },
        "Person": {
            "@id": "schema:Person",
            "@context": {
                "@version": 1.1,
                "@protected": true,
                "registrationId": "schema:id",
                "name": "schema:name",
                "dob": "schema:date",
                "gender": "schema:gender"
            }
        },
        "HealthProfessional_1": {
            "@id": "hp:HealthProfessional",
            "@context": {
                "@version": 1.1,
                "@protected": true,
                "certificateId": "schema:id",
                "registrationCouncil": "schema:Text",
                "latestQualification": "schema:Text",
                "university": "schema:Text",
                "registrationDate": "schema:date",
                "systemOfMedicine": "schema:Text",
                "registrationExpiry": "schema:date",
                "degreeYear": "schema:Text"
            }
         }    } }

Response Json

  • The Id used here, that is, HealthProfessional_1, should be common in both context file creation, and its multiple occurrences in schema file.

{
    "message": {
        "id": "sunbird-rc.registry.create",
        "ver": "1.0",
        "ets": 1674742182025,
        "params": {
            "resmsgid": "",
            "msgid": "80813191-139c-40a8-918f-060273cbb747",
            "err": "",
            "status": "SUCCESSFUL",
            "errmsg": ""
        },
        "responseCode": "OK",
        "result": {
            "ContextURL": {
                "osid": "1-a6bd2f3b-43d4-406e-a265-917ff6d5199f"
            }
        }
    },
    "url": "http://vc-management-service:7655/vc-management/v1/context/a6bd2f3b-43d4-406e-a265-917ff6d5199f" }

Step 2: Upload Templates

  • Request method: POST

  • Request URL:{{baseUrl}}/vc-management/v1/templates/Tenant

  • Request body

  • Key: Files

  • Value: TempHealthcareUpdated.html (It is the name of html file template)

Refer Annexure A for Sample html File (TempHealthcareUpdated.html)

Response Json

{
    "uploadTemplateResponse": {
        "documentLocations": [
            "Tenant/f28d95e7-17ea-4f93-b457-195d133fbc27/templates/documents/d7390e5b-578a-4823-a7a1-7395d93361b3-vcTempHealthcareUpdated.html"
        ],
        "errors": []
    }
}

Step 3: Create and Upload Schema.json file

  • Create this file and save it in the local directory and upload in the application.

  • The ID used here, that is, HealthProfessional_1 will be used in context file creation.

  • The value of URL from the response of Step 1 will be used in below mentioned schema Json.

  • The value of document location from the response of Step 2 will be used in below mentioned SchemaJson.

SchemaJson Sample File

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "HealthProfessional_1": {
      "$ref": "#/definitions/HealthProfessional_1"
    }
  },
  "required": [
    "HealthProfessional_1"
  ],
  "title": "HealthProfessional_1",
  "definitions": {
    "HealthProfessional_1": {
      "type": "object",
      "title": "HP Certificate",
      "required": [
        "name",
        "dob",
        "registrationId",
        "registrationCouncil",
        "registrationDate",
        "systemOfMedicine",
        "latestQualification",
        "degreeYear",
        "issuer",
        "issuanceDate",
        "certificateId"
      ],
      "properties": {
        "registrationId": {
          "type": "string"
        },
        "certificateId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "dob": {
          "type": "string"
        },
        "gender": {
          "type": "string"
        },
        "registrationCouncil": {
          "type": "string"
        },
        "registrationDate": {
          "type": "string"
        },
        "registrationExpiry": {
          "type": "string"
        },
        "systemOfMedicine": {
          "type": "string"
        },
        "latestQualification": {
          "type": "string"
        },
        "university": {
          "type": "string"
        },
        "degreeYear": {
          "type": "string"
        },
        "issuer": {
          "type": "string"
        },
        "issuanceDate": {
          "type": "string"
        }
      }
    }
  },
  "_osConfig": {
    "uniqueIndexFields": [],
    "ownershipAttributes": [],
    "roles": [],
    "inviteRoles": [
      "anonymous"
    ],
    "enableLogin": false,
    "credentialTemplate": {
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "http://vc-management-service:7655/vc-management/v1/context/6d44d41e-93f8-4d81-8fb5-0679dcae50da"
      ],
      "type": [
        "VerifiableCredential",
        "ProofOfHealthProfessionalCredential"
      ],
      "credentialSubject": {
        "type": "Person",
        "registrationId": "{{registrationId}}",
        "name": "{{name}}",
        "dob": "{{dob}}",
        "gender": "{{gender}}"
      },
      "issuer": "{{{issuer}}}",
      "issuanceDate": "{{issuanceDate}}",
      "evidence": {
        "type": "HealthProfessional_1",
        "certificateId": "{{certificateId}}",
        "registrationCouncil": "{{registrationCouncil}}",
        "latestQualification": "{{latestQualification}}",
        "university": "{{university}}",
        "registrationDate": "{{registrationDate}}",
        "systemOfMedicine": "{{systemOfMedicine}}",
        "registrationExpiry": "{{registrationExpiry}}",
        "degreeYear": "{{degreeYear}}"
      },
      "nonTransferable": "true"
    },
    "certificateTemplates": {
      "html": "minio://Tenant/f28d95e7-17ea-4f93-b457-195d133fbc27/templates/documents/f72b3f6a-c4fe-447e-9684-692f56b81ca9-vcTempHealthcareUpdated.html ",
      "svg": "https://raw.githubusercontent.com/dileepbapat/ref-sunbirdrc-certificate/main/schemas/templates/TrainingCertificate.svg"
    }
  }
}

Steps to Create Schema Manually

The user can opt to create schema manually. The steps are as follows:

  • When a user clicks on “Create New Schema”, the page shown below will open, where the user has to fill the schema name in the “Name of the Schema” box.

  • If required, the user may fill in the description of the schema as well

  • Before moving to the next page, the user must click on ‘Save’ after entering all the information.

  • The user must drag and drop the desired field types to start creating a schema attribute.

  • The user can save an attribute after adding it in the schema by clicking on the ‘Save’ button.

  • After addition, all the attributes that are already present till that point, including the inbuilt attributes of schema, can be viewed.

  • The schema attributes that were added manually can be edited.

  • The user can add more fields in the schema by clicking on “Add Field”.

  • Once all the attributes are added, the schema can be saved as a draft by clicking on “Save as Draft”.

  • The schema draft is created with a default template which holds a QR code only.

  • More templates can be uploaded and managed using the “Upload Templates” & “Manage Templates” modal on the tenant-portal.

All content on this page by is licensed under a .

eGov Foundation
Creative Commons Attribution 4.0 International License
Creative Commons License