Crear una nueva cámara acorazada

Genera una nueva bóveda (svault). La entidad bóveda desempeña un papel similar al de una cartera que protege un conjunto de tokens. Se crea una bóveda para cada aplicación o dominio que se desee tokenizar. Los datos tokenizados con una bóveda sólo pueden transformarse en el original utilizando la misma bóveda.

Punto final: /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);
});

Respuesta

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