Get Verification State

Provides information about the current status of the verification process

sampleGetVerificationState

The sampleGetVerificationState function demonstrates how to retrieve the verification state using the DICE ID SDK. It calls the getVerificationState function to fetch the verification state for a given verification exchange ID.

Parameters:

  • VERIFIER_PRES_EX_ID: The verification exchange ID for which the state needs to be fetched.

API Elements:

  1. diceidsdk.verifier.getVerificationState(): Fetches the verification state for the specified verification exchange ID.

    • VERIFIER_PRES_EX_ID: The verification exchange ID for which the state needs to be fetched.

function sampleGetVerificationState() {
  diceidsdk.verifier.getVerificationState(VERIFIER_PRES_EX_ID)
    .then(resp => console.log("State received:", resp))
    .catch(err => console.log("Error getting state:", err));
}

Running the Code

Step 1: Add the sampleGetVerificationState function to your code. Copy the function code provided and paste it after importing the diceidsdk module.

Step 2: Run the function by invoking it in your code. For example:

sampleGetVerificationState.js

The function will use the getVerificationState API to fetch the verification state for the specified verification exchange ID. The response from the API will be logged to the console as "State received:" followed by the response object.

Last updated