List Approvals
1 min
GET
http://localhost:3002//projects/{project_id}/flags/approvals
Path Parameters
- project_idintegerrequiredDescription
Query Parameters
- per_pageinteger<int64>DescriptionFormatint64
- pageinteger<int64>DescriptionFormatint64
- page_tokenstringDescription
- page_windowintegerDescription
- sortstring[]Description
- archivedbooleanDescription
- approval_statusstringDescription
- environmentstring[]Description
- querystringDescription
Responses
200
- Approvals
- itemsApproval[]requiredDescription
- archivedbooleanrequired
- entity_namestringrequiredExampleDescription
- entity_keystringrequiredExampleDescription
- entity_idintegerrequiredExampleDescription
- idintegerrequiredExampleDescription
- environmentstringrequiredExampleDescription
- environment_idintegerrequiredExampleDescription
- current_status_idintegerrequiredExampleDescription
- scheduleobjectDescription
- ScheduleTimeResponse
- datestring<date>ExampleDescriptionFormatdate
- timestringExampleDescriptionPattern^([01]?[0-9]|2[0-3]):([0-5][0-9])$
- time_zonestringExampleDescription
- utc_timestring<date-time>ExampleDescriptionFormatdate-time
- actionsFlagScheduleAction[]requiredDescription
- subjectobjectrequiredDescription
- keystringDescription
- typestringDescription
- changed_elementstringDescription
- valueobjectrequiredDescription
- status_historyStatusHistoryItem[]requiredDescription
- idintegerrequiredDescription
- statusstringrequiredDescription
- user_idintegerrequiredDescription
- emailstringrequiredDescription
- reasonstringrequiredDescription
- created_atstring<date-time>requiredExampleDescriptionFormatdate-time
- updated_atstring<date-time>requiredExampleDescriptionFormatdate-time
- created_bystringrequiredExampleDescription
- schedule_job_statusstring<pending | in_queue | failed_to_queue | canceled | completed | failed | partially_failed>requiredExampleDescriptionAllowedpendingin_queuefailed_to_queuecanceledcompletedfailedpartially_failed
- policy_idintegerExampleDescription
- policy_namestringExampleDescription
- is_current_user_approverbooleanDescription
- total_countintegerrequiredExampleDescription
- countintegerrequiredExampleDescription
- has_morebooleanExampleDescription
- pageintegerrequiredExampleDescription
- total_pagesintegerrequiredExampleDescription
- first_urlobjectrequiredDescription
- UrlValue
- last_urlobjectrequiredDescription
- UrlValue
- next_urlobjectDescription
- UrlList
- prev_urlobjectDescription
- UrlList
401
- ErrorResponseExample
{ "details": "Not authenticated", "status": 401 }- detailsstringrequiredDescription
- statusintegerrequiredExampleDescription
422
- HTTPValidationError
- detailValidationError[]
- locobject[]requiredDescription
- msgstringrequiredDescription
- typestringrequiredDescription
- statusintegerExampleDescription
curl
curl --request GET \
--url http://localhost:3002//projects/{project_id}/flags/approvals \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("http://localhost:3002//projects/{project_id}/flags/approvals", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("http://localhost:3002//projects/{project_id}/flags/approvals")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "http://localhost:3002//projects/{project_id}/flags/approvals"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Successful retrieval of a page of Approvals.
The response includes RESTful JSON (https://restfuljson.org/) styled links and pagination metadata. Objects in this API MAY include a url property for a link to itself and MAY append _url to properties for related links. If a link is not present in the response, it indicates a user is not authorized to access the related resource.
{
"items": [
{
"archived": false,
"entity_name": "Flag 123",
"entity_key": "flag_123",
"entity_id": 12345,
"id": 1,
"environment": "development",
"environment_id": 2345,
"current_status_id": 3333,
"schedule": {},
"actions": [
{
"subject": {
"key": "",
"type": ""
},
"changed_element": "",
"value": {}
}
],
"status_history": [
{
"id": 0,
"status": "",
"user_id": 0,
"email": "",
"reason": ""
}
],
"created_at": "2024-02-06T12:00:00Z",
"updated_at": "2024-02-06T12:00:00Z",
"created_by": "[email protected]",
"schedule_job_status": "pending",
"policy_id": 42,
"policy_name": "Production Gate",
"is_current_user_approver": false
}
],
"total_count": 20,
"count": 2,
"has_more": true,
"page": 1,
"total_pages": 10,
"first_url": {},
"last_url": {},
"next_url": {},
"prev_url": {}
}401
// Not Authenticated
{
"details": "",
"status": 400
}422
// Validation Error
{
"detail": [
{
"loc": [
{}
],
"msg": "",
"type": ""
}
],
"status": 422
}