You can route API calls to an Nx Meta System using the Nx Meta Cloud proxy service. When you send requests through the Nx Meta Cloud, the service relays the API calls directly to the target server.
Prerequisites and limitations
Before you begin, note the following limitations:
Cloud Connection: The Site has to be connected to your Cloud account.
HTTPS only: The cloud proxy supports only HTTPS calls.
No browser-based requests: Requests sent directly from a browser fail due to Cross-Origin Resource Sharing (CORS) protection.
Supported streams: The proxy supports HLS streams, but it does not support RTSP streams.
Step 1: Find the cloudSystemId
To route calls through the proxy, you need your Site cloudSystemId. You can find this ID using any of the following methods:
Option A: Use the browser
Log in to the Nx Meta Cloud.
Select your target Site.
-
Copy the string at the end of the URL path following
https://meta.nxvms.com/systems/.Example URL:
https://meta.nxvms.com/systems/ad1b12d5-fcea-47fc-b8f2-fa67361cb8a8
In this example, thecloudSystemIdisad1b12d5-fcea-47fc-b8f2-fa67361cb8a8.
Option B: Use a direct API call
-
Send a
GETrequest to your local server to retrieve module information:https://<server_ip>:7001/api/moduleInformation -
Locate the
cloudSystemIdkey in the JSON response:{ "error": "0", "errorId": "ok", "errorString": "", "reply": { "brand": "metavms", "cloudHost": "meta.nxvms.com", "cloudOwnerId": "{15041f5a-0e0a-48bc-a406-3b6813f023c3}", "cloudSystemId": "ad1b12d5-fcea-47fc-b8f2-fa67361cb8a8", "customization": "metavms", ... }
Option C: Use the Nx Cloud API
-
Send a request to the cloud system endpoint using Bearer authentication:
https://meta.nxvms.com/cdb/system/get -
Locate the
idfield for your target system in the JSON response:{ "systems": [ { "id": "ad1b12d5-fcea-47fc-b8f2-fa67361cb8a8", "name": "NxLab", "customization": "metavms", ... ], ... }, ... } ] }
Step 2: Format your API request URL
To route requests through Nx Cloud, replace your local IP address and port with the cloud proxy relay domain.
Use the following URL structure:
https://.relay.vmsproxy.com/<api_endpoint>
Direct local request:
https://127.0.0.1:7001/<api_endpoint>
Cloud proxy request:
https://ad1b12d5-fcea-47fc-b8f2-fa67361cb8a8.relay.vmsproxy.com/<api_endpoint>
Comments
0 comments
Article is closed for comments.