Defining the credential

At the definition stage you will define:

  • The name of the credential.
  • The schema for the credential.
  • The format and structure of the credential - Yoti currently supports, Text (single line), JPEG, PNG and JSON object.
  • Who can issue the credential.
  • Who can retrieve the credential.

You will need to create the definition, using the Yoti SDK. This is a one-time process which will be used and referenced for every credential issuance.

Once you have added the Yoti SDK dependency to your project, you can use it to build and send your request. See the code snippets below for examples of how to construct the request.

Javascript
Java
PHP
Python
C#
Go
Ruby
Copy
ParameterDescription
sdkIdsdkId is the SDK_ID found with your Yoti Hub Application
keyPairThe PEM file which is found with your Yoti Hub Application. The PEM file is required to allow the SDK to perform the authentication with the Yoti API.

Example payload

JSON
Copy

See below for explanation of example payload:

ParameterDescriptionOptional
NameThis is the name of the credential. This is what will appear on the users Yoti app.
MimeTypeThis will declare what type of credential you want. We currently support: text/plain, application/JSON, image/png, image/jpeg.
Icon

This is the icon that will be presented to a user during the Yoti App share. It will also appear in the sharing receipts.

The icon must be at least 112px and smaller than 512kb.

localesA list of localisation values. The name will be the display name of the credential. InfoUri is optional and can be pointer to a page that has a description or more information about your credential
authz

This is where you define who will be allowed to request or issue a credential.

This should be in a Yoti SDK ID or Organisation ID.

By supplying the credential in the format of a JSON object, this will allow you to bundle multiple pieces of information together in a single credential request. As an example, you could ask for the credential Employee Number. If this is supplied via a JSON object, within that credential can also contain various other bits of information such as name, email address, access level etc.

Example response

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard