Skip to content

Create capture source

POST
/api/v1/capturesources

Roles required: Admin

Creates a new capture source from provided JSON body.

Request Body

JSON
{
"camera_hardware": "pi cam v2 (wide angle lens)",
"location": "-32.12345,139.12345",
"name": "Stony Point Cuttle Cam",
"site_id": 246813579
}

Responses

Created
JSON
{
"id": 1234567890
}

Samples

cURL
curl -X POST https://openfish.appspot.com/api/v1/capturesources
JavaScript
fetch("https://openfish.appspot.com/api/v1/capturesources", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://openfish.appspot.com/api/v1/capturesources");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("https://openfish.appspot.com/api/v1/capturesources")
print(response.json())