MENU navbar-image

Introduction

Welcome to the Foodiverse API reference portal.

This aims to provide all the information you need to work with our REST API, which has predictable resource-oriented URLs, returns JSON-encoded responses and standard HTTP response codes.

All authenticated endpoints require an Authorization header to be sent along with the request.

Base URL

https://api-dev.foodiverse.net

Authenticating requests

This API is authenticated by sending an Authorization header with the value "Bearer {token}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Auth

Login

Login with an email address and password to receive an authorisation token.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/user/login" \
    --header "Content-Type: application/json" \
    --data "{
    \"email\": \"[email protected]\",
    \"password\": \"password\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "[email protected]",
    "password": "password"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/user/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'email' => '[email protected]',
            'password' => 'password',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/login'
payload = {
    "email": "[email protected]",
    "password": "password"
}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "token": {
            "token_type": "Bearer",
            "access_token": "abcdefghijklmnopqrstuvwxyz0123456789...",
            "expires_in": 900,
            "domain": ".food.cloud",
            "url": "https://api-qa.foodiverse.net"
        },
        "user": {
            "uuid": "90070464-ecbf-4d4a-af6a-293534b50665",
            "first_name": "First Name",
            "surname": "Surname",
            "language_code": "en_IE",
            "mobile_number": "",
            "email": "[email protected]",
            "email_verified_at": null,
            "activation_key": null,
            "restoration_key": null,
            "is_active": 1,
            "is_organisation_admin": 1,
            "created_at": "2016-02-11 15:12:07",
            "updated_at": "2019-09-24 09:33:02",
            "deleted_at": null,
            "full_name": "First Name Surname",
            "role": "role",
            "image": {
                "filename": "5d89e2cd593493900d8ce.png"
            },
            "organisation": {
                "uuid": "f3738be8-1cab-47fa-b8e6-9b1f48108eff",
                "name": "FoodCloud",
                "image": null,
                "organisation_type": {
                    "id": 3,
                    "name": "FoodBank"
                }
            },
            "branches": [
                {
                    "name": "FoodCloud branch 1",
                    "uuid": "70ee2848-7f29-482f-b56c-87d18371fc7f",
                    "in_line_address": ""
                }
            ]
        }
    },
    "callTime": 1.0086328983306885
}
 

Example response (400):

{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_required"
        },
        {
            "field": "password",
            "message": "e_password_required"
        }
    ],
    "callTime": 0.0011749267578125
}
 

Request      

POST api/user/login

Body Parameters

email  String  

The email of the user.

password  String  

The password of the user.

Logout

requires authentication

Logout and invalidate all existing access and refresh tokens.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/logout" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/logout"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/logout',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/logout'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        null
    ],
    "callTime": 0.01135396957397461
}
 

Request      

GET api/user/logout

Branches

Get All Branches

requires authentication

This endpoint retrieves all user's branches.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "uuid": "c2a2c390-265b-c38a-c2b7-42c3b0c2b0c2",
            "name": "FoodCloud Dublin",
            "address": "Unit 8 Broomhill Business Park, Broomhill Road, Tallaght, South Dublin, Leinster, Ireland",
            "post_code": "D24 CD32",
            "is_active": 1,
            "latitude": "53.29716570",
            "longitude": "-6.36017910",
            "in_line_address": "D24 CD32"
        },
        {
            "uuid": "51c592c3-b909-c390-3f4e-c38dc2be7b45",
            "name": "FoodCloud Cork",
            "address": "Unit 3, O'connell Commercial Park, Cork, Munster, Ireland",
            "post_code": "T45 YP40 ",
            "is_active": 1,
            "latitude": "51.90001390",
            "longitude": "-8.35212060",
            "in_line_address": "T45 YP40 "
        },
        {
            "uuid": "c28d4ac3-aac2-a353-c2a9-47e280b9c592",
            "name": "FoodCloud Galway",
            "address": "Unit 9, Glennascaul Manufacturing & Technology, Deerpark, Cork, Munster, Ireland",
            "post_code": "H91 N96C",
            "is_active": 1,
            "latitude": "53.28375640",
            "longitude": "-8.92998510",
            "in_line_address": "H91 N96C"
        }
    ],
    "callTime": 0.03259706497192383
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches

Get a Specific Branch

requires authentication

This endpoint retrieves a specific user's branch.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/1" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/1"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/1'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "uuid": "c2a2c390-265b-c38a-c2b7-42c3b0c2b0c2",
        "name": "FoodCloud Dublin",
        "countries_id": 2963597,
        "provinces_id": 7521314,
        "counties_id": 7288565,
        "official_id": null,
        "address_1": "Unit 8 Broomhill Business Park, Broomhill Road",
        "address_2": "Tallaght",
        "city_town": "Dublin 24",
        "post_code": "D24 CD32",
        "phone": null,
        "prepare_donation_option": "l_product_and_category",
        "default_categories_only": false,
        "approved_products_only": false,
        "latitude": "53.29716570",
        "longitude": "-6.36017910",
        "is_active": 1,
        "created_at": "2019-09-29 04:52:10",
        "updated_at": "2019-09-29 04:52:10",
        "deleted_at": null,
        "users_id": 2,
        "branches_id": 2,
        "is_branch_admin": 1,
        "in_line_address": "Unit 8 Broomhill Business Park, Broomhill Road, Tallaght, Dublin 24, D24 CD32",
        "country": {
            "id": 2963597,
            "name": "Ireland",
            "latitude": 53,
            "longitude": -8,
            "code": "IE",
            "created_at": "2019-09-29 04:02:02",
            "updated_at": "2019-09-29 04:02:02",
            "deleted_at": null
        },
        "province": {
            "id": 7521314,
            "countries_id": 2963597,
            "name": "Leinster",
            "latitude": 53.16667,
            "longitude": -7.02121,
            "created_at": "2019-09-29 04:02:02",
            "updated_at": "2019-09-29 04:02:02",
            "deleted_at": null
        },
        "county": {
            "id": 7288565,
            "countries_id": 2963597,
            "provinces_id": 7521314,
            "name": "South Dublin",
            "latitude": 53.28595,
            "longitude": -6.37739,
            "created_at": "2019-09-29 04:02:02",
            "updated_at": "2019-09-29 04:02:02",
            "deleted_at": null
        }
    },
    "callTime": 0.011002063751220703
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches/{id}

URL Parameters

id  integer  

The ID of the branch.

branch  string  

The UUID of the branch.

Get all charities for a Branch

requires authentication

This endpoint retrieves all of a branch's associated charities.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/charities" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/charities"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/charities',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/charities'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "uuid": "c2af254b-cb9c-66e2-809d-4cc2a7c28118",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 1,
            "day_of_week_end": 1,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "c396c2b5-2c27-c3a2-c385-41c2a1c2a56e",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 2,
            "day_of_week_end": 2,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "512369c3-be3b-5d4e-41e2-84a2094d17c2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 3,
            "day_of_week_end": 3,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "75c2b0c2-a749-c281-c29d-431ee2809dc2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 4,
            "day_of_week_end": 4,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "6a4ce280-993e-c382-674f-c2abc2a8c281",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 5,
            "day_of_week_end": 5,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "5cc2a7c3-a96d-c3a9-0d41-c3a5c2aa66c3",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 6,
            "day_of_week_end": 6,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "5b78c3b2-c394-e280-a2e2-84a243c2b2e2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 7,
            "day_of_week_end": 7,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        }
    ],
    "callTime": 0.004434108734130859
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches/{branch}/charities

URL Parameters

branch  string  

The UUID of the branch.

Categories

Get All Categories

requires authentication

