REST API Gateway: Get Camera Stream Resolution

Is there a way to retrieve a camera stream resolution in the REST API Gateway?

According to the openAPI.yml file there an endpoint : https://[server-address]/API/rest/v1/cameras/{id}/streams

in which you can retrieve all camera streams with a response like this :

{
  "array": [
    {
      "displayName": "Streams",
      "stream": [
        {
          "displayName": "JPEG - streamed",
          "name": "JPEG - streamed",
          "streamReferenceId": "87D3D9D2-20B5-4560-8AEA-0D757135A4A0",
          "liveDefault": true,
          "liveMode": "WhenNeeded",
          "recordTo": "16ce3aa1-5f93-458a-abe5-5c95d9ed1372",
          "defaultPlayback": true,
          "useEdge": true
        }
      ],
      "relations": {
        "self": {
          "type": "streams",
          "id": "e2537088-a892-43d8-885d-a454b5f98869"
        },
        "parent": {
          "type": "cameras",
          "id": "638bc8f1-cf28-4329-b8e6-5bba37bdb48f"
        }
      }
    },
 ]
}

but I don’t see a specific stream resolution anywhere. Is there a different endpoint for this?

You are on the right track.

https://[server-address]/API/rest/v1/cameras/{id}/streams

will tell you which streams are configured

https://[server-address]/API/rest/v1/cameras/{id}/settings

will tell you the settings that are used for the streams

Two facts are important to note.

Due to Milestone support many drivers for many different camera models (14,000+) and camera manufacturers with different schemes of how they implement streams and resolutions, the format in which you find resolution might differ. A quick test with a camera at hand I saw “resolution”: “1280x720”,

What you find in this way is the configuration that the camera will have per default when started by the recording server, in XProtect it is however possible to have a rule that change the resolution from the default, so in essence the only way to know for sure what the resolution is is to read an image!