You can use the Media Server REST API to view, configure, and manage settings for Web Pages and Integrations. This approach is useful when you need to configure multiple pages at once or automate your setup using scripts.
While the desktop client separates Web pages and Integrations in the user interface, both use the same underlying API endpoints. The primary difference is that integrations can interact with the Client API.
Update Web Page settings
Follow these steps to retrieve a Web Page's current configuration, modify its settings, and save the changes back to the Media Server:
-
Retrieve the Web Page ID and configuration: Send a
GETrequest to the Web Pages endpoint to collect the parameters and unique identifiers of your Web Pages:GET /rest/v4/webPagesExample response:
[ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "parentId": "00000000-0000-0000-0000-000000000000", "name": "Web page", "url": "https://example.com", "certificateCheck": true, "proxyDomainAllowList": [], "parameters": {} } ] -
Construct the update payload: Identify the
idof the Web Page you want to update. Prepare a JSON payload that contains only the fields you want to change.For example, to disable SSL certificate checking and set an auto-refresh interval of 30 seconds, construct the following payload:
{ "certificateCheck": false, "parameters": { "refreshIntervalS": 30 } } -
Apply the configurations to the Media Server: Send a
PATCHrequest containing your JSON payload to the specific web page resource URL:PATCH /rest/v4/webPages/{web_page_id}
NOTE: Always use PATCH requests that contain only the specific fields you intend to change. This minimizes the risk of accidentally overwriting modifications made by other tools or administrators. |
Map UI settings to API fields
To modify settings through the API, map the options in the Desktop Client to JSON fields in the API payload:
-
Proxy this Web Page through the Media Server
API field:
parentIdEnable: Set to the specific Media Server ID string (obtained from
GET /rest/v4/servers).Disable: Set to
"00000000-0000-0000-0000-000000000000".
-
Allow opening this Web Page without SSL certificate checking
API field:
certificateCheckEnable (Bypass check): Set to
false.Disable (Enforce check): Set to
true.Note: The API logic is inverted relative to the client checkbox. Setting this field to
trueenables validation, which is the secure default.
-
Proxy all requested contents
API field:
proxyDomainAllowListEnable: Include
"*"in the array.Disable: Omit
"*"from the array.
-
Auto-refresh the Web Page
API field:
parameters.refreshIntervalSEnable: Set to the desired number of seconds (integer).
Disable: Set to
0.
-
Force open in a dedicated window
API field:
parameters.dedicatedWindowSettingsEnable: Set to
{"enabled": true}along with any additional window properties.Disable: Set to
{"enabled": false}.
Understand parentId
For most system resources, parentId defines hierarchy or nesting in a resource tree. For web pages and integrations, parentId specifies the proxy server. To find available server IDs, send a GET request to /rest/v4/servers.
Handle the etag field
The etag field might appear in the response body. The system uses it internally for change notifications. The system ignores this field in POST, PUT, or PATCH requests, so do not include it in your requests.
Differences between web pages and integrations
Starting from VMS 6.1 Web Pages are separated from Integrations. The Desktop Client no longer displays an Allow using Client API checkbox on a Web Page. Instead, it displays this notice:
To allow the use of a client API, create a eb integration instead.
It also provides a separate New Integration… command. Under the hood, an Integration is a Web Page whose subtype parameter is set to clientApi. When set, the Web Page gains permission to call the Desktop Client's JavaScript API and request access to the user session.
-
To convert a Web Page to an Integration, set the
subtypeparameter toclientApi:{ "parameters": { "subtype": "clientApi" } } -
To convert an Integration back to a plain web page, clear the
subtypevalue:{ "parameters": { "subtype": "" } }
Final note
Whenever possible, create Integrations directly rather than converting a Web Page through the API. Use the API conversion primarily for automated scripts or bulk migrations of assets created before version 6.1.
Comments
0 comments
Article is closed for comments.