This endpoint retrieves all categories.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/categories" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/categories"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/categories'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "data": {
            "l_meat": [
                {
                    "uuid": "e2809d69-c3a3-4155-c3b5-43c3afe28093",
                    "name": "l_ambient_meat",
                    "label": "l_ambient_meat",
                    "description": "l_cuts_of_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "05c2b124-68c2-aac2-ba40-5bc2a9c5a168",
                    "name": "l_chilled_meat",
                    "label": "l_chilled_meat",
                    "description": "l_cuts_of_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c2a54525-c2bd-590f-4471-e280b07b6e7f",
                    "name": "l_frozen_meat",
                    "label": "l_frozen_meat",
                    "description": "l_cuts_of_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c3970e7f-46c2-9010-40c3-84c2a975c389",
                    "name": "l_hot_meat",
                    "label": "l_hot_meat",
                    "description": "l_cuts_of_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c2a0c2b7-c2aa-7536-c2b5-432ec2ad0cc3",
                    "name": "l_prepared_ambient_product_with_meat",
                    "label": "l_prepared_ambient_product_with_meat",
                    "description": "l_prepared_products_containing_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c2b874c3-a50b-c3b8-3d49-c2b5e280a651",
                    "name": "l_prepared_chilled_product_with_meat",
                    "label": "l_prepared_chilled_product_with_meat",
                    "description": "l_prepared_products_containing_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c2bcc2bd-c3bf-e280-a132-c2be4ec3a2c2",
                    "name": "l_prepared_frozen_product_with_meat",
                    "label": "l_prepared_frozen_product_with_meat",
                    "description": "l_prepared_products_containing_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                },
                {
                    "uuid": "c5bec3af-c381-e280-a6c2-a35e420ee280",
                    "name": "l_prepared_hot_product_with_meat",
                    "label": "l_prepared_hot_product_with_meat",
                    "description": "l_prepared_products_containing_meat",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:51",
                    "updated_at": "2019-10-31 07:33:51",
                    "parent_label": "l_meat"
                }
            ],
            "l_fish": [
                {
                    "uuid": "c2bdc2b3-1170-4c4a-44c3-98e2809d43c3",
                    "name": "l_ambient_fish",
                    "label": "l_ambient_fish",
                    "description": "l_cuts_of_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "e280a1e2-80a6-54c3-a7c5-bde280a647c3",
                    "name": "l_chilled_fish",
                    "label": "l_chilled_fish",
                    "description": "l_cuts_of_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "c3996046-6535-c3b8-44c2-9dc2bec3b4e2",
                    "name": "l_frozen_fish",
                    "label": "l_frozen_fish",
                    "description": "l_cuts_of_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "c38335c3-a4e2-84a2-c3a8-5d48c3bac2bf",
                    "name": "l_hot_fish",
                    "label": "l_hot_fish",
                    "description": "l_cuts_of_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "e282accb-86c3-a768-c2a5-e280b94305c2",
                    "name": "l_prepared_ambient_product_with_fish",
                    "label": "l_prepared_ambient_product_with_fish",
                    "description": "l_prepared_products_containing_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "3e1fc3ac-0dc3-a76e-48c2-a1c2a1c39058",
                    "name": "l_prepared_chilled_product_with_fish",
                    "label": "l_prepared_chilled_product_with_fish",
                    "description": "l_prepared_products_containing_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "527bc395-506f-c3a2-48e2-80a2c2b8c2b6",
                    "name": "l_prepared_frozen_product_with_fish",
                    "label": "l_prepared_frozen_product_with_fish",
                    "description": "l_prepared_products_containing_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                },
                {
                    "uuid": "585355c3-9365-0a4e-c2a2-c2aac38bc385",
                    "name": "l_prepared_hot_product_with_fish",
                    "label": "l_prepared_hot_product_with_fish",
                    "description": "l_prepared_products_containing_fish",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fish"
                }
            ],
            "l_fruit_veg": [
                {
                    "uuid": "19c3b1c3-8dc3-bd19-054d-5cc2b8c2bd2f",
                    "name": "l_fresh_fruit",
                    "label": "l_fresh_fruit",
                    "description": "l_whole_or_chopped_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "09c5a1c2-9dc3-82c3-b927-4138c2bac39c",
                    "name": "l_chilled_fruit",
                    "label": "l_chilled_fruit",
                    "description": "l_whole_or_chopped_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "4ac2b4c2-a276-c38b-2941-6be284a26f7f",
                    "name": "l_prepared_ambient_fruit",
                    "label": "l_prepared_ambient_fruit",
                    "description": "l_prepared_products_containing_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c3855dc3-aa76-c3ac-c2a3-4e06c2a6c2b7",
                    "name": "l_prepared_chilled_fruit",
                    "label": "l_prepared_chilled_fruit",
                    "description": "l_prepared_products_containing_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "62e28093-1940-c3ba-c38b-42c2bce284a2",
                    "name": "l_prepared_frozen_fruit",
                    "label": "l_prepared_frozen_fruit",
                    "description": "l_prepared_products_containing_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c38ac2ad-c2ae-760e-c2a9-4b0ec2a7c38c",
                    "name": "l_prepared_hot_fruit",
                    "label": "l_prepared_hot_fruit",
                    "description": "l_prepared_products_containing_fruit",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "21c3833f-c2a4-0961-4cc3-9bc692c3b1c3",
                    "name": "l_fresh_veg",
                    "label": "l_fresh_veg",
                    "description": "l_whole_or_chopped_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c3b9027a-c3aa-e280-a002-4368c5921123",
                    "name": "l_chilled_veg",
                    "label": "l_chilled_veg",
                    "description": "l_whole_or_chopped_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "63e282ac-c2a8-75c5-bd55-432cc290c3a6",
                    "name": "l_prepared_ambient_veg",
                    "label": "l_prepared_ambient_veg",
                    "description": "l_prepared_products_containing_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c3864b1d-c2bf-17c2-b344-c2bbc2b55447",
                    "name": "l_prepared_chilled_veg",
                    "label": "l_prepared_chilled_veg",
                    "description": "l_prepared_products_containing_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c390c2af-532d-c2ab-c2b3-466fe280a209",
                    "name": "l_prepared_frozen_veg",
                    "label": "l_prepared_frozen_veg",
                    "description": "l_prepared_products_containing_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                },
                {
                    "uuid": "c3b1c396-c3ba-c3a5-cb86-e280a04234e2",
                    "name": "l_prepared_hot_veg",
                    "label": "l_prepared_hot_veg",
                    "description": "l_prepared_products_containing_veg",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_fruit_veg"
                }
            ],
            "l_dairy_eggs": [
                {
                    "uuid": "c593c5bd-c2b9-c3a9-4530-4b1fc5a14643",
                    "name": "l_dairy",
                    "label": "l_dairy",
                    "description": "l_dairy_products",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_dairy_eggs"
                },
                {
                    "uuid": "0a54c3b1-3fc3-8505-45c3-b3c2bac391c2",
                    "name": "l_eggs",
                    "label": "l_eggs",
                    "description": "l_eggs",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_dairy_eggs"
                },
                {
                    "uuid": "c3bfc3ad-28e2-84a2-c2a5-c38b4ac390c2",
                    "name": "l_chilled_products_with_dairy_and_eggs",
                    "label": "l_chilled_products_with_dairy_and_eggs",
                    "description": "l_prepared_products_containing_dairy_or_eggs",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_dairy_eggs"
                },
                {
                    "uuid": "42556158-434f-4116-c281-c39e2bc2ad4c",
                    "name": "l_frozen_products_with_dairy_and_eggs",
                    "label": "l_frozen_products_with_dairy_and_eggs",
                    "description": "l_prepared_products_containing_dairy_or_eggs",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_dairy_eggs"
                }
            ],
            "l_bakery": [
                {
                    "uuid": "1877c2b0-372c-5246-c2b7-c281c2a8e280",
                    "name": "l_bread_and_bread_products",
                    "label": "l_bread_and_bread_products",
                    "description": "l_savoury_bakery_goods",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_bakery"
                },
                {
                    "uuid": "c3bfc390-c2a1-07c2-ace2-80a64dc3a2c2",
                    "name": "l_sweet_and_savoury_bakery",
                    "label": "l_sweet_and_savoury_bakery",
                    "description": "l_sweet_bakery_goods",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_bakery"
                }
            ],
            "l_cereal_grains_and_soy": [
                {
                    "uuid": "3534c3bc-1e5a-c2b2-49cb-86c2af77c388",
                    "name": "l_whole_or_milled_grain",
                    "label": "l_whole_or_milled_grain",
                    "description": "l_cereal,_grain_or_soy_products_in_whole_or_milled_form",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                },
                {
                    "uuid": "c2b2c38c-0fe2-809c-03e2-80a14ce282ac",
                    "name": "l_flour_and_starches",
                    "label": "l_flour_and_starches",
                    "description": "l_cereal,_grain_or_soy_products_in_flour_or_fine_form",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                },
                {
                    "uuid": "cb9c1058-c382-5177-4cc2-b0c2b3c3a44d",
                    "name": "l_pasta_and_noodles",
                    "label": "l_pasta_and_noodles",
                    "description": "l_cereal,_grain_or_soy_products_in_prepared_form",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                },
                {
                    "uuid": "2c1b14c3-9d47-c2a1-4875-c2a1c382c3a9",
                    "name": "l_breakfast_cereals",
                    "label": "l_breakfast_cereals",
                    "description": "l_prepared_breakfast_cereals",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                },
                {
                    "uuid": "09c3823e-5e3e-5f4a-c2b0-e2809ec39605",
                    "name": "l_soy_products",
                    "label": "l_soy_products",
                    "description": "l_soy_products_such_as_beans,_tofu_etc.",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                },
                {
                    "uuid": "c38000c3-bae2-8093-c3ba-c5934fc2bec2",
                    "name": "l_ambient",
                    "label": "l_ambient",
                    "description": "l_batter,_prepared_grains,_grain_deserts",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_cereal_grains_and_soy"
                }
            ],
            "l_beverages": [
                {
                    "uuid": "431fe280-ba0c-6928-4bc3-a5e28098c2af",
                    "name": "l_water",
                    "label": "l_water",
                    "description": "l_water",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_beverages"
                },
                {
                    "uuid": "e284a2c3-b9c3-b2c3-99e2-80ba3244c3b9",
                    "name": "l_juice",
                    "label": "l_juice",
                    "description": "l_juices,_nectars_and_concentrates",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_beverages"
                },
                {
                    "uuid": "2e76c382-c2ba-c28f-c2ae-487ec2a2c3ad",
                    "name": "l_soda_and_sports_drinks",
                    "label": "l_soda_and_sports_drinks",
                    "description": "l_water_based_sugary_and_flavoured_drinks",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_beverages"
                },
                {
                    "uuid": "35c3b6e2-80a6-26c2-b9e2-809942c29dc2",
                    "name": "l_tea_and_coffee",
                    "label": "l_tea_and_coffee",
                    "description": "l_tea_and_coffee_in_dry_or_prepared_form",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_beverages"
                },
                {
                    "uuid": "c3ab5a69-c3a7-6ec3-9647-3ce28093e280",
                    "name": "l_alcoholic_beverages",
                    "label": "l_alcoholic_beverages",
                    "description": "l_alcoholic_drinks",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_beverages"
                }
            ],
            "l_grocery_ambient": [
                {
                    "uuid": "c2a360c3-9a4d-c3a3-c3a4-46c390c2bdc2",
                    "name": "l_salt_herbs_spices_yeast",
                    "label": "l_salt_herbs_spices_yeast",
                    "description": "l_salt,_herbs,_spices,_yeast",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "43c38505-c391-03c2-bb45-c3ace280a6c3",
                    "name": "l_sauces_vinegars_mustards_salad_dressing_soy_sauces",
                    "label": "l_sauces_vinegars_mustards_salad_dressing_soy_sauces",
                    "description": "l_sauces,_vinegars,_mustards,_salad_dressing,_soy_sauces",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "c2b54ce2-8094-c2a0-c2b0-0c47e28093e2",
                    "name": "l_soups_and_broths",
                    "label": "l_soups_and_broths",
                    "description": "l_soups_and_broths",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "507bc2a4-6ac2-af4a-44c2-afc2a4c39b1e",
                    "name": "l_protein_products",
                    "label": "l_protein_products",
                    "description": "l_protein_products(not_including_veg_or_grain_products)",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "435cc3a2-c2b1-c383-714b-2ae284a2015d",
                    "name": "l_fats_and_oils",
                    "label": "l_fats_and_oils",
                    "description": "l_fats_and_oils",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "33c3aa2c-c385-2b2a-4ec3-a3c5be04c2ad",
                    "name": "l_ice_sorbet_and_sherbet",
                    "label": "l_ice_sorbet_and_sherbet",
                    "description": "l_ice,_sorbet_and_sherbet(not_including_dairy_ice_cream,_see_dairy)",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "101a1ec2-af1b-c3b2-4233-c2b3c3b5e280",
                    "name": "l_confectionary",
                    "label": "l_confectionary",
                    "description": "l_confectionary(not_including_sweet_bakery_goods,_see_bakery)",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                },
                {
                    "uuid": "c3925bc3-bcc2-8d06-c397-435cc2a44f1b",
                    "name": "l_other_grocery",
                    "label": "l_other_grocery",
                    "description": "l_other_grocery",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_grocery_ambient"
                }
            ],
            "l_non_food": [
                {
                    "uuid": "c3896fc3-b8c3-9ac3-83c3-9f45c2b6e280",
                    "name": "l_non_food",
                    "label": "l_non_food",
                    "description": "l_non-food_items_related_to_food_donations",
                    "is_active": 1,
                    "created_at": "2019-10-31 07:33:52",
                    "updated_at": "2019-10-31 07:33:52",
                    "parent_label": "l_non_food"
                }
            ]
        },
        "recordsFiltered": 9,
        "recordsTotal": 54
    },
    "callTime": 0.01037907600402832
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/categories

Get specific Category

requires authentication

This endpoint retrieves specified category.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/categories/5ce3a914-8a20-4e83-9e5a-059361de5d04" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/categories/5ce3a914-8a20-4e83-9e5a-059361de5d04"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/categories/5ce3a914-8a20-4e83-9e5a-059361de5d04',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/categories/5ce3a914-8a20-4e83-9e5a-059361de5d04'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "uuid": "e2809d69-c3a3-4155-c3b5-43c3afe28093",
        "name": "l_ambient_meat",
        "label": "l_ambient_meat",
        "description": "l_cuts_of_meat",
        "is_active": 1,
        "created_at": "2019-10-31 07:33:51",
        "updated_at": "2019-10-31 07:33:51"
    },
    "callTime": 0.0027418136596679688
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/categories/{id}

