Fortinet white logo
Fortinet white logo

CameraCameraPtzPresets

CameraCameraPtzPresets

View or change camera pan, tilt, and zoom (PTZ) presets.

If you want the camera to return to the position that was defined in a PTZ preset, use it in a PTZ command. See Example: Move a camera to position "PTZ_preset_1".

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • PUT

  • POST

  • DELETE

To create a new PTZ preset, use PTZ commands (see CameraCamera) to position the camera, and then use POST.

To update the PTZ preset, use PTZ commands to change the position, and then use PUT.

URL

For HTTP GET, use:

  • https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/

For HTTP POST, PUT, and DELETE, use:

  • https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PRESET_NAME

where variables are:

  • CAMERA_NAME — Unique identifier of a specific resource, such as the camera fd51_front_door

  • PRESET_NAME — Unique identifier of a specific resource, such as the PTZ preset PTZ_preset_1

Request JSON

Leave empty.

Response JSON

Responses vary by HTTP method, URL (collection vs. individual resource), and camera model. For example, if you create a PTZ preset, you may receive a response like this:

{
    "objectID": "CameraCameraPtzPresets:PTZ_preset2{P:door_cam}",
    "reqAction": 2,
    "nodePermission": 3,
    "parent_mkey": "door_cam",
    "mkey": "PTZ_preset1",
    "pan": 0,
    "tilt": 0,
    "zoom": 0
}

Example: Create "PTZ_preset_1" with the camera's current position

curl -X POST -H "Content-Type:application/json" -d "{}" -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1

After you move the camera, you can return to the preset position by following Example: Move a camera to position "PTZ_preset_1".

Example: Update "PTZ_preset_1" with the camera's current position

curl -X PUT -H "Content-Type:application/json" -d "{}" -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1

Example: Delete "PTZ_preset_1"

curl -X DELETE -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1

CameraCameraPtzPresets

CameraCameraPtzPresets

View or change camera pan, tilt, and zoom (PTZ) presets.

If you want the camera to return to the position that was defined in a PTZ preset, use it in a PTZ command. See Example: Move a camera to position "PTZ_preset_1".

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • PUT

  • POST

  • DELETE

To create a new PTZ preset, use PTZ commands (see CameraCamera) to position the camera, and then use POST.

To update the PTZ preset, use PTZ commands to change the position, and then use PUT.

URL

For HTTP GET, use:

  • https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/

For HTTP POST, PUT, and DELETE, use:

  • https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PRESET_NAME

where variables are:

  • CAMERA_NAME — Unique identifier of a specific resource, such as the camera fd51_front_door

  • PRESET_NAME — Unique identifier of a specific resource, such as the PTZ preset PTZ_preset_1

Request JSON

Leave empty.

Response JSON

Responses vary by HTTP method, URL (collection vs. individual resource), and camera model. For example, if you create a PTZ preset, you may receive a response like this:

{
    "objectID": "CameraCameraPtzPresets:PTZ_preset2{P:door_cam}",
    "reqAction": 2,
    "nodePermission": 3,
    "parent_mkey": "door_cam",
    "mkey": "PTZ_preset1",
    "pan": 0,
    "tilt": 0,
    "zoom": 0
}

Example: Create "PTZ_preset_1" with the camera's current position

curl -X POST -H "Content-Type:application/json" -d "{}" -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1

After you move the camera, you can return to the preset position by following Example: Move a camera to position "PTZ_preset_1".

Example: Update "PTZ_preset_1" with the camera's current position

curl -X PUT -H "Content-Type:application/json" -d "{}" -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1

Example: Delete "PTZ_preset_1"

curl -X DELETE -b cookie.txt https://HOST_OR_IP/api/v1/CameraCamera/CAMERA_NAME/CameraCameraPtzPresets/PTZ_preset_1