curl --request GET \
--url https://api.opal.dev/v1/users/{user_id}/access \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/users/{user_id}/access"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/users/{user_id}/access', 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.opal.dev/v1/users/{user_id}/access",
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://api.opal.dev/v1/users/{user_id}/access"
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://api.opal.dev/v1/users/{user_id}/access")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/users/{user_id}/access")
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_body{
"results": [
{
"entity_type": "RESOURCE",
"entity_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"entity_name": "AdministratorAccess",
"description": "Full access to all resources and settings.",
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"expiration_date": "2022-01-23T04:56:07.000Z",
"has_direct_access": false,
"num_access_paths": 2
}
],
"next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
"previous": "cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ"
}Get a user's access
Returns all of the resources and groups the user has access to, in a single list. All
results are returned unless page_size is set, in which case the list is paginated.
Includes access the user has directly and access they have indirectly (for example, through
group membership or nested groups). Use has_direct_access and num_access_paths to tell
them apart.
Each row is one (resource or group, access level) pair. Only assignments the caller is allowed to read are returned, so the list can be empty or partial for a caller without permission to read assignments on the user’s resources and groups. Results are ordered by entity ID; the order is stable across pages but has no other meaning.
curl --request GET \
--url https://api.opal.dev/v1/users/{user_id}/access \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/users/{user_id}/access"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/users/{user_id}/access', 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.opal.dev/v1/users/{user_id}/access",
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://api.opal.dev/v1/users/{user_id}/access"
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://api.opal.dev/v1/users/{user_id}/access")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/users/{user_id}/access")
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_body{
"results": [
{
"entity_type": "RESOURCE",
"entity_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"entity_name": "AdministratorAccess",
"description": "Full access to all resources and settings.",
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"expiration_date": "2022-01-23T04:56:07.000Z",
"has_direct_access": false,
"num_access_paths": 2
}
],
"next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
"previous": "cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ"
}Authorizations
Query Parameters
Response
The resources and groups the user has access to.
A user's access to resources and groups, or one page of it if page_size was set.
Was this page helpful?