Cria um novo cofre
Gera um novo cofre (svault). A entidade cofre tem um papel semelhante a uma carteira que protege um conjunto de tokens. Cria-se um vault para cada aplicação ou domínio que se quer tokenizar. Um dado tokenizado com um vault só pode ser transformado em original utilizando o mesmo svault, ou seja, o mesmo cofre (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"
}