Programmatic API Documentation

This documentation should be used to create wallets and issue and manage credentials on the Dentity platform. To obtain an API key, a Dentity business account is required.  Easy sign up is located here.  A user guide and instructions on how to test the Dentity API using Postman are located at the end of this document.

 

Create Wallet 

Description: This is the first step in the process.  A Dentity wallet must be created before any credentials can be issued to the wallet holder.  If the user already has a Dentity wallet, the API will return the wallet ID.

POST – https://api.dentity.com/core/api/v1/programmatic/wallet

  • Request parameters

Field

Description

Data type

Required

firstName

User’s first name

String

true

lastName

User’s last name

String

true

email

User’s email

String

true

phoneNumber

User’s phone

Object

 

phoneNumber[dialCode]

The country calling code

String

true

phoneNumber[phone]

Phone number

String

true

Example(JSON):

{

    “phoneNumber”: {

        “phone”: “4373735492”,

        “dialCode”: “+1”

    },

    “firstName”: “Test”,

    “lastName”: “Pham”,

    “email”: “dentity@gmail.com”

}

  • Response
 

Status

Description

Data

200

Create a new wallet successfully. User wallet address will be returned.

{

   walletId: “62ccf87d452c6c3ab43a815e”

}

400

Occurs when a phone number or email already exists in the Dentity system or when the wrong data type is entered.

{

   message: “User email or phone number already exists or wrong data type”

}  

500

Internal server error

Please contact the Dentity system administrator as soon as possible

 

Issue Credential

 

Description: Issues a credential from a previously defined template.  Credential templates can be created in your Dentity business account or by using the Dentity API.

Link: https://business.dentity.com/

API to be used from wallet link https://www.dentity.com

POST – https://api.dentity.com/core/api/v1/programmatic/credential

 
  • Request parameters

Field

Description

Data type

Required

walletId

User’s wallet address

String

true

credentialTemplateId

Template ID

String

true

credentialExpiration

Credential expiration.
NOTE: It must be greater than the current date and less or equal than template expiration.

Number (Unix time) or null

true

any

Fields based on “customFields” Credential Template 

String

false

Example:

{

     “credentialTemplateId”: “632464658247420011f419d7”,

    “walletId”: “633a4f1f80afad0011758b0f”,

    “credentialExpiration”: null

}

  • Response

Status

Description

Data

200

Issue credential successfully

Update later

400

Occurs when a phone number or email already exists in the Dentity system or when the wrong data type is entered.

{

   message: “User email or phone number already exists or wrong data type”

}

500

Internal server error

Please contact Dentity system administrator as soon as possible

 

Create Template

 

Description: Creates a new credential template.

POST – https://api.dentity.com/core/api/v1/programmatic/credential/template

  • Request parameters

Field

Description

Data type

Required

logoId

Image template

String

true

templateName

Template name

String

true

customFields

Field when you want to add in attribute field

Array

true

descriptions

Description for customFields

Array

true

credentialExpiration

Date and time credential expires

String

true

credentialIssuer

Credential issuer name

String

true

credentialType

Credential name

String

true

numberOfCredentials

Limit total credentials can be issued

Number | Null

true

            Example:

{

    “logoId”: “62da1187c59c560011659752”,

    “templateName”: “Template Tracy pro 1”,

    “customFields”: [

        “holderFullNamePopulatedAtIssuance”,

        “hello”,

        “hello2”,

        “hello3”,

        “hello4”

    ],

    “descriptions”: [

        “Holder Full Name (Populated at Issuance)”,

        “Hello”,

        “Hello 2”,

        “Hello 3”,

        “Hello 4”

    ],

    “credentialExpiration”: “null”,

    “credentialIssuer”: “Tracy pro”,

    “credentialType”: “Credential pro”,

    “numberOfCredentials”: null

}

  • Response

Status

Description

Data

200

Create credential template successfully

Update later

400

Input wrong data type or template name has existed

Update later

500

Internal server error

Please contact Dentity system administrator as soon as possible

 

Get Credential Detail

 

Description: Fetches credential details.

GET – https://api.dentity.com/core/api/v1/programmatic/credential/:id

  • Request parameters

Field

Description

Data type

Required

id

Credential ID

String

true

 

Get Template

 

Description: Fetch a credential template definition by template ID.

GET – https://api.dentity.com/core/api/v1/programmatic/credential/template/:id

  • Request parameters

Field

Description

Data type

Required

id

Template ID

String

true

 

Get All Templates

 

Description: Fetch all credential templates. 

GET – https://api.dentity.com/core/api/v1/programmatic/credential /template

  • Request query parameters

Field

Description

Data type

Required

page

Each page

String

false

pageSize

Total items each page

String

false       

 

Delete Template

 

Description: Delete a credential template by template ID.

DELETE – https://api.dentity.com/core/api/v1/programmatic/credential /template/:id

  • Request parameters

Field

Description

Data type

Required

id

Template ID

String

true

  • Response

Status

Description

Data

200

Delete a credential template successfully

 

400

Input wrong data

 

500

Internal server error

Please contact Dentity system administrator as soon as possible

 

Delete Credential in Wallet

 

Description: Deletes a credential by ID. 

DELETE – https://api.dentity.com/core/api/v1/programmatic/credential /:id

  • Request parameters

Field

Description

Data type

Required

id

Credential ID

String

true

  • Response

Status

Description

Data

200

Delete a credential successfully

 

400

Input wrong data

 

500

Internal server error

Please contact Dentity system administrator as soon as possible

 

Wallet and Credential API – User Guide

 

Step 1. Register for a Dentity Business Account 

To get an API key, you must have a Dentity business account.  You can sign up for an account here

 

 

Step 2. Create a Credential Template in Dentity Business Account

After a business account has been created, a credential issuer will need to create a valid template before you can get an API key.

  • On main page, select “Issue and Verify Credentials”
  • In the top navigation bar, select “Credentials”
  • Click on “Create New Credential”
  • Now, the issuer will need to create a credential template.  Fill in all required fields and add any custom data fields to your credential.  Select “Create Credential” after you’ve finished 

 

 

Step 3. Get an API key 

After a credential template has been successfully created, click “Issue Credential.”  Click “Get API Key” to get your API key.  You can copy your API key using the copy icon.

 

 

Example API Key: 

Abaa9efd67b95d9b731e700a264ecc8fb6e4e6fd414a98a786d26e0e365469aa406eed089773901d234d125…..

 

Step 4. Test in Postman 

For instructions on how to test the Dentity API using Postman, click here.