URL Parameters

id  string  

The UUID of the category.

Get organisation default categories (admin only)

requires authentication

This endpoint retrieves all the organisation default categories.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/admin/organisation/default_categories" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/admin/organisation/default_categories"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/admin/organisation/default_categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/admin/organisation/default_categories'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "id": 11,
            "uuid": "60efbfbd-efbf-bdef-bfbd-efbfbdefbfbd",
            "name": "l_ambient_fish",
            "label": "l_ambient_fish",
            "description": "l_cuts_of_fish",
            "is_active": 1,
            "created_at": "2020-02-10 15:55:05",
            "updated_at": "2020-02-10 15:55:05"
        }
    ],
    "callTime": 0.04359316825866699
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/admin/organisation/default_categories

Attach default categories to the organisation (admin only)

requires authentication

This endpoint is used to attach default categories to the organisation.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/admin/organisation/default_categories" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"categories\": [
        \"consequatur\"
    ]
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/admin/organisation/default_categories"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "categories": [
        "consequatur"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/admin/organisation/default_categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'categories' => [
                'consequatur',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/admin/organisation/default_categories'
payload = {
    "categories": [
        "consequatur"
    ]
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0015211105346679688,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

POST api/admin/organisation/default_categories

Body Parameters

categories  string[]  

An Array of categories to be attached to the organisation

Get organisation default categories

requires authentication

This endpoint retrieves all the organisation default categories.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/organisation/default_categories" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"return_order\": \"{url}?return_order=ASC|DESC\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/organisation/default_categories"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "return_order": "{url}?return_order=ASC|DESC"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/organisation/default_categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'return_order' => '{url}?return_order=ASC|DESC',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/organisation/default_categories'
payload = {
    "return_order": "{url}?return_order=ASC|DESC"
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "id": 11,
            "uuid": "60efbfbd-efbf-bdef-bfbd-efbfbdefbfbd",
            "name": "l_ambient_fish",
            "label": "l_ambient_fish",
            "description": "l_cuts_of_fish",
            "is_active": 1,
            "created_at": "2020-02-10 15:55:05",
            "updated_at": "2020-02-10 15:55:05"
        }
    ],
    "callTime": 0.04359316825866699
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/organisation/default_categories

Body Parameters

return_order  String optional  

optional, default ASC.

Collection Windows

Get All Collection Windows for a Branch

requires authentication

This endpoint retrieves all branch's collection windows.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/collection_windows" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/collection_windows"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/collection_windows',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/collection_windows'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "uuid": "c2af254b-cb9c-66e2-809d-4cc2a7c28118",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 1,
            "day_of_week_end": 1,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "c396c2b5-2c27-c3a2-c385-41c2a1c2a56e",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 2,
            "day_of_week_end": 2,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "512369c3-be3b-5d4e-41e2-84a2094d17c2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 3,
            "day_of_week_end": 3,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "75c2b0c2-a749-c281-c29d-431ee2809dc2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 4,
            "day_of_week_end": 4,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "6a4ce280-993e-c382-674f-c2abc2a8c281",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 5,
            "day_of_week_end": 5,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "5cc2a7c3-a96d-c3a9-0d41-c3a5c2aa66c3",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 6,
            "day_of_week_end": 6,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        },
        {
            "uuid": "5b78c3b2-c394-e280-a2e2-84a243c2b2e2",
            "starts_at": "20:30:00",
            "ends_at": "21:30:00",
            "day_of_week_start": 7,
            "day_of_week_end": 7,
            "created_at": "2019-09-29 05:52:02",
            "updated_at": "2019-09-29 05:52:02",
            "max_collectors": 1,
            "difference_in_days": 0
        }
    ],
    "callTime": 0.004434108734130859
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches/{branch}/collection_windows

URL Parameters

branch  string  

The UUID of the branch.

Donation Response

Get Donation Response

requires authentication

