curl --request GET \
--url https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}', 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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyGet Virtual Key
Get a single virtual key by its Id. The key secret is never returned.
Use this with the 409 VIRTUAL_KEY_ALREADY_EXISTS response from Create Virtual Key, which returns only the existing key’s virtual_key_id in error.details. For example, if a create request times out and the retry returns 409, get the key and check created_by and created_at. If your script created the key during the timed-out request, your script never received the secret. Revoke the key and create it again. Otherwise, the key already existed and can be left in place.
curl --request GET \
--url https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}', 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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAuthorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Workspace identifier (UUID).
Project identifier (UUID).
Virtual key identifier (UUID).
Response
OK
Virtual key identifier.
The last four characters of the virtual key. Use it to identify a key. The full secret is never returned after creation.
Display name of the virtual key.
The type of identity the key is issued to.
user, service_account The user the key is issued to. null when key_type is service_account.
The service account the key is issued to. null when key_type is user.
The workspace the key belongs to.
The project the key is issued for.
Current state of the key. Revoked is permanent.
active, disabled, revoked ISO 8601 UTC.
ID of the caller that created the key.
ISO 8601 UTC. null unless the key is revoked.
ID of the caller that revoked the key. null unless the key is revoked.
Was this page helpful?