List viewer campaign items
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>",
"updated_duration_in_minutes": 123,
"pending_updated_duration_in_minutes": 123,
"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>"
}List viewer campaign items
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).
GET
/
campaigns
/
{campaign_id}
/
viewer-items
List viewer campaign items
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>",
"updated_duration_in_minutes": 123,
"pending_updated_duration_in_minutes": 123,
"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
Query Parameters
Response
200 - application/json
A page of viewer campaign items.
A paginated list of viewer campaign items.
Was this page helpful?