This endpoint retrieves specified Donation Response.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "uuid": "00000032-13bc-47d1-93e2-8583495cd796",
        "type": "P",
        "token": "10",
        "response_at": "2021-04-01 18:08:21",
        "created_at": "2021-04-01 18:07:43",
        "updated_at": "2021-04-01 18:08:21",
        "deleted_at": null,
        "tsm_current_state": "Rejected",
        "uncollected_reason": null,
        "accepted_at": null,
        "declined_at": "2021-04-01 18:08:21",
        "transferred_at": null,
        "not_transferred_at": null,
        "category_summary": [
            {
                "category": "l_bakery",
                "quantity": 1,
                "uom": "Crate",
                "estimated_weight": 0,
                "actual_weight": 0,
                "estimated_price": 0,
                "actual_price": 0
            },
            {
                "category": "l_fruit_veg",
                "quantity": 1,
                "uom": "Crate",
                "estimated_weight": 0,
                "actual_weight": 0,
                "estimated_price": 0,
                "actual_price": 0
            }
        ],
        "tsm_current_state_label": "rejected",
        "donation_images": [],
        "charity_branch": {
            "uuid": "2d0e0e00-5af0-4401-823e-04e19fe3a3e7",
            "name": "The Nest",
            "countries_id": 2635167,
            "provinces_id": 6269131,
            "counties_id": 2651079,
            "official_id": "FS:0011p00002lzQdQAAU",
            "address_1": "Abbotsbury Road",
            "address_2": "",
            "city_town": "",
            "post_code": "DT4 0JX",
            "phone": "+447724285851",
            "latitude": "50.61114100",
            "longitude": "-2.46985500",
            "timezone": "Europe/Dublin",
            "locale": "en_IE",
            "is_active": 1,
            "is_foodboard_allowed": 1,
            "esign": 0,
            "send_daily_donations_reminders": false,
            "send_instant_donations_reminders": false,
            "offers_token_counter": 0,
            "created_at": "2020-11-13T09:14:18.000000Z",
            "updated_at": "2021-06-28T18:10:06.000000Z",
            "deleted_at": null,
            "in_line_address": "Abbotsbury Road, DT4 0JX, Dorset, England, United Kingdom",
            "storage_types": [
                {
                    "uuid": "9df804bd-26c9-4b0b-8d33-5a88b58c8a9d",
                    "name": "l_ambient",
                    "label": "l_ambient",
                    "is_active": 1,
                    "created_at": "2021-03-15T00:26:32.000000Z",
                    "updated_at": "2021-03-15T00:26:32.000000Z"
                }
            ],
            "county": {
                "id": 2651079,
                "countries_id": 2635167,
                "provinces_id": 6269131,
                "name": "Dorset",
                "latitude": 50.75,
                "longitude": -2.33333,
                "created_at": "2021-03-15T00:26:10.000000Z",
                "updated_at": "2021-03-15T00:26:10.000000Z",
                "deleted_at": null
            },
            "province": {
                "id": 6269131,
                "countries_id": 2635167,
                "name": "England",
                "latitude": 52.16045,
                "longitude": -0.70312,
                "created_at": "2021-03-15T00:26:09.000000Z",
                "updated_at": "2021-03-15T00:26:09.000000Z",
                "deleted_at": null
            },
            "country": {
                "id": 2635167,
                "name": "United Kingdom",
                "latitude": 54.75844,
                "longitude": -2.69531,
                "code": "GB",
                "created_at": "2021-03-15T00:26:09.000000Z",
                "updated_at": "2021-03-15T00:26:09.000000Z",
                "deleted_at": null
            }
        },
        "charity_membership": {
            "uuid": "88721bef-ea47-4e97-996d-1592c301db5c",
            "tsm_current_state": "Activated",
            "created_at": "2021-03-15T01:08:32.000000Z",
            "updated_at": "2021-12-17T21:19:24.000000Z",
            "cancellation_requested": 0,
            "laravel_through_key": 5151770,
            "tsm_current_state_label": "activated",
            "storage_types": [
                {
                    "uuid": "9df804bd-26c9-4b0b-8d33-5a88b58c8a9d",
                    "name": "l_ambient",
                    "label": "l_ambient",
                    "is_active": 1,
                    "created_at": "2021-03-15T00:26:32.000000Z",
                    "updated_at": "2021-03-15T00:26:32.000000Z"
                }
            ]
        },
        "items": [
            {
                "is_available": 1,
                "created_at": "2021-04-01T18:07:43.000000Z",
                "updated_at": "2021-04-01T18:07:43.000000Z",
                "deleted_at": null,
                "donation_item": {
                    "quantity": 1,
                    "unit_of_measure": "Crate",
                    "unit_of_measure_co2e": 3.2,
                    "unit_of_measure_kg": 6.5,
                    "meals_per_kg": 2.381,
                    "created_at": "2021-04-01T18:03:40.000000Z",
                    "updated_at": "2021-04-01T18:03:40.000000Z",
                    "deleted_at": null,
                    "total_co2e": 20.8,
                    "total_kg": 6.5,
                    "total_meals": 15.476499999999998,
                    "total_price": null,
                    "estimated_total_co2e": null,
                    "estimated_total_kg": null,
                    "estimated_total_meals": null,
                    "estimated_total_price": null,
                    "actual_total_co2e": null,
                    "actual_total_kg": null,
                    "actual_total_meals": null,
                    "actual_total_price": null,
                    "is_available": 1,
                    "is_extra": 0,
                    "is_breached": 0,
                    "product_level_descriptions": [],
                    "category": {
                        "uuid": "dbab4052-6a5a-4db5-be49-0122bca76183",
                        "name": "l_bread_and_bread_products",
                        "label": "l_bread_and_bread_products",
                        "description": "l_products_containing_mostly_bread",
                        "is_active": 1,
                        "created_at": "2021-03-15T00:26:32.000000Z",
                        "updated_at": "2021-03-15T00:26:32.000000Z"
                    }
                }
            },
            {
                "is_available": 1,
                "created_at": "2021-04-01T18:07:43.000000Z",
                "updated_at": "2021-04-01T18:07:43.000000Z",
                "deleted_at": null,
                "donation_item": {
                    "quantity": 1,
                    "unit_of_measure": "Crate",
                    "unit_of_measure_co2e": 3.2,
                    "unit_of_measure_kg": 6.5,
                    "meals_per_kg": 2.381,
                    "created_at": "2021-04-01T18:03:40.000000Z",
                    "updated_at": "2021-04-01T18:03:40.000000Z",
                    "deleted_at": null,
                    "total_co2e": 20.8,
                    "total_kg": 6.5,
                    "total_meals": 15.476499999999998,
                    "total_price": null,
                    "estimated_total_co2e": null,
                    "estimated_total_kg": null,
                    "estimated_total_meals": null,
                    "estimated_total_price": null,
                    "actual_total_co2e": null,
                    "actual_total_kg": null,
                    "actual_total_meals": null,
                    "actual_total_price": null,
                    "is_available": 1,
                    "is_extra": 0,
                    "is_breached": 0,
                    "product_level_descriptions": [],
                    "category": {
                        "uuid": "750a9375-9fb1-437d-bd5e-1b11dce297c1",
                        "name": "l_fresh_veg",
                        "label": "l_fresh_veg",
                        "description": "l_fresh_vegetables",
                        "is_active": 1,
                        "created_at": "2021-03-15T00:26:32.000000Z",
                        "updated_at": "2021-03-15T00:26:32.000000Z"
                    }
                }
            }
        ],
        "donation": {
            "uuid": "0808a2c9-371f-4ef9-8bf7-9bf8ef8c09f6",
            "external_id": "9317b483-7d30-4fc7-9896-5b0eaecc2e1d",
            "is_max_collectors_reached": null,
            "received_at": "2021-04-01 18:03:40",
            "created_at": "2021-04-01 18:03:40",
            "updated_at": "2021-04-01 20:00:08",
            "deleted_at": null,
            "accepted_by": "2021-04-01 20:00:00",
            "collect_by": null,
            "primary_available_at": "2021-04-01 18:00:00",
            "waitlist_available_at": null,
            "foodboard_available_at": "2021-04-01 18:08:21",
            "donation_window_start_at": "2021-04-01 18:00:00",
            "donation_window_end_at": "2021-04-01 18:30:00",
            "tsm_current_state": "Ended",
            "require_friends": 1,
            "rag_status": 2,
            "all_items_taken": 0,
            "esign": 0,
            "tsm_current_state_label": "ended",
            "donor": {
                "uuid": "25fcf6f9-dbf1-4030-9949-3e5c5361cc49",
                "name": "Little Waitrose Poundbury",
                "countries_id": 2635167,
                "provinces_id": 6269131,
                "counties_id": 2651079,
                "official_id": "WAITROSE:733",
                "address_1": "Poundbury, Queen Mother Square, Poundbury, Dorchester",
                "address_2": "",
                "city_town": "Not Available",
                "post_code": "DT1 3BW",
                "phone": "+447400123760",
                "latitude": "50.71532390",
                "longitude": "-2.46895310",
                "timezone": "Europe/London",
                "locale": "en_IE",
                "is_active": 1,
                "is_foodboard_allowed": 1,
                "esign": 0,
                "send_daily_donations_reminders": false,
                "send_instant_donations_reminders": false,
                "offers_token_counter": 0,
                "created_at": "2020-10-15T15:06:10.000000Z",
                "updated_at": "2022-01-25T10:49:23.000000Z",
                "deleted_at": null,
                "in_line_address": "Poundbury, Queen Mother Square, Poundbury, Dorchester, Not Available DT1 3BW, Dorset, England, United Kingdom",
                "organisation": {
                    "uuid": "7373f661-1583-4f17-a4cf-930099d7ae15",
                    "name": "Waitrose UK",
                    "countries_id": 2635167,
                    "provinces_id": null,
                    "counties_id": null,
                    "official_id": null,
                    "accept_by_offset": 40,
                    "phone": null,
                    "address_1": "No Address Available In Migration",
                    "address_2": "",
                    "city_town": "",
                    "post_code": "MIG N0A",
                    "latitude": "0.00000000",
                    "longitude": "0.00000000",
                    "description": null,
                    "food_safety_info": null,
                    "is_active": true,
                    "is_friend_group": 1,
                    "created_at": "2017-03-01T11:34:26.000000Z",
                    "updated_at": "2022-05-23T11:12:23.000000Z",
                    "deleted_at": null,
                    "in_line_address": "No Address Available In Migration, MIG N0A, United Kingdom",
                    "county": null,
                    "province": null,
                    "country": {
                        "id": 2635167,
                        "name": "United Kingdom",
                        "latitude": 54.75844,
                        "longitude": -2.69531,
                        "code": "GB",
                        "created_at": "2021-03-15T00:26:09.000000Z",
                        "updated_at": "2021-03-15T00:26:09.000000Z",
                        "deleted_at": null
                    }
                },
                "county": {
                    "id": 2651079,
                    "countries_id": 2635167,
                    "provinces_id": 6269131,
                    "name": "Dorset",
                    "latitude": 50.75,
                    "longitude": -2.33333,
                    "created_at": "2021-03-15T00:26:10.000000Z",
                    "updated_at": "2021-03-15T00:26:10.000000Z",
                    "deleted_at": null
                },
                "province": {
                    "id": 6269131,
                    "countries_id": 2635167,
                    "name": "England",
                    "latitude": 52.16045,
                    "longitude": -0.70312,
                    "created_at": "2021-03-15T00:26:09.000000Z",
                    "updated_at": "2021-03-15T00:26:09.000000Z",
                    "deleted_at": null
                },
                "country": {
                    "id": 2635167,
                    "name": "United Kingdom",
                    "latitude": 54.75844,
                    "longitude": -2.69531,
                    "code": "GB",
                    "created_at": "2021-03-15T00:26:09.000000Z",
                    "updated_at": "2021-03-15T00:26:09.000000Z",
                    "deleted_at": null
                }
            },
            "network": {
                "uuid": "7a6d523b-22e7-4856-b4ad-2da72a478a69",
                "description": "FareShare | Fighting hunger, tackling food waste in the UK",
                "max_donation_volume_kg": 30000,
                "donation_interval": 30,
                "requirements": "FareShare | Fighting hunger, tackling food waste in the UK",
                "default_co2e": null,
                "default_meals_per_kg": null,
                "silence_collection_window_invitation_notifications": 1,
                "silence_network_membership_notifications": null,
                "created_at": "2021-03-15T01:07:38.000000Z",
                "updated_at": "2021-03-26T17:53:22.000000Z",
                "deleted_at": null,
                "is_public": false,
                "organisation": {
                    "uuid": "fbfe1124-ac4e-4fcb-bd43-ed6b3035506c",
                    "name": "FareShare UK",
                    "countries_id": 2635167,
                    "provinces_id": 6269131,
                    "counties_id": 2648110,
                    "official_id": null,
                    "accept_by_offset": 30,
                    "phone": "+442073942468",
                    "address_1": "Unit 7 Deptford Trading Estate",
                    "address_2": "Blackhorse Road",
                    "city_town": "London",
                    "post_code": "SE8 5HY",
                    "latitude": "51.48429100",
                    "longitude": "-0.03901200",
                    "description": "FareShare is the UK’s national network of charitable food redistributors, made up of 18 independent organisations. Together, we take good quality surplus food from right across the food industry and get it to almost 11,000 frontline charities and community groups.",
                    "food_safety_info": null,
                    "is_active": true,
                    "is_friend_group": 0,
                    "created_at": "2019-07-17T13:42:10.000000Z",
                    "updated_at": "2021-07-21T12:38:39.000000Z",
                    "deleted_at": null,
                    "in_line_address": "Unit 7 Deptford Trading Estate, Blackhorse Road, London SE8 5HY, Greater London, England, United Kingdom",
                    "county": {
                        "id": 2648110,
                        "countries_id": 2635167,
                        "provinces_id": 6269131,
                        "name": "Greater London",
                        "latitude": 51.5,
                        "longitude": -0.16667,
                        "created_at": "2021-03-15T00:26:10.000000Z",
                        "updated_at": "2021-03-15T00:26:10.000000Z",
                        "deleted_at": null
                    },
                    "province": {
                        "id": 6269131,
                        "countries_id": 2635167,
                        "name": "England",
                        "latitude": 52.16045,
                        "longitude": -0.70312,
                        "created_at": "2021-03-15T00:26:09.000000Z",
                        "updated_at": "2021-03-15T00:26:09.000000Z",
                        "deleted_at": null
                    },
                    "country": {
                        "id": 2635167,
                        "name": "United Kingdom",
                        "latitude": 54.75844,
                        "longitude": -2.69531,
                        "code": "GB",
                        "created_at": "2021-03-15T00:26:09.000000Z",
                        "updated_at": "2021-03-15T00:26:09.000000Z",
                        "deleted_at": null
                    }
                }
            }
        }
    },
    "frontendRedirect": false,
    "callTime": 0.08298206329345703,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Invalid UUID string: 00000032-13bc-47d1-93e2-8583495cd796"
    ],
    "frontendRedirect": false,
    "callTime": 0.017800092697143555,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/donation_responses/{uuid}

