curl --request GET \
--url https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items"
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/campaigns/{campaign_id}/viewer-items', 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/campaigns/{campaign_id}/viewer-items",
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/campaigns/{campaign_id}/viewer-items"
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/campaigns/{campaign_id}/viewer-items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items")
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": [
{
"campaign_item_review_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_type": "GROUP",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_type": "GROUP",
"granted_at": "2023-11-07T05:31:56Z",
"role_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision": "APPROVED",
"note": "<string>",
"decided_at": "2023-11-07T05:31:56Z",
"pending_decision": "APPROVED",
"pending_note": "<string>",
"updated_access_level_remote_id": "<string>",
"pending_updated_access_level_remote_id": "<string>",
"reassigned_to_reviewer_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"access_level_name": "<string>",
"access_level_remote_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"total_count": 123,
"next": "<string>",
"previous": "<string>"
}Returns a paginated list of campaign review items assigned to the
current authenticated viewer. Matches GraphQL Campaign.viewerItems.
Campaign access matches GET /campaigns/{campaign_id} and GraphQL
campaign(id): the caller must have access-review read permission or
be a reviewer on the campaign. Otherwise the request fails with 403
(same as get-by-id). Item rows are still scoped to the caller’s own
reviews (empty page when the caller is an admin but not a reviewer).
curl --request GET \
--url https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items"
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/campaigns/{campaign_id}/viewer-items', 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/campaigns/{campaign_id}/viewer-items",
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/campaigns/{campaign_id}/viewer-items"
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/campaigns/{campaign_id}/viewer-items")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/campaigns/{campaign_id}/viewer-items")
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": [
{
"campaign_item_review_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_type": "GROUP",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_type": "GROUP",
"granted_at": "2023-11-07T05:31:56Z",
"role_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision": "APPROVED",
"note": "<string>",
"decided_at": "2023-11-07T05:31:56Z",
"pending_decision": "APPROVED",
"pending_note": "<string>",
"updated_access_level_remote_id": "<string>",
"pending_updated_access_level_remote_id": "<string>",
"reassigned_to_reviewer_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"access_level_name": "<string>",
"access_level_remote_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"total_count": 123,
"next": "<string>",
"previous": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the campaign.
Query Parameters
The pagination cursor value.
Number of results to return per page. Default is 200; maximum is 500.
x <= 500Sort by. Omit to sort by created_at.
Sort field for viewer campaign items.
PRINCIPAL_NAME, ENTITY_NAME, EXPIRATION, LAST_USED "PRINCIPAL_NAME"
Sort direction. Sort direction for viewer campaign items.
ASC, DESC "ASC"
Filter by review status. When multiple values are provided, items matching any status are returned (OR).
Decision status for a viewer campaign item.
APPROVED, REVOKED, CHANGE_ROLE, NO_ACTION, PENDING, REASSIGNED Filter by access level name.
Filter by principal ID.
Filter by entity ID.
Filter to specific campaign item review IDs.
Restrict to items in this AI-suggestion bucket.
Response
A page of viewer campaign items.
A paginated list of viewer campaign items.
Show child attributes
Show child attributes
Total number of items matching the filter (across all pages).
The cursor with which to continue pagination if additional result pages exist.
The cursor used to obtain the current result page.
Was this page helpful?