Operations with Specific RestCorsSettings
This resource lets you work with the Resource Sharing settings of your YouTrack service.
Resource |
|
---|---|
Returned entity | RestCorsSettings. For the description of the entity attributes, see Supported Fields section. |
Supported methods |
Represents the Resource Sharing (CORS) configuration of the service.
Below you can find the list of resources that let you work with this entity.
This table describes attributes of the RestCorsSettings
entity.
To receive an attribute in the response from the server, specify it explicitly in the
fields
request parameter.To update an attribute, provide it in the body of a POST request.
Field | Type | Description |
---|---|---|
id | String | The ID of the RestCorsSettings. |
allowedOrigins | Array of Strings | Origins that are allowed for cross-origin requests. |
allowAllOrigins | Boolean | Indicates whether requests from all origins are allowed. |
Read the Resource Sharing settings of your YouTrack service.
GET /api/admin/globalSettings/restSettings?{fields}
null | Database ID of RestCorsSettings |
---|
Parameter | Type | Description |
---|---|---|
fields | String | A list of RestCorsSettings attributes that should be returned in the response. If no field is specified, only the |
https://example.youtrack.cloud/api/admin/globalSettings/restSettings?fields=allowAllOrigins,allowedOrigins
{
"allowAllOrigins": false,
"allowedOrigins": [],
"$type": "RestCorsSettings"
}
Change the Resource Sharing settings of your YouTrack service.
Requires permissions: Low-level Admin Write
POST /api/admin/globalSettings/restSettings?{fields}
null | Database ID of RestCorsSettings |
---|
Parameter | Type | Description |
---|---|---|
fields | String | A list of RestCorsSettings attributes that should be returned in the response. If no field is specified, only the |
curl -L -X POST 'https://example.youtrack.cloud/api/admin/globalSettings/restSettings?fields=allowAllOrigins,allowedOrigins' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
--data-raw '{
"allowedOrigins": [
"https://foo.example/staging:8080",
"https://foo.example/internal:8342"
]
}'
{
"allowedOrigins": [
"https://domain.example:8080",
"https://internal.domain.example:8342"
]
}
{
"allowAllOrigins": false,
"allowedOrigins": [
"https://domain.example:8080",
"https://internal.domain.example:8342"
],
"$type": "RestCorsSettings"
}