Create a new safe

It generates a new vault (svault). The vault entity plays a role similar to a wallet that protects a set of tokens. A vault is created for each application or domain to be tokenized. Data tokenized with a vault can only be transformed into the original using the same svault.

Endpoint: /api/svault

API_TOKEN="Place here your API Token"

curl -X POST "https://service.dinamonetworks.io/api/svault" -H  "accept: application/json" -H  "X-Api-Key: ${API_TOKEN}" -H  "Content-Type: application/json" -d '{"label":"name-your-vault"}'
var settings = {
  "url": "https://service.dinamonetworks.io/api/svault",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "X-Api-Key": "Place here your API Token"
  },
  "data": JSON.stringify({
    "label": "myvault"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var client = new RestClient("https://service.dinamonetworks.io/api/svault");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("X-Api-Key", "Place here your API Token");
var body = @"{" + "\n" +
@"    ""label"": ""myvault""" + "\n" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://service.dinamonetworks.io/api/svault"
  method := "POST"

  payload := strings.NewReader(`{
    "label": "myvault"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-Api-Key", "Place here your API Token")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var settings = {
  "url": "https://service.dinamonetworks.io/api/svault",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "X-Api-Key": "Place here your API Token"
  },
  "data": JSON.stringify({
    "label": "myvault"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Response

{
    "message": "SVault created successfully!!!",
    "id": "5fABrs5zuf9tWut9"
}