URL Parameters

uuid  string  

The UUID of the donation response.

Donation Windows

Get All Donation Windows for a Branch

requires authentication

This endpoint retrieves all branch's donation windows.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/donation_windows" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/donation_windows"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/donation_windows',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/donation_windows'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        {
            "uuid": "72c2ae39-2be2-84a2-064b-c381e280b92c",
            "starts_at": "10:00:00",
            "ends_at": "10:59:00",
            "day_of_week": 1,
            "created_at": "2019-09-29 05:52:50",
            "updated_at": "2019-09-29 05:52:50"
        },
        {
            "uuid": "c391c380-46c3-95c2-b7c5-a04cc2afc2af",
            "starts_at": "10:00:00",
            "ends_at": "10:59:00",
            "day_of_week": 2,
            "created_at": "2019-09-29 05:52:50",
            "updated_at": "2019-09-29 05:52:50"
        },
        {
            "uuid": "4014c380-e280-9a27-7f48-c3b7e2809dc3",
            "starts_at": "10:00:00",
            "ends_at": "10:59:00",
            "day_of_week": 3,
            "created_at": "2019-09-29 05:52:50",
            "updated_at": "2019-09-29 05:52:50"
        },
        {
            "uuid": "c2b1c3a4-c385-c3a9-c2b4-c3bf4c0bc2b2",
            "starts_at": "10:00:00",
            "ends_at": "10:59:00",
            "day_of_week": 4,
            "created_at": "2019-09-29 05:52:50",
            "updated_at": "2019-09-29 05:52:50"
        },
        {
            "uuid": "c2a6e280-9ce2-80a1-c2b2-c3b0134e2fe2",
            "starts_at": "10:00:00",
            "ends_at": "10:59:00",
            "day_of_week": 5,
            "created_at": "2019-09-29 05:52:50",
            "updated_at": "2019-09-29 05:52:50"
        }
    ],
    "callTime": 0.007502079010009766
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches/{branch}/donation_windows

URL Parameters

branch  string  

The UUID of the branch.

Donations

Get donations for Network Membership

requires authentication

This endpoint retrieves donation associated with a Network Membership.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/donations" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/donations"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/donations',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/donations'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "data": [
            {
                "external_id": "96ff536a-ca2d-4ff6-bc22-5f6a4a9e1b3c",
                "donation_date": "2022-08-11",
                "donation_time": "16:00",
                "donation_uuid": "75304d54-e150-47ff-a7da-e286c248d6dc",
                "ambient_total": 0,
                "chilled_total": 0,
                "frozen_total": 0,
                "hot_total": 0,
                "total": 0,
                "rag_status_color": "black",
                "rag_status_label": "l_no_posting",
                "created_at": "2022-08-11 16:00:03",
                "tsm_current_state": "No Posting",
                "accepted_by": null,
                "responses": [],
                "transitions": {
                    "received": {
                        "color": "outline-warning",
                        "icon": "fas fa-box",
                        "name": "Received",
                        "context": "donor"
                    }
                },
                "status_style": {
                    "color": "black",
                    "icon": "fas fa-exclamation-circle"
                },
                "tsm_current_state_label": "no_posting",
                "donor": {
                    "uuid": "9fbcb807-c331-4417-8691-7e202c95bd23",
                    "name": "Little Extra Grocer IOFN 1.5",
                    "countries_id": 2963597,
                    "provinces_id": 7521316,
                    "counties_id": 2964751,
                    "official_id": "LEG:2225",
                    "address_1": "36 Main Street",
                    "address_2": "District A4",
                    "city_town": "Bundoran",
                    "post_code": "F94 YHR6",
                    "phone": null,
                    "latitude": "54.91667000",
                    "longitude": "-8.00000000",
                    "timezone": "Europe/Dublin",
                    "locale": "en_IE",
                    "is_active": 1,
                    "is_foodboard_allowed": 1,
                    "esign": 0,
                    "send_daily_donations_reminders": false,
                    "send_instant_donations_reminders": false,
                    "offers_token_counter": 0,
                    "created_at": "2022-08-11T08:48:59.000000Z",
                    "updated_at": "2022-08-11T08:48:59.000000Z",
                    "deleted_at": null,
                    "in_line_address": "36 Main Street, District A4, Bundoran F94 YHR6, Co. Donegal, Ulster, Ireland",
                    "local_admins": [
                        {
                            "uuid": "bef8dcdb-ac18-4425-b4b8-4772ec082ffe",
                            "first_name": "Catherine",
                            "surname": "Delaney",
                            "language_code": "en_IE",
                            "mobile_number": null,
                            "email": "[email protected]",
                            "email_verified_at": "2022-08-11T08:49:01.000000Z",
                            "activation_key": null,
                            "restoration_key": null,
                            "is_active": 1,
                            "failed_logins": 0,
                            "is_organisation_admin": 1,
                            "one_signal_id": null,
                            "created_at": "2022-08-11T08:49:01.000000Z",
                            "updated_at": "2022-08-11T08:49:01.000000Z",
                            "deleted_at": null,
                            "full_name": "Catherine Delaney",
                            "role": "admin",
                            "organisation": {
                                "uuid": "4fde3f5b-eadd-4fe9-9844-5e2a405ada13",
                                "name": "Little Extra Grocer Group",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": "MRTDonorOrg",
                                "accept_by_offset": 30,
                                "phone": null,
                                "address_1": "Test Address Line 1",
                                "address_2": "Test Address Line 2",
                                "city_town": "Dublin",
                                "post_code": "FV12345",
                                "latitude": "53.35512000",
                                "longitude": "-6.24922000",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_friend_group": 0,
                                "created_at": "2022-08-11T08:48:59.000000Z",
                                "updated_at": "2022-08-11T08:48:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "Test Address Line 1, Test Address Line 2, Dublin FV12345, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922,
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121,
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE",
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                }
                            }
                        },
                        {
                            "uuid": "d71f399a-bb6c-48b3-82ab-716551c60df8",
                            "first_name": "Org",
                            "surname": "Admin",
                            "language_code": "en_IE",
                            "mobile_number": null,
                            "email": "[email protected]",
                            "email_verified_at": "2022-08-11T08:49:01.000000Z",
                            "activation_key": null,
                            "restoration_key": null,
                            "is_active": 1,
                            "failed_logins": 0,
                            "is_organisation_admin": 1,
                            "one_signal_id": null,
                            "created_at": "2022-08-11T08:49:01.000000Z",
                            "updated_at": "2022-08-11T08:51:40.000000Z",
                            "deleted_at": null,
                            "full_name": "Org Admin",
                            "role": "admin",
                            "organisation": {
                                "uuid": "4fde3f5b-eadd-4fe9-9844-5e2a405ada13",
                                "name": "Little Extra Grocer Group",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": "MRTDonorOrg",
                                "accept_by_offset": 30,
                                "phone": null,
                                "address_1": "Test Address Line 1",
                                "address_2": "Test Address Line 2",
                                "city_town": "Dublin",
                                "post_code": "FV12345",
                                "latitude": "53.35512000",
                                "longitude": "-6.24922000",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_friend_group": 0,
                                "created_at": "2022-08-11T08:48:59.000000Z",
                                "updated_at": "2022-08-11T08:48:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "Test Address Line 1, Test Address Line 2, Dublin FV12345, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922,
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121,
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE",
                                    "created_at": "2022-07-27T13:30:57.000000Z",
                                    "updated_at": "2022-07-27T13:30:57.000000Z",
                                    "deleted_at": null
                                }
                            }
                        },
                        {
                            "uuid": "472eadcd-e160-4a0f-b2f5-1d2e742e1b00",
                            "first_name": "Duty 04",
                            "surname": "Manager",
                            "language_code": "en_IE",
                            "mobile_number": null,
                            "email": "[email protected]",
                            "email_verified_at": "2022-08-11T08:49:01.000000Z",
                            "activation_key": null,
                            "restoration_key": null,
                            "is_active": 1,
                            "failed_logins": 0,
                            "is_organisation_admin": 0,
                            "one_signal_id": null,
                            "created_at": "2022-08-11T08:49:01.000000Z",
                            "updated_at": "2022-08-11T08:49:01.000000Z",
                            "deleted_at": null,
                            "full_name": "Duty 04 Manager",
                            "role": "user"
                        }
                    ],
                    "county": {
                        "id": 2964751,
                        "countries_id": 2963597,
                        "provinces_id": 7521316,
                        "name": "Co. Donegal",
                        "latitude": 54.91667,
                        "longitude": -8,
                        "created_at": "2022-07-27T13:30:57.000000Z",
                        "updated_at": "2022-07-27T13:31:08.000000Z",
                        "deleted_at": null
                    },
                    "province": {
                        "id": 7521316,
                        "countries_id": 2963597,
                        "name": "Ulster",
                        "latitude": 54.92732,
                        "longitude": -7.9395,
                        "created_at": "2022-07-27T13:30:57.000000Z",
                        "updated_at": "2022-07-27T13:30:57.000000Z",
                        "deleted_at": null
                    },
                    "country": {
                        "id": 2963597,
                        "name": "Ireland",
                        "latitude": 53,
                        "longitude": -8,
                        "code": "IE",
                        "created_at": "2022-07-27T13:30:57.000000Z",
                        "updated_at": "2022-07-27T13:30:57.000000Z",
                        "deleted_at": null
                    }
                },
                "network": {
                    "uuid": "9228d079-8e57-4cec-92b6-55ac7ed4c62d",
                    "description": null,
                    "max_donation_volume_kg": null,
                    "donation_interval": 30,
                    "requirements": null,
                    "default_co2e": 3.2,
                    "default_meals_per_kg": 2.2,
                    "silence_collection_window_invitation_notifications": null,
                    "silence_network_membership_notifications": null,
                    "created_at": "2022-08-11T08:48:59.000000Z",
                    "updated_at": "2022-08-11T08:48:59.000000Z",
                    "deleted_at": null,
                    "is_public": false
                }
            }
        ],
        "recordsFiltered": 1,
        "recordsTotal": 1
    },
    "frontendRedirect": false,
    "callTime": 0.02938985824584961,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/donations

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get donations for.

