createScenario

createScenario

This method creates a new scenario based on the provided details.

Parameters

  • name (string, required): The name of the scenario.
  • description (string, nullable): A brief description of the scenario.
  • message (string, nullable): An optional message associated with the scenario.
  • isIdentityWidgetScenario (boolean, nullable): Indicates whether this scenario is an identity widget scenario.
  • type (string, required): The type of scenario. Possible values are ChallengeQuery, OnChainZKP, OffChainZKP.
  • projectId (string, nullable): The ID of the project to which the scenario belongs.
  • vcsIncluded (string[], nullable): An array of verifiable credentials included in the scenario.

Returns

A JSON object containing the details of the newly created scenario.

Usage Example

const axios = require('axios');
let data = JSON.stringify({
  "name": "string",
  "description": "string",
  "message": "string",
  "isIdentityWidgetScenario": true,
  "type": "ChallengeQuery",
  "projectId": "string",
  "vcsIncluded": [
    "string"
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.nexera.id/compliance/scenarios',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json', 
    'Authorization': 'Bearer <TOKEN>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});