Rotate API access key
curl --request POST \
--url https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'x-organization-id: <x-organization-id>'import requests
url = "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate"
headers = {
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-organization-id': '<x-organization-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-organization-id: <x-organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"keyType": "user_bound",
"boundEmail": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"*"
],
"secret": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Access Keys
Rotate API access key
Revokes the existing secret access key value and issues a replacement for the same API access key credential name, type, and scopes. The new secret access key value is returned only once.
POST
/
access-keys
/
{id}
/
rotate
Rotate API access key
curl --request POST \
--url https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'x-organization-id: <x-organization-id>'import requests
url = "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate"
headers = {
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-organization-id': '<x-organization-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-organization-id: <x-organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"keyType": "user_bound",
"boundEmail": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"*"
],
"secret": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Ủy quyền
Phản hồi
201 - application/json
Trang này có hữu ích không?