Endpoints

Rest user password

requires authentication

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/user/invite/resend" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/invite/resend"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/user/invite/resend',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/invite/resend'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (422):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_required"
        }
    ],
    "frontendRedirect": false,
    "callTime": 0.007164955139160156,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

POST api/user/invite/resend

PUT api/user/activate

requires authentication

Example request:
curl --request PUT \
    "https://api-qa.foodiverse.net/api/user/activate" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/activate"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api-qa.foodiverse.net/api/user/activate',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/activate'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('PUT', url, headers=headers)
response.json()

Example response (400):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "Undefined array key \"activation_key\""
    ],
    "frontendRedirect": false,
    "callTime": 0.0020439624786376953,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

PUT api/user/activate

Generate restoration key and send an email with reset password link to a user

requires authentication

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/user/password/reset" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/password/reset"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/user/password/reset',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/password/reset'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (400):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_required"
        }
    ],
    "frontendRedirect": false,
    "callTime": 0.002307891845703125,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

POST api/user/password/reset

Rest user password

requires authentication

Example request:
curl --request PUT \
    "https://api-qa.foodiverse.net/api/user/password/reset" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/password/reset"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api-qa.foodiverse.net/api/user/password/reset',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/password/reset'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('PUT', url, headers=headers)
response.json()

Example response (400):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "Undefined array key \"restoration_key\""
    ],
    "frontendRedirect": false,
    "callTime": 0.0037479400634765625,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

PUT api/user/password/reset

Get active user details

requires authentication

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/organisation" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/organisation"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/organisation',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/organisation'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0017189979553222656,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user/organisation

GET api/user/file/my-files

requires authentication

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/file/my-files" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/file/my-files"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/file/my-files',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/file/my-files'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014030933380126953,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user/file/my-files

Membership Schedule

Get Schedules

requires authentication

This endpoint retrieves max 250 schedules for a given member.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules?page=17" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules"
);

const params = {
    "page": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '17',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules'
params = {
  'page': '17',
}
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001592874526977539,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/schedules

URL Parameters

network_membership_uuid  string  

The UUID of the network membership to get schedules for.

Query Parameters

page  integer optional  

The page number to return

Network Membership

responseFile 200 api_docs_responses/network_memberships/network_membership_index_200.json

Get All Network Memberships

requires authentication

This endpoint retrieves all of a user's network memberships.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0015189647674560547,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships

Get Network Membership

requires authentication

This endpoint retrieve details of the specified Network Membership.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "uuid": "89eb6d21-5725-4ab9-9073-53299b050d09",
        "tsm_current_state": "Activated",
        "created_at": "2022-07-27T13:30:59.000000Z",
        "updated_at": "2022-08-05T14:16:13.000000Z",
        "cancellation_requested": 0,
        "transitions": [],
        "status_style": {
            "color": "green",
            "icon": "far fa-play-circle"
        },
        "tsm_current_state_label": "activated",
        "network": {
            "uuid": "dcf25829-b101-4d07-b108-399989c8e87f",
            "description": null,
            "max_donation_volume_kg": null,
            "donation_interval": 30,
            "requirements": null,
            "default_co2e": 3.2,
            "default_meals_per_kg": 2.2,
            "silence_collection_window_invitation_notifications": null,
            "silence_network_membership_notifications": null,
            "created_at": "2022-07-27T13:30:58.000000Z",
            "updated_at": "2022-07-27T13:30:58.000000Z",
            "deleted_at": null,
            "is_public": false,
            "organisation": {
                "uuid": "c42c9046-3af9-4c16-bca3-768e0b7c1a5a",
                "name": "FoodCloud",
                "countries_id": 2963597,
                "provinces_id": null,
                "counties_id": null,
                "official_id": null,
                "accept_by_offset": 30,
                "phone": null,
                "address_1": null,
                "address_2": null,
                "city_town": null,
                "post_code": null,
                "latitude": "0.00000000",
                "longitude": "0.00000000",
                "description": null,
                "food_safety_info": null,
                "is_active": true,
                "is_friend_group": 0,
                "created_at": "2022-07-27T13:30:58.000000Z",
                "updated_at": "2022-07-27T13:30:58.000000Z",
                "deleted_at": null,
                "in_line_address": "Ireland",
                "county": null,
                "province": null,
                "country": {
                    "id": 2963597,
                    "name": "Ireland",
                    "latitude": 53,
                    "longitude": -8,
                    "code": "IE",
                    "created_at": "2022-07-27T13:30:57.000000Z",
                    "updated_at": "2022-07-27T13:30:57.000000Z",
                    "deleted_at": null
                }
            }
        },
        "branch": {
            "uuid": "108ea35b-0795-4db3-ac00-155a872e66d7",
            "name": "FoodCloud branch 1",
            "countries_id": 2963597,
            "provinces_id": null,
            "counties_id": 0,
            "official_id": null,
            "address_1": null,
            "address_2": null,
            "city_town": null,
            "post_code": null,
            "phone": null,
            "latitude": "0.00000000",
            "longitude": "0.00000000",
            "timezone": "Europe/Dublin",
            "locale": "en_IE",
            "is_active": 1,
            "is_foodboard_allowed": 1,
            "esign": 0,
            "send_daily_donations_reminders": false,
            "send_instant_donations_reminders": false,
            "offers_token_counter": 0,
            "created_at": "2022-07-27T13:30:58.000000Z",
            "updated_at": "2022-07-27T13:30:58.000000Z",
            "deleted_at": null,
            "in_line_address": "Ireland",
            "organisation": {
                "uuid": "c42c9046-3af9-4c16-bca3-768e0b7c1a5a",
                "name": "FoodCloud",
                "countries_id": 2963597,
                "provinces_id": null,
                "counties_id": null,
                "official_id": null,
                "accept_by_offset": 30,
                "phone": null,
                "address_1": null,
                "address_2": null,
                "city_town": null,
                "post_code": null,
                "latitude": "0.00000000",
                "longitude": "0.00000000",
                "description": null,
                "food_safety_info": null,
                "is_active": true,
                "is_friend_group": 0,
                "created_at": "2022-07-27T13:30:58.000000Z",
                "updated_at": "2022-07-27T13:30:58.000000Z",
                "deleted_at": null,
                "in_line_address": "Ireland",
                "organisation_type": {
                    "uuid": "12ff994e-46fe-40fe-8cb2-cec6ebf1a244",
                    "name": "FoodBank",
                    "created_at": "2022-07-27T13:30:58.000000Z",
                    "updated_at": "2022-07-27T13:30:58.000000Z"
                },
                "county": null,
                "province": null,
                "country": {
                    "id": 2963597,
                    "name": "Ireland",
                    "latitude": 53,
                    "longitude": -8,
                    "code": "IE",
                    "created_at": "2022-07-27T13:30:57.000000Z",
                    "updated_at": "2022-07-27T13:30:57.000000Z",
                    "deleted_at": null
                }
            },
            "country": {
                "id": 2963597,
                "name": "Ireland",
                "latitude": 53,
                "longitude": -8,
                "code": "IE",
                "created_at": "2022-07-27T13:30:57.000000Z",
                "updated_at": "2022-07-27T13:30:57.000000Z",
                "deleted_at": null
            },
            "province": null,
            "county": null,
            "local_users": [
                {
                    "uuid": "5261f93d-2412-45b2-9602-0e4318254e08",
                    "first_name": "First",
                    "surname": "Last",
                    "language_code": "en_IE",
                    "mobile_number": null,
                    "email": "[email protected]",
                    "email_verified_at": "2022-07-27T13:30:58.000000Z",
                    "activation_key": null,
                    "restoration_key": null,
                    "is_active": 1,
                    "failed_logins": 0,
                    "is_organisation_admin": 1,
                    "one_signal_id": null,
                    "created_at": "2022-07-27T13:30:58.000000Z",
                    "updated_at": "2022-08-05T14:16:13.000000Z",
                    "deleted_at": null,
                    "full_name": "First Last",
                    "role": "foodnet_administrator",
                    "organisation": {
                        "uuid": "c42c9046-3af9-4c16-bca3-768e0b7c1a5a",
                        "name": "FoodCloud",
                        "countries_id": 2963597,
                        "provinces_id": null,
                        "counties_id": null,
                        "official_id": null,
                        "accept_by_offset": 30,
                        "phone": null,
                        "address_1": null,
                        "address_2": null,
                        "city_town": null,
                        "post_code": null,
                        "latitude": "0.00000000",
                        "longitude": "0.00000000",
                        "description": null,
                        "food_safety_info": null,
                        "is_active": true,
                        "is_friend_group": 0,
                        "created_at": "2022-07-27T13:30:58.000000Z",
                        "updated_at": "2022-07-27T13:30:58.000000Z",
                        "deleted_at": null,
                        "in_line_address": "Ireland",
                        "county": null,
                        "province": null,
                        "country": {
                            "id": 2963597,
                            "name": "Ireland",
                            "latitude": 53,
                            "longitude": -8,
                            "code": "IE",
                            "created_at": "2022-07-27T13:30:57.000000Z",
                            "updated_at": "2022-07-27T13:30:57.000000Z",
                            "deleted_at": null
                        }
                    }
                }
            ],
            "delegated_admins": []
        },
        "delegated_admins": [
            {
                "uuid": "5261f93d-2412-45b2-9602-0e4318254e08",
                "first_name": "First",
                "surname": "Last",
                "language_code": "en_IE",
                "mobile_number": null,
                "email": "[email protected]",
                "email_verified_at": "2022-07-27T13:30:58.000000Z",
                "activation_key": null,
                "restoration_key": null,
                "is_active": 1,
                "failed_logins": 0,
                "is_organisation_admin": 1,
                "one_signal_id": null,
                "created_at": "2022-07-27T13:30:58.000000Z",
                "updated_at": "2022-08-05T14:16:13.000000Z",
                "deleted_at": null,
                "full_name": "First Last",
                "role": "foodnet_administrator",
                "organisation": {
                    "uuid": "c42c9046-3af9-4c16-bca3-768e0b7c1a5a",
                    "name": "FoodCloud",
                    "countries_id": 2963597,
                    "provinces_id": null,
                    "counties_id": null,
                    "official_id": null,
                    "accept_by_offset": 30,
                    "phone": null,
                    "address_1": null,
                    "address_2": null,
                    "city_town": null,
                    "post_code": null,
                    "latitude": "0.00000000",
                    "longitude": "0.00000000",
                    "description": null,
                    "food_safety_info": null,
                    "is_active": true,
                    "is_friend_group": 0,
                    "created_at": "2022-07-27T13:30:58.000000Z",
                    "updated_at": "2022-07-27T13:30:58.000000Z",
                    "deleted_at": null,
                    "in_line_address": "Ireland",
                    "county": null,
                    "province": null,
                    "country": {
                        "id": 2963597,
                        "name": "Ireland",
                        "latitude": 53,
                        "longitude": -8,
                        "code": "IE",
                        "created_at": "2022-07-27T13:30:57.000000Z",
                        "updated_at": "2022-07-27T13:30:57.000000Z",
                        "deleted_at": null
                    }
                }
            }
        ]
    },
    "frontendRedirect": false,
    "callTime": 0.02353215217590332,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Example response (403):

