Areas
Manage physical or logical areas within a company.
List Areas
Retrieve a list of all areas.
Endpoint: GET /public/v2/areas
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/areas" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/areas", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Get Area
Retrieve a specific area by ID.
Endpoint: GET /public/v2/areas/:id
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/areas/1" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/areas/1", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Create Area
Create a new area.
Endpoint: POST /public/v2/areas
- cURL
- JavaScript
curl -X POST "https://api.biosensei.io/public/v2/areas" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Warehouse A",
"code": "WH-A",
"company_id": 4
}'
const response = await fetch("https://api.biosensei.io/public/v2/areas", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Warehouse A",
code: "WH-A",
company_id: 4
})
});
const data = await response.json();
console.log(data);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the area. |
code | string | Yes | Unique code for the area. |
company_id | integer | Yes | ID of the company the area belongs to. |
Update Area
Update an existing area.
Endpoint: PUT /public/v2/areas/:id
- cURL
- JavaScript
curl -X PUT "https://api.biosensei.io/public/v2/areas/1" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Warehouse A Updated",
"code": "WH-A-NEW",
"company_id": 4
}'
const response = await fetch("https://api.biosensei.io/public/v2/areas/1", {
method: "PUT",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Warehouse A Updated",
code: "WH-A-NEW",
company_id: 4
})
});
const data = await response.json();
console.log(data);