Resources

VNTANA Resource API – Generating QR Codes

API – Generating QR Codes

API Base URL: https://api-platform.vntana.com

For a collection of all Endpoints in our Admin API, view the documentation here. To view the collection of Public Endpoints, view the documentation hereNote: In the following guide and aforementioned documentation, you will see referenced in numerous Endpoints something called a Client. This refers to the workspaces one can create on the Platform within an Organization. The Client nomenclature is a legacy reference being replaced with Workspace.

Required Initial Steps

Before you can generate a QR Code via the API, you will need to Authenticate. Below is a quick summary of the steps involved, see our guide on Authentication to get a more detailed look at the process.

  1. Log in using an Authentication Key or email / password.

    • Returns an x-auth-token in the Response Headers.

  2. Retrieve a list of Organizations and store the needed Organization’s UUID.

    • Pass the x-auth-token from Step 1 in the Request Headers.

      1
      { ‘x-auth-token’ : ‘Bearer ‘ + x_auth_token }
    • This step can be skipped if the Organization UUID is already stored locally.

  3. Generate a Refresh Token for the Organization.

    • Pass the x-auth-token from Step 1 in the Request Headers.

      1
      2
      3
      4
      {
      ‘x-auth-token’ : ‘Bearer ‘ + x_auth_token
      ‘organizationUuid’ : ‘string’
      }
    • Returns the Refresh Token as the Response Header x-auth-token.

  4. Retrieve a list of Workspaces and store the needed UUID.

    • Pass the x-auth-token in the Request Headers.

    • This step can be skipped if the Workspace UUID is already stored locally.

  5. Generate a Refresh Token for the Workspace (Organization Admin / Owner users must skip this step).

    • Pass the Refresh Token from Step 3 in the Request Headers with the Organization and Workspace UUIDs.

      1
      2
      3
      4
      5
      {
      ‘x-auth-token’ : ‘Bearer ‘ + refreshToken,
      ‘organizationUuid’ : ‘string’,
      ‘clientUuid’ : ‘string’
      }
    • Returns the Refresh Token as the Response Header x-auth-token.

The Workspace UUID needs to be retrieved, if it is not stored locally or already retrieved via Authentication, you can search for the Workspace using the API. This endpoint will return a list of Workspaces in the Organization and you can verify the correct one using the name or slug. Below is an example of this endpoint.

The Request structure is as follows:

1
2
3
Method: GET
Endpoint: /v1/clients/client-organizations
Headers: { ‘x-auth-token’ : ‘Bearer ‘ + refreshToken}

The Response structure is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
“success”: true,
“errors”: [],
“response”: {
“totalCount”: 1,
“grid”: [
{
“uuid”: “string”,
“slug”: “some-client-slug”,
“name”: “Some Client,
“role”: “ORGANIZATION_ADMIN”,
“imageBlobId”: “string”,
“created”: “2020-01-31T19:17:23.972”
}
]
}
}
Triggering Generation

In addition to the QR code housed within the VNTANA Viewer, there is also a QR code image that can be generated which is found within the Attachments section of an Asset. This QR code can be manually generated for an Asset via a ‘Generate QR Code’ button in the attachments section as shown below:

It is also possible to generate this QR Code via the API. To do this, you can simply call the following endpoint:

1
2
3
4
5
6
Method: POST
Endpoint: /v1/products/{productUuid}/qr-code/generate
Headers: {
‘x-auth-token’ : ‘Bearer ‘ + refreshToken,
‘organizationUuid’ : ‘some-org-uuid’
}

If the generation is successful, will always be:

1
2
3
4
5
{
“success”: true,
“errors”: [],
“response”: {}
}

The QR code is also available to download via the API. It’ll always have qrCode_ as a prefix in the name, however keep in mind it is possible to generate multiple QR codes for the same Asset, though they will be the same. Visit this guide to learn about downloading attachments.

Errors

PRODUCT_NOT_FOUND

Occurs when the productUuid does not exist within the given organizationUuid.

MISSING_ASSET

Occurs when the productUuid is for an Asset with no file associated with it. Other attachments do not count as assets.

On This Page

Accelerate Your
Digital Transformation

Learn how our platform can automate your 3D process.

Tap the magnifying glass to the left of your screen to search our resources.