Making Requests

Create a Certificate Authority

const payload = {
    wa : "wallet_address", 
    admin_email : "admin_email" 
}

createCA(payload)
  .then(response => console.log('CA Created:', response))
  .catch(error => console.error('Error creating CA:', error));

Payload elements

NameTypeDescription

wa

string

wallet address

admin_email

string

registered email address of the account admin

Create Certificate Templates

const payload = {
  cid: 'cid_value', 
  name: 'template_name',
  waAdmin: 'waAdmin_value', 
  frontendProps: {
    components: [
      {
        id: 'component_id'
        ...
        type: 'text',
      }
    ],
    currentLayout: 'current_layout'
  }
}

createTemplate(payload)
  .then(response => console.log('Template Created:', response))
  .catch(error => console.error('Error creating template:', error));

Payload Elements

NameTypeDescription

cid

string

CA identifier

name

string

Name of the Template

wa

string

CA wallet address

frontendProps

object

frontend elements and attributes of the certificate schema. Contains components object and current_layout array

components

object

contains all the visual and atribute elements of the certificate

CurrentLayout

string

type of certificate visual format (card, badge, vertical A4, horizontal H4)

Component Object Elements

NameTypeDescription

id

string

type

string

inputType

string

content

string

styles

object

className

string

placeholder

string

src

string

text

string

name

string

value

string

isActive

boolean

isDraggable

boolean

x

number

y

number

baseText

(string | undefined)[]

originalText

string

maxCharacters

string

minCharacters

string

isMandatory

boolean

Styles Object Elements:

NameTypeDescription

width

string

height

string

color

string

backgroundColor

string

fontSize

string | number

fontWeight

string

textAlign

string

fontFamily

string

isItalic

boolean

isBold

boolean

isUnderlined

boolean

letterSpacing

string

previousWidth

number

warp

number

cursor

string

Issue Certificates

const payload = {
  cid: 'cid_value', 
  tid: 'tid_value', 
  waAdmin: 'waAdmin_value', 
  data: [{ key: 'value' }], 
  email: 'user@domain.com', 
};
createCredentials(payload)
  .then(response => console.log('Credentials Created:', response))
  .catch(error => console.error('Error creating credentials:', error));

Payload Elements

NameTypeDescription

cid

string

CA identifier

tid

string

Template identifier

waAdmin

string

CA wallet address

data

dictionary

object with data to be stored in the credential (in the format of a list of "key": "value" pairs)

email

string

recipient person email address

Verify Certificates

const payload = {
  tid: 'tid_value', 
  id: 'id_value', 
  guid: 'guid_value', 
};

verifyCredentials(payload)
  .then(response => console.log('Verification URL:', response))
  .catch(error => console.error('Error verifying credentials:', error));

Payload Body

NameTypeDescription

id

string

Certificate identifier

tid

string

Template identifier

guid

string

a unique identifier for the verification session and is returned in the init method

Last updated