Отримати роль за ID
curl --request GET \
--url https://api.example.com/v1/roles/{id}import requests
url = "https://api.example.com/v1/roles/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/roles/{id}', 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.example.com/v1/roles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/v1/roles/{id}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/v1/roles/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/roles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"users": [
{
"id": 123,
"photoFilename": "<string>",
"name": "<string>",
"email": "<string>",
"role": "<unknown>",
"userType": {
"id": "<string>"
},
"languageCode": "<string>",
"timeZone": "<string>",
"timeZoneOffset": 123,
"acceptedTerms": true,
"isSubscribedToNewsletter": true,
"isDisabled": true,
"tickets": [
{
"id": "<string>",
"user": "<unknown>",
"scopeDataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
},
"scopeRecord": {
"id": 123,
"dataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
},
"state": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"archived": "2023-11-07T05:31:56Z",
"removed": "2023-11-07T05:31:56Z",
"datums": [
{
"id": 123,
"record": "<unknown>",
"property": {
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
},
"optionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"userValue": "<unknown>",
"recordValue": "<unknown>",
"integerValue": 123,
"decimalValue": 123,
"stringValue": "<string>",
"dateTimeValue": "2023-11-07T05:31:56Z"
}
],
"metadatums": [
{
"id": 123,
"record": "<unknown>",
"representation": {
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
},
"recordValue": "<unknown>",
"decimalValue": 123
}
],
"events": [
{
"id": 123,
"record": "<unknown>",
"user": "<unknown>",
"eventType": {
"id": "<string>"
},
"created": "2023-11-07T05:31:56Z",
"oldState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"newState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"property": {
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
},
"oldOptionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"oldUserValue": "<unknown>",
"oldRecordValue": "<unknown>",
"oldIntegerValue": 123,
"oldDecimalValue": 123,
"oldStringValue": "<string>",
"oldDateTimeValue": "2023-11-07T05:31:56Z",
"newOptionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"newUserValue": "<unknown>",
"newRecordValue": "<unknown>",
"newIntegerValue": 123,
"newDecimalValue": 123,
"newStringValue": "<string>",
"newDateTimeValue": "2023-11-07T05:31:56Z"
}
],
"transitions": [
{
"id": 123,
"record": "<unknown>",
"oldState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"redirectUrl": "<string>",
"created": "2023-11-07T05:31:56Z",
"expires": "2023-11-07T05:31:56Z",
"isSingleUse": true
}
],
"privileges": [
{
"id": 123,
"user": "<unknown>",
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
}
}
],
"notificationPreferences": [
{
"user": "<unknown>",
"notificationType": {
"id": "<string>"
},
"notificationMethod": {
"id": "<string>"
}
}
],
"emailChangeTokens": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newEmail": "<string>",
"created": "2023-11-07T05:31:56Z"
}
]
}
]
}Ролі (Roles)
Отримати роль за ID
Повертає конкретну роль за її ID.
GET
/
v1
/
roles
/
{id}
Отримати роль за ID
curl --request GET \
--url https://api.example.com/v1/roles/{id}import requests
url = "https://api.example.com/v1/roles/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/roles/{id}', 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.example.com/v1/roles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/v1/roles/{id}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/v1/roles/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/roles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"users": [
{
"id": 123,
"photoFilename": "<string>",
"name": "<string>",
"email": "<string>",
"role": "<unknown>",
"userType": {
"id": "<string>"
},
"languageCode": "<string>",
"timeZone": "<string>",
"timeZoneOffset": 123,
"acceptedTerms": true,
"isSubscribedToNewsletter": true,
"isDisabled": true,
"tickets": [
{
"id": "<string>",
"user": "<unknown>",
"scopeDataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
},
"scopeRecord": {
"id": 123,
"dataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
},
"state": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"archived": "2023-11-07T05:31:56Z",
"removed": "2023-11-07T05:31:56Z",
"datums": [
{
"id": 123,
"record": "<unknown>",
"property": {
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
},
"optionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"userValue": "<unknown>",
"recordValue": "<unknown>",
"integerValue": 123,
"decimalValue": 123,
"stringValue": "<string>",
"dateTimeValue": "2023-11-07T05:31:56Z"
}
],
"metadatums": [
{
"id": 123,
"record": "<unknown>",
"representation": {
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
},
"recordValue": "<unknown>",
"decimalValue": 123
}
],
"events": [
{
"id": 123,
"record": "<unknown>",
"user": "<unknown>",
"eventType": {
"id": "<string>"
},
"created": "2023-11-07T05:31:56Z",
"oldState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"newState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"property": {
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
},
"oldOptionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"oldUserValue": "<unknown>",
"oldRecordValue": "<unknown>",
"oldIntegerValue": 123,
"oldDecimalValue": 123,
"oldStringValue": "<string>",
"oldDateTimeValue": "2023-11-07T05:31:56Z",
"newOptionValue": {
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
},
"newUserValue": "<unknown>",
"newRecordValue": "<unknown>",
"newIntegerValue": 123,
"newDecimalValue": 123,
"newStringValue": "<string>",
"newDateTimeValue": "2023-11-07T05:31:56Z"
}
],
"transitions": [
{
"id": 123,
"record": "<unknown>",
"oldState": {
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
},
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"redirectUrl": "<string>",
"created": "2023-11-07T05:31:56Z",
"expires": "2023-11-07T05:31:56Z",
"isSingleUse": true
}
],
"privileges": [
{
"id": 123,
"user": "<unknown>",
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"states": [
{
"id": 123,
"dataset": "<unknown>",
"name": "<string>",
"color": 123,
"position": 123
}
],
"properties": [
{
"id": 123,
"dataset": "<unknown>",
"propertyType": {
"id": "<string>",
"isAutomatic": true,
"isPlural": true,
"isSortable": true,
"position": 123
},
"name": "<string>",
"isUsedAsTitle": true,
"isRequired": true,
"parameters": "<string>",
"position": 123,
"options": [
{
"id": 123,
"property": "<unknown>",
"text": "<string>",
"color": 123
}
]
}
],
"representations": [
{
"id": 123,
"dashboard": {
"id": 123,
"name": "<string>",
"isDisabled": true,
"position": 123,
"path": "<string>",
"representations": "<array>"
},
"dataset": "<unknown>",
"representationType": {
"id": "<string>",
"isAggregated": true,
"position": 123
},
"name": "<string>",
"parameters": "<string>",
"position": 123
}
]
}
}
],
"notificationPreferences": [
{
"user": "<unknown>",
"notificationType": {
"id": "<string>"
},
"notificationMethod": {
"id": "<string>"
}
}
],
"emailChangeTokens": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newEmail": "<string>",
"created": "2023-11-07T05:31:56Z"
}
]
}
]
}⌘I