updateScenario

updateScenario

This method updates a specific scenario by its scenarioId.

Parameters

scenarioId (string, required): The unique identifier of the scenario to update.

Returns

A JSON object representing the updated scenario, containing:

  • input (object, required): An object containing the updated scenario details.
    • name (string, required): The name of the scenario.
    • description (string, nullable): A description of the scenario.
    • message (string, nullable): An optional message associated with the scenario.
    • isIdentityWidgetScenario (boolean, nullable): Indicates if the scenario is related to an identity widget.
    • queryConfigurations (object[], required): An array of query configurations.
    • smartContractDeployments (object[], required): An array of smart contract deployments.
    • type (string, required): The type of the scenario. Possible values are ChallengeQuery, OnChainZKP, OffChainZKP.
    • projectId (string, nullable): The ID of the project associated with the scenario.
    • vcsIncluded (string[], nullable): An array of Verifiable Credentials (VCs) included in the scenario.

Usage Example

const axios = require('axios');
let data = JSON.stringify({
  "input": {
    "name": "string",
    "description": "string",
    "message": "string",
    "isIdentityWidgetScenario": true,
    "queryConfigurations": [
      {
        "id": "string",
        "query": {
          "type": "IDInformation",
          "requestId": 0,
          "attribute": "string",
          "value": true,
          "operator": "$noop"
        }
      }
    ],
    "smartContractDeployments": [
      {
        "id": "string",
        "contractName": "ScenarioVerifier",
        "status": "DeploymentStarted",
        "version": "string",
        "scenarioId": "string",
        "projectId": "string",
        "address": "string",
        "transactions": [
          {
            "id": "string",
            "actionName": "ScenarioDeploy",
            "status": "TxPosted",
            "smartContractDeploymentId": "string",
            "txHash": "string",
            "blockNumber": 0,
            "timestamp": 0,
            "errorMessage": "string"
          }
        ],
        "errorMessage": "string"
      }
    ],
    "type": "ChallengeQuery",
    "projectId": "string",
    "vcsIncluded": [
      "string"
    ]
  }
});

let config = {
  method: 'patch',
  maxBodyLength: Infinity,
  url: 'https://api.nexera.id/compliance/scenarios/:scenarioId',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json'
  },
  data : data
};

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