Lista de llaves
Lista las claves y otros objetos de la cuenta.
Punto final: /api/key
API_TOKEN="Place here your API Token"
curl -X GET "https://service.dinamonetworks.io/api/key" -H "accept: application/json; charset=utf-8" -H "X-Api-Key: ${API_TOKEN}"
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://service.dinamonetworks.io/api/key")
.method("GET", null)
.addHeader("X-Api-Key", "Place here your API Token")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://service.dinamonetworks.io/api/key");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("X-Api-Key", "Place here your API Token");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://service.dinamonetworks.io/api/key"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
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/key",
"method": "GET",
"timeout": 0,
"headers": {
"X-Api-Key": "Place here your API Token"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Respuesta
[
{
"id": "51H4CcfRBUHHJz2i",
"label": "acmek",
"type": "key",
"code": "rsa2048",
"certificates": [
{
"id": "17OXcrb4uQDAoUsE",
"label": "acmec",
"type": "x509",
"md": "7db3f4d1a3",
"created": "2021-06-24T17:45:29Z"
}
],
"md": "7db3f4d1a3",
"created": "2021-06-24T17:45:29Z"
},
{
"id": "2kcQDrtZkGUc6Mhl",
"label": "mykey",
"type": "key",
"code": "rsa2048",
"md": "46af2f63de",
"created": "2021-07-15T20:12:52Z"
},
{
"id": "5cPnBroZ64WOu5Vn",
"label": "prodkey",
"type": "key",
"code": "rsa2048",
"md": "46dd9d8de0",
"created": "2021-08-13T20:14:34Z"
}
]