Listar Tipos de Documentos
Este endpoint permite listar los tipos de tokens que se pueden validar públicamente por país y el tipo de información que contiene.
Endpoint
POST /api/v1/inmutable/tokens/list-token
Headers
Header | Tipo | Requerido | Descripción |
---|---|---|---|
Secret | string | Sí | Clave secreta de la aplicación. |
ApplicationId | string | Sí | Identificador único de la aplicación. |
Body (application/json)
{
"country": "GT",
"publicKeySoul": "0x2C4e2240Cb9A8DaB6EC3ba7C9917D8f7459303Fa"
}
Respuesta Esperada
{
"status": 200,
"token": [
{
"name": "Bank Statement",
"tokenType": "0xf68d122D7575776DaeB0CD8212D01e64eaE71746",
"description" : "Bank Statement",
"publicKeySoulEmitter": "0xFCe861A6f09A2470E312aa96CFd85F199b4D60B9",
"dataType":"application/pdf",
"tokenValidationCost" : 0.01
},
{
"name": "Loan Payment Settlement",
"tokenType": "0x3d47b26e02ab068e9101131F2f1a99161B85dd2d",
"description" : "Loan Payment Settlement",
"publicKeySoulEmitter": "0xe7f77114ab13607408243510E534754976465662",
"dataType":"image/png",
"tokenValidationCost" : 0.02
},
{
"name": "Electric Utility Bill",
"tokenType": "0xA527FB3C5e1c4b7f3516aD5Cdd4C1De534335a2f",
"description" : "Electric Utility Bill",
"publicKeySoulEmitter": "0xe2f0B8Dd757411b57CE7C07171FDE7b3b990D390",
"dataType":"application/json",
"tokenValidationCost" : 0.1
}
]
}
Detalles de Respuesta para Errores
1. Error 401 - Unauthorized
Este error ocurre cuando no se incluyen los headers necesarios o cuando las credenciales son incorrectas.
Ejemplos de Código
Shell
curl --request POST \
--url https://api-dev.inmutable.app/api/v1/inmutable/list-token \
--header 'Content-Type: application/json' \
--header 'ApplicationId: <Your-Application-Id>' \
--header 'Secret: <Your-Secret-Key>' \
--data '{
"country": "GT",
"publicKeySoul": "0x2C4e2240Cb9A8DaB6EC3ba7C9917D8f7459303Fa"
}'
Node.js
const axios = require('axios');
const data = {
country: 'GT',
publicKeySoul: '0x2C4e2240Cb9A8DaB6EC3ba7C9917D8f7459303Fa',
};
axios.post('https://api-dev.inmutable.app/api/v1/inmutable/list-token', data, {
headers: {
'Content-Type': 'application/json',
'ApplicationId': '<Your-Application-Id>',
'Secret': '<Your-Secret-Key>',
},
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
Python
import requests
url = 'https://api-dev.inmutable.app/api/v1/inmutable/list-token'
headers = {
'Content-Type': 'application/json',
'ApplicationId': '<Your-Application-Id>',
'Secret': '<Your-Secret-Key>',
}
data = {
'country': 'GT',
'publicKeySoul': '0x2C4e2240Cb9A8DaB6EC3ba7C9917D8f7459303Fa',
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;
var client = new HttpClient();
var url = "https://api-dev.inmutable.app/api/v1/inmutable/list-token";
var json = @"
{
""country"": ""GT"",
""publicKeySoul"": ""0x2C4e2240Cb9A8DaB6EC3ba7C9917D8f7459303Fa""
}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("ApplicationId", "<Your-Application-Id>");
client.DefaultRequestHeaders.Add("Secret", "<Your-Secret-Key>");
var response = await client.PostAsync(url, content);
var responseContent = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseContent);
Notas
- El API devolverá los tokens que están disponibles para validar públicamente en el país enviado.