Published using Google Docs
Qryptal-Vqode2-API
Updated automatically every 5 minutes

Qryptal Validation Codes Web Service API 2.0

1 Introduction

The API is based on industry standard REST principles and uses secure tokens based on RFC 7519 for representing claims securely between two parties.

 Note regarding this Document

This API and documentation for developers to start working on applications. Do check back regularly on this document for updates.

Please note the tokens illustrated here are for demo purposes and subject to expiry. Please use the tokens provided by Qryptal for your development. Sign up for a trial account at Qryptal or contact support@qryptal.com to request for test tokens, if you have not already received it.

2 Getting Started

3 Types of Qryptal Codes

4 Listing of Codes

https://api2test.qryptal.com/v2/Vqodes?token=[PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q

5 Creating a Qryptal Secure QR Code

The figure below shows a detailed illustration of the API Payload structure

To create a Qryptal Code::

       {

    },

}

The data and its corresponding format must be supplied for each data. Please note that all values in the data object must be formatted as strings. The format object is used to indicate how the data is to be displayed on the mobile device when the QR is scanned. In the above example. “t2” format indicates a basic key- value pair display.

:

{

    "id": 60167,

    "ct": "2020-04-24T06:36:18.935949Z",

    "status": "C",

    "msg": "success",

    "vqtype": "PDC",

    "uid": "1097580178100010000601672116",

    "code_token": "C02:rFKsq1dyUmJZZFNze1JrUmJolWaVYmppY5RibmdpnW6ampRinHFplGiUkpWRZWFqZ5eZa5SSYmZlkm5ua2xnZ5qcaWGSlJNkk2JmaJRknGtUXVOlo5eYoJlaamJoZFOblamQmZRSamdhrg==",

    "qrurl": "https://api2test.qryptal.com/v2/Vqodes/1097580178100010000601672116/qr1097580178100010000601672116.png?code_token=C02:rFKsq1dyUmJZZFNze1JrUmJolWaVYmppY5RibmdpnW6ampRinHFplGiUkpWRZWFqZ5eZa5SSYmZlkm5ua2xnZ5qcaWGSlJNkk2JmaJRknGtUXVOlo5eYoJlaamJoZFOblamQmZRSamdhrg==",

    "apitype": "G",

    "scheme": "C02",

    "qr_text": "C02::1097580178100010000601672116:1.4MBT$NE$QV7.SP351NAJAJIM9 IEX6%ZBF0.J9KEMYXYRN-11-11-:HDP4Z5N5JX$XV+H./.AMBU**.XH6OE3 %*.HG59W6.1XU6Y-A9OQ%U/XUWEILY*4B3VAOCJ%Q$T2M5WLM6G.N5FHXUJ*3KZ:QGMCU79CF5DH /A9A Q /HE.JAE3A*NJBB5//P+Y%KPAJYL4*N2QDN1CGXLC3U4869B8A/RM.IBT4BNMJV.WP.*7XJ0$9VVN8C4II/3NW6OTHG911YG6TAFFY7I6E06K4KCB"

}

At the bottom of the page, enter the payload string to try. You’ll get the JSON response. 

Code Creation Status:

6. Downloading the QR Image

{

    "id": 60167,

    "ct": "2020-04-24T06:36:18.935949Z",

    "status": "C",

    "msg": "success",

    "vqtype": "PDC",

    "uid": "1097580178100010000601672116",

    "code_token": "C02:rFKsq1dyUmJZZFNze1JrUmJolWaVYmppY5RibmdpnW6ampRinHFplGiUkpWRZWFqZ5eZa5SSYmZlkm5ua2xnZ5qcaWGSlJNkk2JmaJRknGtUXVOlo5eYoJlaamJoZFOblamQmZRSamdhrg==",

    "qrurl": "https://api2test.qryptal.com/v2/Vqodes/1097580178100010000601672116/qr1097580178100010000601672116.png?code_token=C02:rFKsq1dyUmJZZFNze1JrUmJolWaVYmppY5RibmdpnW6ampRinHFplGiUkpWRZWFqZ5eZa5SSYmZlkm5ua2xnZ5qcaWGSlJNkk2JmaJRknGtUXVOlo5eYoJlaamJoZFOblamQmZRSamdhrg==",

    "apitype": "G",

    "scheme": "C02",

    "qr_text": "C02::1097580178100010000601672116:1.4MBT$NE$QV7.SP351NAJAJIM9 IEX6%ZBF0.J9KEMYXYRN-11-11-:HDP4Z5N5JX$XV+H./.AMBU**.XH6OE3 %*.HG59W6.1XU6Y-A9OQ%U/XUWEILY*4B3VAOCJ%Q$T2M5WLM6G.N5FHXUJ*3KZ:QGMCU79CF5DH /A9A Q /HE.JAE3A*NJBB5//P+Y%KPAJYL4*N2QDN1CGXLC3U4869B8A/RM.IBT4BNMJV.WP.*7XJ0$9VVN8C4II/3NW6OTHG911YG6TAFFY7I6E06K4KCB"

}

