Skip to content

Adds a new basket. The description must not be empty. All other parameters are optional. Returns the created basket.

POST
/api/baskets

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Request Body

JSON
{
"id": 0,
"description": "string",
"pictures": [
"string"
],
"contactTypes": [
0
],
"mobile": "string",
"telephone": "string",
"lat": 0,
"lon": 0,
"lifeTimeInDays": 0,
"weightInGrams": 0,
"status": 0,
"location": {
"lat": 52.5,
"lon": 13.4
},
"creator": {
"id": 0,
"name": "string",
"avatar": "string",
"isSleeping": true
},
"created": 0,
"updated": 0,
"until": 0,
"requestCount": 0
}

Responses

Authorization
api_key
cURL
curl -X POST \
'http://localhost/api/baskets' \
 --data '{
  "id": 0,
  "description": "string",
  "pictures": [
    "string"
  ],
  "contactTypes": [
    0
  ],
  "mobile": "string",
  "telephone": "string",
  "lat": 0,
  "lon": 0,
  "lifeTimeInDays": 0,
  "weightInGrams": 0,
  "status": 0,
  "location": {
    "lat": 52.5,
    "lon": 13.4
  },
  "creator": {
    "id": 0,
    "name": "string",
    "avatar": "string",
    "isSleeping": true
  },
  "created": 0,
  "updated": 0,
  "until": 0,
  "requestCount": 0
}'

Samples

cURL
curl -X POST http://localhost/api/baskets
JavaScript
fetch("http://localhost/api/baskets", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/baskets");
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("http://localhost/api/baskets")
print(response.json())