{
    "status": "error",
    "data": [
        "e_forbidden"
    ],
    "frontendRedirect": false,
    "callTime": 0.004044055938720703,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership}

URL Parameters

network_membership  string  

The UUID of the Network Membership to get.

Update Network Membership

requires authentication

This endpoint updates the specified Network Membership.

Example request:
curl --request PUT \
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('PUT', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0015900135040283203,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

PUT api/foodnet/network_memberships/{network_membership}

PATCH api/foodnet/network_memberships/{network_membership}

URL Parameters

network_membership  string  

The UUID of the Network Membership to update.

Apply for Network Membership

requires authentication

This endpoint enables branches to apply for membership of a network.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/apply" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"branches\": [
        \"e1adf699-172b-491f-922a-9e036aea94be\",
        \"c4d42056-680f-4747-9de9-8188c017a868\"
    ]
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/apply"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "branches": [
        "e1adf699-172b-491f-922a-9e036aea94be",
        "c4d42056-680f-4747-9de9-8188c017a868"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/apply',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'branches' => [
                'e1adf699-172b-491f-922a-9e036aea94be',
                'c4d42056-680f-4747-9de9-8188c017a868',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/apply'
payload = {
    "branches": [
        "e1adf699-172b-491f-922a-9e036aea94be",
        "c4d42056-680f-4747-9de9-8188c017a868"
    ]
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0015239715576171875,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

POST api/foodnet/network_memberships/{network_uuid}/apply

URL Parameters

network_uuid  string  

The UUID of the network to apply for membership.

Body Parameters

branches  string[]  

The UUIDS of the Branches to apply for network membership.

Networking

Get Network Organisations

requires authentication

This endpoint retrieves all Network Organisations for a user

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/network_organisation?organisation_type=DONOR" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/network_organisation"
);

const params = {
    "organisation_type": "DONOR",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/network_organisation',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'organisation_type'=> 'DONOR',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/network_organisation'
params = {
  'organisation_type': 'DONOR',
}
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001767873764038086,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user/network_organisation

Query Parameters

organisation_type  string optional  

String The type of organisation to return.

Offers

Create product level data

requires authentication

Add product level data to a donation response

Example request:
curl --request PUT \
    "https://api-qa.foodiverse.net/api/donation/responses/consequatur/products" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"products\": \"consequatur\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/donation/responses/consequatur/products"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "products": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api-qa.foodiverse.net/api/donation/responses/consequatur/products',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'products' => 'consequatur',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/donation/responses/consequatur/products'
payload = {
    "products": "consequatur"
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "uuid": "c5a1c2a8-45c2-a338-1f4f-c39ac2bb0dc2",
        "products": [
            {
                "category_id": "ae3c1161-0b4c-48b0-a6e7-f054882d41b2",
                "brand": "Test Brand",
                "product_type": "Test Type",
                "units": "Kg",
                "name": "Test Name",
                "currency": "EUR",
                "code": "123456789",
                "quantity": "2",
                "total_weight": "2",
                "discounted_unit_price": "1.24",
                "original_unit_price": "1.24",
                "expiry_type": "l_use_by | l_best_before",
                "expiry_date": "2022-01-01 00:00:00",
                "batch_code": "123456789",
                "stock_code": "123456789",
                "ingredients": "Test ingredients",
                "allergens": "Test allergens",
                "nutrition": "Test nutrition"
            }
        ]
    },
    "callTime": 0.00594019889831543
}
 

Example response (400):

{
    "status": "error",
    "data": {
        "errors": [
            {
                "field": "products.0.category_id",
                "message": "e_category_id_required"
            },
            {
                "field": "products.0.units",
                "message": "e_units_required"
            },
            {
                "field": "products.0.name",
                "message": "e_name_required"
            },
            {
                "field": "products.0.code",
                "message": "e_code_required"
            },
            {
                "field": "products.0.quantity",
                "message": "e_quantity_required"
            },
            {
                "field": "products.0.weight",
                "message": "e_weight_required"
            }
        ]
    }
}
 

Example response (401):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

PUT api/donation/responses/{response_uuid}/products

URL Parameters

response_uuid  string  

Body Parameters

products  Products  

Array

products.*  object  

products.*.category_id  Uuid  

products.*.normalised_products_id  Uuid  

Required without category_id

products.*.code  String  

The barcode or EAN of the product item. Required without normalised_products_id

products.*.name   optional  

String

products.*.brand  String optional  

products.*.product_type   optional  

String

products.*.units  String optional  

products.*.currency   optional  

String

products.*.quantity   optional  

Numeric

products.*.unit_weight  Numeric optional  

products.*.total_weight  Numeric optional  

products.*.original_unit_price  Numeric optional  

products.*.discounted_unit_price   optional  

Numeric

products.*.total_price   optional  

Numeric

products.*.expiry_type  String optional  

l_use_by or l_best_before

products.*.expiry_date   optional  

Date

products.*.batch_code  String optional  

products.*.stock_code  String optional  

products.*.ingredients   optional  

String

products.*.allergens  String optional  

products.*.nutrition  String optional  

Get offers for Network Membership

requires authentication

This endpoint retrieves offers associated with a Network Membership.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/offers" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/offers"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/offers',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/offers'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "data": [],
        "recordsFiltered": 0,
        "recordsTotal": 0
    },
    "frontendRedirect": false,
    "callTime": 0.006829977035522461,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/offers

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get offers for.

OneSignal

Get All OneSignal IDs for user

requires authentication

This endpoint retrieves all user's OneSignal IDs.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/one_signal" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/one_signal"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/one_signal',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/one_signal'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "data": [
            {
                "player_id": "e9866105-0aaa-4657-99cf-3700137faaf2",
                "created_at": null,
                "updated_at": null
            }
        ],
        "recordsFiltered": 1,
        "recordsTotal": 1
    },
    "callTime": 0.0011870861053466797
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/one_signal

Add OneSignal ID

requires authentication

This endpoint add's a specific user's OneSignal ID.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/user/one_signal" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"player_id\": \"5ce3a914-8a20-4e83-9e5a-059361de5d04\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/one_signal"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "player_id": "5ce3a914-8a20-4e83-9e5a-059361de5d04"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/user/one_signal',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'player_id' => '5ce3a914-8a20-4e83-9e5a-059361de5d04',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/one_signal'
payload = {
    "player_id": "5ce3a914-8a20-4e83-9e5a-059361de5d04"
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "player_id": "e9866105-0aaa-4657-99cf-3700137faafd",
        "updated_at": "2020-05-19 13:20:35",
        "created_at": "2020-05-19 13:20:35",
        "id": 0
    },
    "callTime": 0.003256082534790039
}
 

Example response (400):

{
    "status": "error",
    "data": [
        {
            "field": "player_id",
            "message": "e_player_id_must_be_unique"
        }
    ],
    "callTime": 0.001772165298461914
}
 

Request      

POST api/user/one_signal

Body Parameters

player_id  String  

The Player ID to add to the user.

Delete OneSignal ID

requires authentication

This endpoint removes an authenticated user's OneSignal player_id

Example request:
curl --request DELETE \
    "https://api-qa.foodiverse.net/api/user/one_signal/5ce3a914-8a20-4e83-9e5a-059361de5d04" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/one_signal/5ce3a914-8a20-4e83-9e5a-059361de5d04"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api-qa.foodiverse.net/api/user/one_signal/5ce3a914-8a20-4e83-9e5a-059361de5d04',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/one_signal/5ce3a914-8a20-4e83-9e5a-059361de5d04'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "player_id": "5ce3a914-8a20-4e83-9e5a-059361de5d04"
    },
    "frontendRedirect": false,
    "callTime": 0.006357908248901367,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Example response (404):