https://api2test.qryptal.com/v2/Vqodes/1018345252100010000031878642/qr1018345252100010000031878642.png?code_token=C02%3ArFKkrFVuV2NXXlNze1JrUpFhZGlpZnGZmm2XlWhnZG6WaZtibZNmlGiSYmJmZWCSaGhwZ21nZ2VqaZdslG1ok2yTYWRik2hkaGFklmxocG9aYlaho5eQoZdWb2NmXlOblamQmZRSamFkrg%3D%3D&token=[PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q

https://api2test.qryptal.com/v2/Vqodes/1018345252100010000031878642/qr1018345252100010000031878642.png?code_token=C02%3ArFKkrFVuV2NXXlNze1JrUpFhZGlpZnGZmm2XlWhnZG6WaZtibZNmlGiSYmJmZWCSaGhwZ21nZ2VqaZdslG1ok2yTYWRik2hkaGFklmxocG9aYlaho5eQoZdWb2NmXlOblamQmZRSamFkrg%3D%3D&token=[PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q&bg=0

https://api2test.qryptal.com/v2/Vqodes/1018345252100010000031878642/qr1018345252100010000031878642.png?code_token=C02%3ArFKkrFVuV2NXXlNze1JrUpFhZGlpZnGZmm2XlWhnZG6WaZtibZNmlGiSYmJmZWCSaGhwZ21nZ2VqaZdslG1ok2yTYWRik2hkaGFklmxocG9aYlaho5eQoZdWb2NmXlOblamQmZRSamFkrg%3D%3D&token=[PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q&s=4

By default ,the image size returned is equal to s=5. The recommended minimum size is s=3

7. Test/Verify the QR code created

Test the QR Code image created. Scanned using your mobile phone verify.demo-university.com or download the  QR Validator app available on the same page.  E.g on the IOS App:

8. EDC Codes

The following sections work with EDC Tokens Only. Please contact support@qryptal.com to request for test tokens if you have not received them.

Secure EDC QR Codes provide the ability to store a lot of data including attachments  (See “Types of Qryptal Codes” ). They also provide for the ability to revoke a code.

Currently, there are two versions of the JSON payload that can be sent when generating

8.1. Version 1: With Code Attachments (available only for EDC codes):

     {

}

$ curl -H "Authorization: Token <token>" -H "Content-type: multipart/form-data" -F "payload=`cat QDemoJSONpayload.json`" -F 'img1=@Profile.jpg' -F 'file1=@Amazon-CaseStudy.pdf' -F 'file2=@Amazon10K.pdf' -X POST  https://api2test.qryptal.com/v2/Vqodes

{"id":3192,"ct":"2017-10-20T09:51:29.371913Z","status":"C","msg":"success","vqtype":"EDC","uid":"1018363089100010000031924078","code_token":"C02:rFKkrFVwVWJaZVNze1JrUmhpkWRjl5qVmGlnbmJiYmtsbGRhbJ1iY5JplmBnZmFlaWVulGWRbZmSkpduZZtkZJubkmBlaGdhlWWTaWNqbGJWXFmno5eQoZdYbWFpZVOblamQmZRSamFkrg==","qrurl":"https://api2test.qryptal.com/v2/Vqodes/1018363089100010000031924078/qr1018363089100010000031924078.png?code_token=C02:rFKkrFVwVWJaZVNze1JrUmhpkWRjl5qVmGlnbmJiYmtsbGRhbJ1iY5JplmBnZmFlaWVulGWRbZmSkpduZZtkZJubkmBlaGdhlWWTaWNqbGJWXFmno5eQoZdYbWFpZVOblamQmZRSamFkrg==","apitype":"G"}

8.2.  Larger Text, Separation of Display Format and Data with EDC

{

}

         

8.3 Code revocation (available only for EDC codes)

To revoke a code, use the following GET API:

https://api2test.qryptal.com/v2/Vqodes/<uid>/revoke?token=<token>&code_token=<code_token>

This returns  success in JSON format as follows:

{

}


Appendix A:

Data Types:

Here’s an example to illustrate data types available:

JSON Payload used to generate QR:

{

"data":{

    "Name":"Jack Smith",

    "Account":"9939399",

    "Transactions":"",

    "Transaction_Log":[

        [["18-Mar", "CR", "500.00"], ["Cash Deposit"]],

        [["25-Mar", "CR", "12800.00"], ["Salary J.P. Morgan Chase"]]

        ],

     "PhotoCard":[ ["Jack Smith","22-Mar-1980","Melbourne",""],["/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABygAwAEAAAAAQAAACMAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIACMAHAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eo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3Unk1NUcf3BUlAH/9k="]]

    },

"format":{

    "header":"Use Document Validator App",

    "fields":[

        {"Name":{"type":"t2"}},

        {"Account":{"type":"t2"}},

        {"Transactions":{"type":"t2", "m":"b"}},

        {"Transaction_Log":{"type":"1l3-2l1"}},

        {"PhotoCard":{"type":"4T1P"}}

        ],

    "version":"1"

    },

"scheme":"C02"

}

This generates a QR with the display as follows:

The data  format types used above are overlaid in red and explained below

1) "t2"  - 2 column key: value display

