get__organization_{orgId}_key
Last updated
Was this helpful?
Was this helpful?
public getOrgKeys = async (idOrg: string): Promise<GetOrganizationKeysResponse> => {
return this.makeRequest<GetOrganizationKeysResponse>(`organization/${idOrg}/key`, 'GET');
};# You can also use wget
curl -X GET https://backend.flashback.tech/organization/{idOrg}/key \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'GET https://backend.flashback.tech/organization/{idOrg}/key HTTP/1.1
Host: localhost:3000
Accept: application/json
Authorization: Bearer {access-token}const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/organization/{idOrg}/key',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://backend.flashback.tech/organization/{idOrg}/key',
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://backend.flashback.tech/organization/{idOrg}/key', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('GET','https://backend.flashback.tech/organization/{idOrg}/key', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/organization/{idOrg}/key");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{})
req, err := http.NewRequest("GET", "https://backend.flashback.tech/organization/{idOrg}/key", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}{
"success": true,
"data": [
{
"id": "key-123e4567-e89b-12d3-a456-426614174000",
"orgId": "org-123e4567-e89b-12d3-a456-426614174000",
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7VJTUt9Us8cKBwT1L6O5VfwlrP0xP2B5iZvr5Xq5BwL1K2Y3...\n-----END PUBLIC KEY-----",
"createdAt": "2024-01-15T10:30:00.000Z",
"nodeKeys": [
{
"keyId": "key-123e4567-e89b-12d3-a456-426614174000",
"nodeId": "192.168.1.100"
},
{
"keyId": "key-123e4567-e89b-12d3-a456-426614174000",
"nodeId": "192.168.1.101"
}
]
},
{
"id": "key-987fcdeb-51a2-43d7-8f9e-123456789abc",
"orgId": "org-123e4567-e89b-12d3-a456-426614174000",
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9XKSUv0Vt9dLcxwT2M7P6Wgxmr1yQ3C6iZws6Yq6CxM2L3Z4...\n-----END PUBLIC KEY-----",
"createdAt": "2024-01-14T15:45:00.000Z",
"nodeKeys": []
}
]
}{
"success": false,
"message": "Access denied: you can only view keys for your own organization"
}