{
    "status": "error",
    "data": [
        "l_not_found"
    ],
    "frontendRedirect": false,
    "callTime": 0.003927946090698242,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

DELETE api/user/one_signal/{id}

URL Parameters

id  string  

The Player ID to delete.

Registration

Register

Register as an organization admin using your personal and organization details.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/user/register" \
    --header "Content-Type: application/json" \
    --data "{
    \"first_name\": \"Test\",
    \"surname\": \"User\",
    \"email\": \"[email protected]\",
    \"mobile_number\": \"+353861234567\",
    \"mobile_number_country_code\": \"IE\",
    \"phone\": \"+353868730746\",
    \"phone_country_code\": \"IE\",
    \"name\": \"Test FoodBank\",
    \"organisation_type\": \"{}\",
    \"address_1\": \"8 Broom hill road\",
    \"address_2\": \"Tallaght\",
    \"postcode\": \"D24 CD32\",
    \"city_town\": \"Dublin\",
    \"country\": [],
    \"province\": [],
    \"county\": [],
    \"latitude\": 53.2939631,
    \"longitude\": -6.3621539,
    \"language_code\": \"en_IE\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "Test",
    "surname": "User",
    "email": "[email protected]",
    "mobile_number": "+353861234567",
    "mobile_number_country_code": "IE",
    "phone": "+353868730746",
    "phone_country_code": "IE",
    "name": "Test FoodBank",
    "organisation_type": "{}",
    "address_1": "8 Broom hill road",
    "address_2": "Tallaght",
    "postcode": "D24 CD32",
    "city_town": "Dublin",
    "country": [],
    "province": [],
    "county": [],
    "latitude": 53.2939631,
    "longitude": -6.3621539,
    "language_code": "en_IE"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api-qa.foodiverse.net/api/user/register',
    [
        'headers' => [
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'first_name' => 'Test',
            'surname' => 'User',
            'email' => '[email protected]',
            'mobile_number' => '+353861234567',
            'mobile_number_country_code' => 'IE',
            'phone' => '+353868730746',
            'phone_country_code' => 'IE',
            'name' => 'Test FoodBank',
            'organisation_type' => '{}',
            'address_1' => '8 Broom hill road',
            'address_2' => 'Tallaght',
            'postcode' => 'D24 CD32',
            'city_town' => 'Dublin',
            'country' => [],
            'province' => [],
            'county' => [],
            'latitude' => 53.2939631,
            'longitude' => -6.3621539,
            'language_code' => 'en_IE',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/register'
payload = {
    "first_name": "Test",
    "surname": "User",
    "email": "[email protected]",
    "mobile_number": "+353861234567",
    "mobile_number_country_code": "IE",
    "phone": "+353868730746",
    "phone_country_code": "IE",
    "name": "Test FoodBank",
    "organisation_type": "{}",
    "address_1": "8 Broom hill road",
    "address_2": "Tallaght",
    "postcode": "D24 CD32",
    "city_town": "Dublin",
    "country": [],
    "province": [],
    "county": [],
    "latitude": 53.2939631,
    "longitude": -6.3621539,
    "language_code": "en_IE"
}
headers = {
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "status": "success",
    "data": [
        "m_account_registered"
    ],
    "callTime": 0.1523888111114502
}
 

Example response (400):

{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_unique"
        }
    ],
    "callTime": 0.04615497589111328
}
 

Request      

POST api/user/register

Body Parameters

first_name  String  

First name of the user.

surname  String  

Surname of the user.

email  String  

The email of the user.

mobile_number  String  

Mobile number of the user.

mobile_number_country_code  String  

The country code of the mobile_number provided.

phone  String  

Organization phone number

phone_country_code  String  

Organization phone number.

name  String  

Organization Name.

organisation_type  Object  

Organisation Type Object.

address_1  String  

Organisation address line 1.

address_2  String optional  

Organisation address line 2.

postcode  String  

Organisations Eir Code.

city_town  String  

Organisation city / town.

country  object  

Country Object containing details about country where organisation resides.

province  object  

Province Object containing details about province where organisation resides.

county  object  

County Object containing details about county where organisation resides.

latitude  number optional  

Organisation latitude.

longitude  number optional  

Organisation longitude.

language_code  String optional  

Preferred language.

Reports

Get Donations by status report

requires authentication

This endpoint returns a report of donations by status for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_status" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_status"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_status',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_status'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0013971328735351562,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/donations_by_status

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Get donations by storage type report

requires authentication

This endpoint returns a report of donations by storage type for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_storage_type" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_storage_type"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_storage_type',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_storage_type'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014739036560058594,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/donations_by_storage_type

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Get donations by parent category report

requires authentication

This endpoint returns a report of donations by parent category for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_parent_category" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_parent_category"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_parent_category',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_parent_category'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014030933380126953,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/donations_by_parent_category

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Get offers by storage type report

requires authentication

This endpoint returns a report of offers by storage type for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_storage_type" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_storage_type"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_storage_type',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_storage_type'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0015680789947509766,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/offers_by_storage_type

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Get offers by parent category report

requires authentication

This endpoint returns a report of offers by parent category for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_parent_category" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_parent_category"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_parent_category',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_parent_category'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014951229095458984,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/offers_by_parent_category

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Get offers by status report

requires authentication

This endpoint returns a report of offers by status for a network membership

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_status" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_status"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_status',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_status'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0017099380493164062,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/foodnet/network_memberships/{network_membership_uuid}/reports/offers_by_status

URL Parameters

network_membership_uuid  string  

The UUID of the Network Membership to get the report for.

Schedules

Get Quick Donation Schedule

requires authentication

Returns the nearest donation windows and next collection window schedule for a branch

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/quick-donation/schedules" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/quick-donation/schedules"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/quick-donation/schedules',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/quick-donation/schedules'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012907981872558594,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user/branches/{branch}/quick-donation/schedules

URL Parameters

branch  string  

The UUID of the branch.

Get Branch Schedules

requires authentication

Get all the branch schedules across all the foodnets

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014109611511230469,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user/branches/{branch}/schedules

URL Parameters

branch  string  

The UUID of the branch.

Units of Measure

Get All Units of Measure for a Branch

requires authentication

This endpoint retrieves all branch's units of measure.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/measure_units" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/measure_units"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/measure_units',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/measure_units'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "status": "success",
    "data": {
        "data": [
            {
                "uuid": "20202020-8950-4e47-0d0a-1a0a00000000",
                "name": "Tray",
                "kg_weight_per_unit": 6.5,
                "created_at": "2019-11-22 21:29:08",
                "updated_at": "2019-11-22 21:29:08",
                "deleted_at": null
            },
            {
                "uuid": "3ea609e7-bb67-45c1-a158-a18364fa67c3",
                "name": "Kg",
                "kg_weight_per_unit": 1,
                "created_at": "2019-11-22 21:29:08",
                "updated_at": "2019-11-22 21:29:08",
                "deleted_at": null
            }
        ],
        "recordsFiltered": 2,
        "recordsTotal": 2
    },
    "callTime": 0.006726980209350586
}
 

Example response (400):

{
    "status": "error",
    "data": [
        "Unauthorized"
    ],
    "callTime": 0.0020160675048828125
}
 

Request      

GET api/user/branches/{branch}/measure_units

URL Parameters

branch  string  

The UUID of the branch.

User

Get active user details

requires authentication

This endpoint returns the information for the authenticated user.

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/user" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api-qa.foodiverse.net/api/user',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user'
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001672983169555664,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

GET api/user

Update active user information

requires authentication

This endpoint updates the information for the authenticated user.

Example request:
curl --request PUT \
    "https://api-qa.foodiverse.net/api/user" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"first_name\": \"Test\",
    \"surname\": \"User\",
    \"email\": \"[email protected]\",
    \"mobile_number\": \"+353861234567\",
    \"language_code\": \"en_IE\",
    \"is_organisation_admin\": \"0\",
    \"password\": \"consequatur\",
    \"password_confirmation\": \"consequatur\",
    \"password_current\": \"consequatur\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "Test",
    "surname": "User",
    "email": "[email protected]",
    "mobile_number": "+353861234567",
    "language_code": "en_IE",
    "is_organisation_admin": "0",
    "password": "consequatur",
    "password_confirmation": "consequatur",
    "password_current": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api-qa.foodiverse.net/api/user',
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'first_name' => 'Test',
            'surname' => 'User',
            'email' => '[email protected]',
            'mobile_number' => '+353861234567',
            'language_code' => 'en_IE',
            'is_organisation_admin' => '0',
            'password' => 'consequatur',
            'password_confirmation' => 'consequatur',
            'password_current' => 'consequatur',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/user'
payload = {
    "first_name": "Test",
    "surname": "User",
    "email": "[email protected]",
    "mobile_number": "+353861234567",
    "language_code": "en_IE",
    "is_organisation_admin": "0",
    "password": "consequatur",
    "password_confirmation": "consequatur",
    "password_current": "consequatur"
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
 
{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0016789436340332031,
    "charityIosVersion": "1.0.0",
    "charityAndroidVersion": "1.0.0",
    "donorIosVersion": "1.0.0",
    "donorAndroidVersion": "1.0.0",
    "foodbankIosVersion": "1.0.0",
    "foodbankAndroidVersion": "1.0.0",
    "newAppUrl": "http://food.cloud/new-app"
}
 

Request      

PUT api/user

Body Parameters

first_name  String  

First name of the user.

surname  String  

Surname of the user.

email  String optional  

The email of the user.

mobile_number  String  

Mobile number of the user.

language_code  String  

The language code of the user.

is_organisation_admin  Boolean optional  

(Can only be set by an organisation admin)

password  String optional  

New password

password_confirmation  String optional  

New password confirmation (Required if 'password' is set)

password_current  String optional  

Old password (Required if 'password' is set)