e./g: Name: Jack Smith

2) “t2” with bold

{"type":"t2", "m":"b"}},

E.g: Transactions  (here only key field is given and the value field left blank), “m”: “b” indicates bold

3) 1l3-2l1  ("l" is the small letter L)

- 3 columns with a line of text below in small font. All text left aligned

4) "4T1P" - Photocard

- Row with 2 columns

-  1st column up to 4 lines of text on the left (left aligned),

-  2nd column with a photo on the right column

Note: Photo image has to be sent in base64 as part of the payload with type stripped off e.g “data:image/png;base64,” removed

Appendix B:

B-1. Using ModHeader Extension with Chrome Browser

This provides a way to try out the API directly on the Chrome Browser. To try out the API please use the API Browser by following these steps:

1. Open Google Chrome browser and install the "Mod Header" extension:        

https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en

 2. In Mod Header import this profile:

{"title":"Vqode2 APITest","hideComment":true,"headers":[{"enabled":true,"name":"Authorization","value":"Token [PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q","comment":""}],"respHeaders":[{"enabled":true,"name":"","value":"","comment":""}],"filters":[{"enabled":true,"type":"urls","urlPattern":"https://api2test.qryptal.com/*"}],"appendMode":true}


3. Visit: https://api2test.qryptal.com/v2/Vqodes

- This PHP App uses  exactly the same API as detailed in this documentation and will guide developers.  The page will show all the codes created and if you scroll down, you can create the codes by clicking on the POST button below:

Each POST will generate the code which can be viewed by downloading the image url as in Section 4

This extension is suitable to try out creating codes that do not have attachments. For attachments please use the  Postman app.

B.2 Using Postman App

The Postman app. Is a versatile app that lets you easily try out the APIs especially when creating codes with Code Attachments.


Appendix C:

For Developers:

Sending Authentication Token via Header

For ease of development the token here are a couple of suggested tools to send the Authorization Request Header:

1)  With the help of browser tools such as ModHeader (Chrome) and ModifyHeaders (Firefox) , this header can be sent with every request.

2) Using the command line utility  curl:

#Get list

curl -H "Authorization: Token [PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q" -H "Content-type: application/json" https://api2test.qryptal.com/v2/Vqodes

#Make Vqode

curl -H "Authorization: Token [PDC]eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrc3AiOjAsInR0IjoiRTEiLCJvcmdfaWQiOjExLCJrMSI6IkRXaWI1WDhJVjNJNGV6SDA1VzF2TGsiLCJha2lkIjoxLCJleHAiOjIyODMxNzAzNDQsInZxdHlwZSI6IlBEQyJ9.-6EPuBRQTBdbsJlAJnixSgupSdbPUn661t2OHWhet6Q" -H "Content-type: multipart/form-data" -F 'payload={"data":{"Name":"Jack Smith", "Maths":"99"}, "format":{"version":"1", "fields":[{"Name":{"type":"t2"}}, {"Maths":{"type":"t2"}}]}}' -X POST  https://api2test.qryptal.com/v2/Vqodes

 

3) Use Postman app to assist in testing and development. See Appendix B-2 on how to use the Postman app for API testing and development


Appendix D:

If you have received a postman collection, please follow the below steps to try and get to know more about our APIs.

  1. Save the Postman collection into a folder or any location according to your preference.
  2. Open the Postman app and import the postman collection as shown below,

  1. In the next dialog box, click the “Choose Files” button,


  1. You can see your imported collection at the left pane of the postman app.

  1. Open the collection and update the tokens generated for your organization, as displayed in the below screenshot,

  1. To run the collection, expand the json collection that was imported earlier and try the requests as per the steps below,
  1. To Generate the QR image (EDC/PDC),
  1. Click on any one of the “Generate” post requests (Generate-Demo-BillQR-EDC/ GenerateHospBillSampleQR-PDC / Generate-HospBillSampleQR-EDC) and send the request.
  2. When a successful response is received, click the “Get QR image “ request and click on “Send” to view the QR image generated.
  3. Scan the generated QR with the validator app to verify data.
  1. To Update the data for a generated QR (EDC)
  1. Click on any either one of the EDC Generate (Generate-Demo-BillQR-EDC / Generate-HospBillSampleQR-EDC) requests.
  2. When a successful response is received, click to open the “Update QR-EDC -Add ReportPDF” request, go to the body parameter of the request and upload a sample file for stamping.
  3. Click “Send” to update the QR.
  4. You can verify the update request by sending the “Get QR image“ and scanning the QR code generated, the uploaded file will be displayed in the validator app.
  1. To Revoke a QR,
  1. Revoking a QR code is only applicable for EDC codes and not for PDC.
  2. Click on any either one of the EDC Generate (Generate-Demo-BillQR-EDC / Generate-HospBillSampleQR-EDC) requests.
  3. When a successful response is received, execute the “Revoke API Test” request.
  4. Upon receiving a success response, execute the “Get QR image”, scan this QR with the validator app, you will see a “Code Revoked” alert on the screen.

Qryptal Verify Codes API 2,  Document ver 2.3.0420                                                  of