Skip to content

Returns search index for quick local search of likely searched entities.

GET
/api/search/index

Authorizations

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

Responses

Success
JSON
{
"regions": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"email": "muenster@foodsharing.network",
"parent_id": 1,
"parent_name": "Nordrhein-Westfalen",
"is_member": true,
"ambassadors": [
{
"id": 1,
"name": "Max Mustermann",
"avatar": "/api/uploads/bc476952-08be-45a7-b670-db27c966c9c2"
}
]
}
],
"workingGroups": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"email": "bildung.muenster@foodsharing.network",
"parent_id": 1,
"parent_name": "Münster",
"is_member": true,
"is_admin": true,
"admins": [
{
"id": 1,
"name": "Max Mustermann",
"avatar": "/api/uploads/bc476952-08be-45a7-b670-db27c966c9c2"
}
]
}
],
"stores": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"cooperation_status": 5,
"street": "Oskar-Michels-Ring 29",
"zipCode": "Oskar-Michels-Ring 29",
"city": "Münster",
"region_id": 1,
"region_name": "Münster",
"membership_status": 1,
"is_manager": true,
"chain_name": "string"
}
],
"foodSharePoints": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"street": "Oskar-Michels-Ring 29",
"zipCode": "12345",
"city": "Münster",
"region_id": 1,
"region_name": "Münster"
}
],
"chats": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"last_message_date": "2023-10-04 13:38:03",
"last_foodsaver_id": 1,
"last_foodsaver_name": "Max",
"last_message": "Have a nice day!",
"members": [
{
"id": 1,
"name": "Max Mustermann",
"avatar": "/api/uploads/bc476952-08be-45a7-b670-db27c966c9c2"
}
],
"member_count": 12
}
],
"threads": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"time": "2023-10-04 15:21:52",
"stickiness": 1,
"is_closed": true,
"is_inside_ambassador_forum": true,
"region_id": 1,
"region_name": "Münster"
}
],
"users": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"avatar": "string",
"last_name": "Mustermann",
"mobile": "+49 1234 56789",
"is_buddy": true,
"is_verified": true,
"region_id": 1,
"region_name": "Münster",
"email": "Münster"
}
],
"mails": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"sender_mail": "sender@example.com",
"sender_name": "Sender",
"recipient_mail": "developer@foodsharing.network",
"recipient_name": "foodsharing Developer",
"recipient_count": "3",
"has_attachments": true,
"time": "2023-10-04 15:21:52",
"folder": 1
}
],
"events": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"location_name": "foodsharing Developer",
"status": "1",
"start": "2023-10-04 15:21:52",
"end": "2023-10-04 15:21:52",
"location_type": 1,
"region_id": 1,
"region_name": "Münster"
}
],
"polls": [
{
"id": 1,
"name": "Name",
"search_string": "Münster;meunster",
"start": "2023-10-04 15:21:52",
"end": "2023-10-04 15:21:52",
"region_id": 1,
"region_name": "Münster",
"has_voted": true
}
]
}
Authorization
api_key
cURL
curl -X GET \
'http://localhost/api/search/index'

Samples

cURL
curl -X GET http://localhost/api/search/index
JavaScript
fetch("http://localhost/api/search/index")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("http://localhost/api/search/index");
Python
import requests
response = requests.get("http://localhost/api/search/index")
print(response.json())