Skip to main content
Skip table of contents

Updating a map

POST/api/v1/maps/{map}

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

json

JSON
{
    "image": "image binary data",
    "name": "My map",
    "cameras": [
        {
            "camera_id": 12,
            "x": 150,
            "y": 200,
            "angle": 50
        }
    ],
    "latitude": 25.645345244619257,
    "longitude": -37.295444497828434
}

mapoptional

int

Map identifier to retrieve

imagerequired

binary

Map image. Send the image only if it needs to be changed

namerequired

string

Map name

camerasrequired

array

Array of cameras with x and y coordinates on the image and rotation angle, these data are needed to render the cameras on the image

latituderequired

double

Latitude coordinate of the location plan

longituderequired

double

Longitude coordinate of the location plan

Response

200

Successful response

JSON
{
  "id": 14,
  "name": "Camera 1",
  "created_at": "2022-04-22 14:51:54",
  "updated_at": "2022-04-22 14:51:54",
  "url": "https://vms.local/storage/path.jpg",
  "latitude": 25.645345244619257,
  "longitude" : -37.295444497828434,
  "cameras": [
    {
      "x": 29,
      "y": 82,
      "angle": 61,
      "camera": {
        "id": 92650,
        "group_id": 52039,
        "status": "active",
        "type": "mediaserver_v2",
        "start_at": "2022-03-23 14:51:54",
        "created_at": "2020-11-27 16:40:23",
        "billing_id": null,
        "pretty_name": "Camera 2",
        "pretty_text": "Region region, District district, City, st. Street 1",
        "short_address": "City, st. Street 1",
        "full_address": "Region region, District district, City, st. Street 1",
        "lat": null,
        "lng": null,
        "azimuth": null,
        "streams": [
          {
            "id": 204868,
            "type": "high",
            "camera_id": 92650,
            "is_preview_from_server": true,
            "is_archive_from_server": null,
            "status": "active",
            "has_sound": false
          },
          {
            "id": 204871,
            "type": "low",
            "camera_id": 92650,
            "is_preview_from_server": true,
            "is_archive_from_server": null,
            "status": "active",
            "has_sound": false
          }
        ],
        "services": {
          "ptz": false,
          "motion_detect": false
        },
        "has_sound": false,
        "archive_recording_timetable": {
          "days": [
            {
              "to": "13:39:25",
              "from": "13:38:25",
              "type": "monday"
            }
          ]
        },
        "archive_ranges": [
          {
            "end": 1650627922,
            "from": 1649312173,
            "duration": 1315749
          }
        ],
        "is_archive_recording": true,
        "is_bridge": false,
        "is_favorite": false,
        "is_owner": true,
        "can_change_archive_timetable": true,
        "archive_recording_type": "timetable",
        "user_status": "active",
        "name": "Camera 2"
      }
    }
  ]
}
404

If the map does not belong to the user or does not exist

401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

JSON
curl -k --location --request POST 'https://vms.local/api/v1/maps/{map}' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id' \
--header 'Content-Type: application/json \
--data-raw '{
    "image": "image binary data",
    "name": "My map",
    "cameras": [
        {
            "camera_id": 12,
            "x": 150,
            "y": 200,
            "angle": 50
        }
    ],
    "latitude": 25.645345244619257,
    "longitude": -37.295444497828434
}'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.