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

To authenticate requests, include 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();
$url = 'https://api-qa.foodiverse.net/api/user/login';
$response = $client->post(
    $url,
    [
        '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

Headers

Content-Type      

Example: application/json

Body Parameters

email   String   

The email of the user. Example: [email protected]

password   String   

The password of the user. Example: password

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();
$url = 'https://api-qa.foodiverse.net/api/user/logout';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

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/architecto" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/architecto"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/branches/architecto';
$response = $client->get(
    $url,
    [
        '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/architecto'
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,
        "geofilter_unit_of_distance": "l_kilometers",
        "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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the branch. Example: architecto

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/charities';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Get Schedules

requires authentication

This endpoint retrieves the store schedules

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

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

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

url = 'https://api-qa.foodiverse.net/api/branches/official_id/TESCO:4045/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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1982
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.00168609619140625,
    "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/branches/official_id/{official_id}/schedules

Headers

Authorization      

Example: Bearer {token}

URL Parameters

official_id   string   

The branch official ID. Example: TESCO:4045

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();
$url = 'https://api-qa.foodiverse.net/api/categories';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/categories/5ce3a914-8a20-4e83-9e5a-059361de5d04';
$response = $client->get(
    $url,
    [
        '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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The UUID of the category. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/admin/organisation/default_categories';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

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\": [
        \"architecto\"
    ]
}"
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": [
        "architecto"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/admin/organisation/default_categories';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'categories' => [
                'architecto',
            ],
        ],
    ]
);
$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": [
        "architecto"
    ]
}
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1983
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0013170242309570312,
    "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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

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();
$url = 'https://api-qa.foodiverse.net/api/organisation/default_categories';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

Body Parameters

return_order   String  optional  

optional, default ASC. Example: {url}?return_order=ASC|DESC

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/collection_windows';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Donation Response

Donation Record PDF To download the donation record in PDF format The locale in pdf is decided by donation response associated branch locale.

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04/download';
$response = $client->get(
    $url,
    [
        '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/download'
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}/download

Headers

Authorization      

Example: Bearer {token}

URL Parameters

uuid   string   

The UUID of the donation response. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/donation_responses/5ce3a914-8a20-4e83-9e5a-059361de5d04';
$response = $client->get(
    $url,
    [
        '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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

uuid   string   

The UUID of the donation response. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/donation_windows';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/donations';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get donations for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Get Food Board Offers

requires authentication

This endpoint retrieves food board offers associated with the current users branch based on whether Geofiltering is enabled or not For the field and search arrays multiple values can be defined according the backend requirements

Example request:
curl --request GET \
    --get "https://api-qa.foodiverse.net/api/foodboard/my_foodnets_donations?order%5Bfield%5D%5B%5D=donations.created_at&order%5Bdirection%5D%5B%5D=desc&parser=autocomplete&field%5B%5D=donor.county&search%5B%5D=2636561&max_distance=25&start=0&length=20&search%5Bvalue%5D=architecto&columns%5Bname%5D%5Bsearchable%5D=1&columns%5Bname%5D%5Bdata%5D=name&columns%5Bname%5D%5Bsearch%5D%5Bvalue%5D=%27%27&columns%5BminDate%5D%5Bsearchable%5D=1&columns%5BminDate%5D%5Bdata%5D=minDate&columns%5BminDate%5D%5Bsearch%5D%5Bvalue%5D=%27%27&columns%5BmaxDate%5D%5Bsearchable%5D=1&columns%5BmaxDate%5D%5Bdata%5D=maxDate&columns%5BmaxDate%5D%5Bsearch%5D%5Bvalue%5D=architecto" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/foodboard/my_foodnets_donations"
);

const params = {
    "order[field][]": "donations.created_at",
    "order[direction][]": "desc",
    "parser": "autocomplete",
    "field[]": "donor.county",
    "search[]": "2636561",
    "max_distance": "25",
    "start": "0",
    "length": "20",
    "search[value]": "architecto",
    "columns[name][searchable]": "1",
    "columns[name][data]": "name",
    "columns[name][search][value]": "''",
    "columns[minDate][searchable]": "1",
    "columns[minDate][data]": "minDate",
    "columns[minDate][search][value]": "''",
    "columns[maxDate][searchable]": "1",
    "columns[maxDate][data]": "maxDate",
    "columns[maxDate][search][value]": "architecto",
};
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();
$url = 'https://api-qa.foodiverse.net/api/foodboard/my_foodnets_donations';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'order[field][]' => 'donations.created_at',
            'order[direction][]' => 'desc',
            'parser' => 'autocomplete',
            'field[]' => 'donor.county',
            'search[]' => '2636561',
            'max_distance' => '25',
            'start' => '0',
            'length' => '20',
            'search[value]' => 'architecto',
            'columns[name][searchable]' => '1',
            'columns[name][data]' => 'name',
            'columns[name][search][value]' => '''',
            'columns[minDate][searchable]' => '1',
            'columns[minDate][data]' => 'minDate',
            'columns[minDate][search][value]' => '''',
            'columns[maxDate][searchable]' => '1',
            'columns[maxDate][data]' => 'maxDate',
            'columns[maxDate][search][value]' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api-qa.foodiverse.net/api/foodboard/my_foodnets_donations'
params = {
  'order[field][]': 'donations.created_at',
  'order[direction][]': 'desc',
  'parser': 'autocomplete',
  'field[]': 'donor.county',
  'search[]': '2636561',
  'max_distance': '25',
  'start': '0',
  'length': '20',
  'search[value]': 'architecto',
  'columns[name][searchable]': '1',
  'columns[name][data]': 'name',
  'columns[name][search][value]': '''',
  'columns[minDate][searchable]': '1',
  'columns[minDate][data]': 'minDate',
  'columns[minDate][search][value]': '''',
  'columns[maxDate][searchable]': '1',
  'columns[maxDate][data]': 'maxDate',
  'columns[maxDate][search][value]': 'architecto',
}
headers = {
  'Authorization': 'Bearer {token}'
}

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

Example response (200):


{
    "status": "success",
    "data": {
        "data": [
            {
                "uuid": "706e92e0-10c6-499c-bb17-890c8e9e5cfb",
                "networks_id": 65,
                "branches_id": 35375,
                "external_id": "9aae2923-ef86-4697-9362-1fc0b3aa2eb8",
                "organisations_id": 97,
                "is_max_collectors_reached": null,
                "received_at": "2023-11-23 08:27:32",
                "created_at": "2023-11-23 08:27:32",
                "updated_at": "2023-11-23 08:27:46",
                "deleted_at": null,
                "accepted_by": "2023-11-23 09:15:09",
                "collect_by": null,
                "primary_available_at": "2023-11-23 08:27:32",
                "waitlist_available_at": null,
                "foodboard_available_at": "2023-11-23 08:27:32",
                "donation_window_start_at": "2023-11-23 08:27:32",
                "donation_window_end_at": "2023-11-23 09:15:09",
                "tsm_current_state": "Offering",
                "require_friends": 0,
                "rag_status": 0,
                "all_items_taken": 0,
                "esign": 0,
                "donor_name": "Dev testing branch 1",
                "donor_logo": null,
                "ambient_total": 27,
                "chilled_total": 0.5,
                "frozen_total": 0,
                "hot_total": 0,
                "total": 27.5,
                "charity_uuid": "",
                "foodnet_name": "DEV TESTING FOODBANK",
                "foodnet_logo": null,
                "style": {
                    "color": "outline-green",
                    "icon": "fas fa-play"
                },
                "transitions": [],
                "tsm_current_state_label": "offering",
                "donor": {
                    "uuid": "06f5d981-f826-4798-8145-98c066f8f254",
                    "name": "Dev testing branch 1",
                    "countries_id": 2963597,
                    "provinces_id": 7521316,
                    "counties_id": 11353077,
                    "official_id": "DEV:1234",
                    "address_1": "4 Downshire Close",
                    "address_2": "Downshire Road",
                    "city_town": "Newry",
                    "post_code": "BT34 1FD",
                    "phone": "+442830252324",
                    "latitude": "54.18228360",
                    "longitude": "-6.33244040",
                    "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,
                    "prepare_donation_option": "l_product_and_category",
                    "default_categories_only": 0,
                    "approved_products_only": 0,
                    "geofilter_unit_of_distance": "l_kilometers",
                    "created_at": "2023-11-23T08:18:59.000000Z",
                    "updated_at": "2023-11-23T08:18:59.000000Z",
                    "deleted_at": null,
                    "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Co. Down, Ulster, Ireland",
                    "local_admins": [
                        {
                            "uuid": "818d8070-6dbc-43d5-935f-22139728124f",
                            "first_name": "Org",
                            "surname": "Admin",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487040",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:45.000000Z",
                            "updated_at": "2023-11-23T08:20:45.000000Z",
                            "full_name": "Org Admin",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "0f2019dd-4d6a-45f5-857e-2aa884d5f7ce",
                            "first_name": "Lawrence",
                            "surname": "Kibirige",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487049",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:22:08.000000Z",
                            "full_name": "Lawrence Kibirige",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "74835ede-07e4-401d-891c-23d97563976c",
                            "first_name": "Dayo",
                            "surname": "Aderemi",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487041",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "Dayo Aderemi",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "5e42dbeb-b62c-405a-a3df-e5f8b1957284",
                            "first_name": "Rourke",
                            "surname": "Bradley",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487043",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "Rourke Bradley",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "5d5601bd-86fb-4b8d-8716-67f5dd26c1da",
                            "first_name": "James",
                            "surname": "Clifford",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487042",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "James Clifford",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "9e8bc106-de6e-4af7-b128-17633d5cd6e4",
                            "first_name": "Brice",
                            "surname": "Mehelo",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487044",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "Brice Mehelo",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "f56725c6-e712-4118-82f3-17d06546403d",
                            "first_name": "Uchenna",
                            "surname": "Ibekwe",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487048",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "Uchenna Ibekwe",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "266d8855-c6e2-4995-89e2-9394650df35d",
                            "first_name": "Devika",
                            "surname": "Kulkarni",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487050",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:46.000000Z",
                            "updated_at": "2023-11-23T08:20:46.000000Z",
                            "full_name": "Devika Kulkarni",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "c9e11ef9-b222-4555-bbdd-ad1d816f91f8",
                            "first_name": "Suhail",
                            "surname": "Mirji",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487047",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:47.000000Z",
                            "updated_at": "2023-11-23T08:20:47.000000Z",
                            "full_name": "Suhail Mirji",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "5550a03c-7cbd-4126-aa77-8f3329025da5",
                            "first_name": "Keith",
                            "surname": "Phelan",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487045",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:47.000000Z",
                            "updated_at": "2023-11-23T08:20:47.000000Z",
                            "full_name": "Keith Phelan",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        },
                        {
                            "uuid": "bea38170-c7f4-4519-8397-e3a5c3e34569",
                            "first_name": "Ji",
                            "surname": "Zhang",
                            "language_code": "en_IE",
                            "mobile_number": "+353890487046",
                            "email": "[email protected]",
                            "is_active": 1,
                            "is_organisation_admin": 1,
                            "created_at": "2023-11-23T08:20:47.000000Z",
                            "updated_at": "2023-11-23T08:20:47.000000Z",
                            "full_name": "Ji Zhang",
                            "role": "foodnet_administrator",
                            "organisation": {
                                "uuid": "68ed35ac-cc4f-44d9-aa62-7eca66fef005",
                                "name": "DEV TESTING FOODBANK",
                                "countries_id": 2963597,
                                "provinces_id": 7521314,
                                "counties_id": 7778677,
                                "official_id": null,
                                "accept_by_offset": 30,
                                "phone": "+442830252324",
                                "address_1": "4 Downshire Close",
                                "address_2": "Downshire Road",
                                "city_town": "Newry",
                                "post_code": "BT34 1FD",
                                "latitude": "54.18228360",
                                "longitude": "-6.33244040",
                                "description": "This is a test org used for MRT",
                                "food_safety_info": "This is a test org used for MRT",
                                "is_active": true,
                                "is_featured": 0,
                                "is_friend_group": 0,
                                "receipt_sending_option": 1,
                                "created_at": "2023-11-23T08:18:59.000000Z",
                                "updated_at": "2023-11-23T08:18:59.000000Z",
                                "deleted_at": null,
                                "in_line_address": "4 Downshire Close, Downshire Road, Newry BT34 1FD, Dublin City, Leinster, Ireland",
                                "county": {
                                    "id": 7778677,
                                    "countries_id": 2963597,
                                    "provinces_id": 7521314,
                                    "name": "Dublin City",
                                    "latitude": 53.35512,
                                    "longitude": -6.24922
                                },
                                "province": {
                                    "id": 7521314,
                                    "countries_id": 2963597,
                                    "name": "Leinster",
                                    "latitude": 53.16667,
                                    "longitude": -7.02121
                                },
                                "country": {
                                    "id": 2963597,
                                    "name": "Ireland",
                                    "latitude": 53,
                                    "longitude": -8,
                                    "code": "IE"
                                }
                            }
                        }
                    ],
                    "county": {
                        "id": 11353077,
                        "countries_id": 2635167,
                        "provinces_id": 2641364,
                        "name": "Co. Down",
                        "latitude": 54.3277,
                        "longitude": -5.7158
                    },
                    "province": {
                        "id": 7521316,
                        "countries_id": 2963597,
                        "name": "Ulster",
                        "latitude": 54.92732,
                        "longitude": -7.9395
                    },
                    "country": {
                        "id": 2963597,
                        "name": "Ireland",
                        "latitude": 53,
                        "longitude": -8,
                        "code": "IE"
                    }
                },
                "network": {
                    "uuid": "0576c29f-4ca7-4af4-a972-ec7fc713fa66",
                    "activate_membership_required": 1,
                    "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": "2023-11-23T08:18:59.000000Z",
                    "updated_at": "2023-11-23T08:18:59.000000Z",
                    "deleted_at": null,
                    "is_public": false
                }
            }
        ],
        "recordsFiltered": 1,
        "recordsTotal": 1
    },
    "frontendRedirect": false,
    "callTime": 0.05941891670227051,
    "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 (401):


{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.03663492202758789,
    "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",
    "debug_error_message": "Unauthenticated.",
    "debug_error_trace": [
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
            "line": 68,
            "function": "unauthenticated",
            "class": "Illuminate\\Auth\\Middleware\\Authenticate",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
            "line": 42,
            "function": "authenticate",
            "class": "Illuminate\\Auth\\Middleware\\Authenticate",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\\Auth\\Middleware\\Authenticate",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 126,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 57,
            "function": "handleRequest",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/html/app/Http/Middleware/ApiRequestRateLimit.php",
            "line": 16,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "App\\Http\\Middleware\\ApiRequestRateLimit",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 116,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 797,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 776,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        }
    ]
}
 

Request      

GET api/foodboard/my_foodnets_donations

Headers

Authorization      

Example: Bearer {token}

Query Parameters

order[field][]   string  optional  

The field used to order the search. Example: donations.created_at

order[direction][]   string  optional  

The value used during query ordering. Example: desc

parser   string  optional  

The value used in parsing the query. Example: autocomplete

field[]   string  optional  

The field denoting the search column. Only used when geo-filtering is disabled. Example: donor.county

search[]   string  optional  

The value denoting the search parameter for the above field. Example: 2636561

max_distance   integer  optional  

The value used for the max distance around the branch for geo filtering. Required if geo-filtering is enabled. Example: 25

start   integer  optional  

The value used as the start of the paginator. Example: 0

length   integer  optional  

The value used as the total returned by the paginator. Example: 20

search[value]   string  optional  

The search value. Example: architecto

columns[name][searchable]   boolean  optional  

The column name to indicate whether it's searchable. Example: true

columns[name][data]   string  optional  

The column name indicated above. Example: name

columns[name][search][value]   string  optional  

The value used to search the above column: Example: ''

columns[minDate][searchable]   boolean  optional  

The field used to indicate the search ability of the minDate column. Example: true

columns[minDate][data]   string  optional  

The column name used with the search ability. Example: minDate

columns[minDate][search][value]   string  optional  

The value used to search the minDate. Example: ''

columns[maxDate][searchable]   boolean  optional  

The field used to indicate the search ability of the maxDate column. Example: true

columns[maxDate][data]   string  optional  

The column name used with the search ability. Example: maxDate

columns[maxDate][search][value]   string  optional  

The value used to search the maxDate. Example '' Example: architecto

Endpoints

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/network_branches/deep_search';
$response = $client->get(
    $url,
    [
        '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/network_branches/deep_search'
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1987
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001338958740234375,
    "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"
}
 

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=16" \
    --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": "16",
};
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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/schedules';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page' => '16',
        ],
    ]
);
$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': '16',
}
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1977
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0013470649719238281,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the network membership to get schedules for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Query Parameters

page   integer  optional  

The page number to return Example: 16

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1981
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012600421905517578,
    "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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04';
$response = $client->get(
    $url,
    [
        '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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership   string   

The UUID of the Network Membership to get. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04';
$response = $client->put(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1980
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.004287004470825195,
    "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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership   string   

The UUID of the Network Membership to update. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/apply';
$response = $client->post(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1979
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001461029052734375,
    "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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

URL Parameters

network_uuid   string   

The UUID of the network to apply for membership. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Body Parameters

branches   string[]   

The UUIDS of the Branches to apply for network membership.

Get statuses for Network Membership

requires authentication

This endpoint returns the membership statuses of branches for a given network.

Example request:
curl --request POST \
    "https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/statuses" \
    --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/statuses"
);

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/statuses';
$response = $client->post(
    $url,
    [
        '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/statuses'
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1978
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012199878692626953,
    "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}/statuses

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

URL Parameters

network_uuid   string   

The UUID of the network. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Body Parameters

branches   string[]   

The UUIDS of the Branches to get membership status for.

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();
$url = 'https://api-qa.foodiverse.net/api/user/network_organisation';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1986
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.002123117446899414,
    "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

Headers

Authorization      

Example: Bearer {token}

Query Parameters

organisation_type   string  optional  

String The type of organisation to return. Example: DONOR

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/6ff8f7f6-1eb3-3525-be4a-3932c805afed/products" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --data "{
    \"products\": \"architecto\"
}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/donation/responses/6ff8f7f6-1eb3-3525-be4a-3932c805afed/products"
);

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

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

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

url = 'https://api-qa.foodiverse.net/api/donation/responses/6ff8f7f6-1eb3-3525-be4a-3932c805afed/products'
payload = {
    "products": "architecto"
}
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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

URL Parameters

response_uuid   string   

Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

Body Parameters

products   Products   

Array Example: architecto

*   object  optional  
category_id   Uuid   

Example: architecto

normalised_products_id   Uuid   

Required without category_id Example: architecto

code   String   

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

name     optional  

String Example: architecto

brand   String  optional  

Example: architecto

product_type     optional  

String Example: architecto

units   String  optional  

Example: architecto

currency     optional  

String Example: architecto

quantity     optional  

Numeric Example: architecto

unit_weight   Numeric  optional  

Example: architecto

total_weight   Numeric  optional  

Example: architecto

original_unit_price   Numeric  optional  

Example: architecto

discounted_unit_price     optional  

Numeric Example: architecto

total_price     optional  

Numeric Example: architecto

expiry_type   String  optional  

l_use_by or l_best_before Example: architecto

expiry_date     optional  

Date Example: architecto

batch_code   String  optional  

Example: architecto

stock_code   String  optional  

Example: architecto

ingredients     optional  

String Example: architecto

allergens   String  optional  

Example: architecto

nutrition   String  optional  

Example: architecto

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/offers';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get offers for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/one_signal';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/user/one_signal';
$response = $client->post(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

Body Parameters

player_id   String   

The Player ID to add to the user. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/one_signal/5ce3a914-8a20-4e83-9e5a-059361de5d04';
$response = $client->delete(
    $url,
    [
        '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}

Headers

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The Player ID to delete. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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\",
    \"foodnet_organisation_uuid\": \"66529e01-d113-3473-8d6f-9e11e09332ea\"
}"
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",
    "foodnet_organisation_uuid": "66529e01-d113-3473-8d6f-9e11e09332ea"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/register';
$response = $client->post(
    $url,
    [
        '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',
            'foodnet_organisation_uuid' => '66529e01-d113-3473-8d6f-9e11e09332ea',
        ],
    ]
);
$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",
    "foodnet_organisation_uuid": "66529e01-d113-3473-8d6f-9e11e09332ea"
}
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

Headers

Content-Type      

Example: application/json

Body Parameters

first_name   String   

First name of the user. Example: Test

surname   String   

Surname of the user. Example: User

email   String   

The email of the user. Example: [email protected]

mobile_number   String   

Mobile number of the user. Example: +353861234567

mobile_number_country_code   String   

The country code of the mobile_number provided. Example: IE

phone   String   

Organization phone number Example: +353868730746

phone_country_code   String   

Organization phone number. Example: IE

name   String   

Organization Name. Example: Test FoodBank

organisation_type   Object   

Organisation Type Object. Example: {}

address_1   String   

Organisation address line 1. Example: 8 Broom hill road

address_2   String  optional  

Organisation address line 2. Example: Tallaght

postcode   String   

Organisations Eir Code. Example: D24 CD32

city_town   String   

Organisation city / town. Example: Dublin

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. Example: 53.2939631

longitude   number  optional  

Organisation longitude. Example: -6.3621539

language_code   String  optional  

Preferred language. Example: en_IE

foodnet_organisation_uuid   String  optional  

The UUID of a FoodNet Organisation to apply to for membership. Example: 66529e01-d113-3473-8d6f-9e11e09332ea

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_status';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1976
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014801025390625,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_storage_type';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1975
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001544952392578125,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/donations_by_parent_category';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1974
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0022361278533935547,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_storage_type';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1973
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.002045869827270508,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_parent_category';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1972
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001188039779663086,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/foodnet/network_memberships/5ce3a914-8a20-4e83-9e5a-059361de5d04/reports/offers_by_status';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1971
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.00125885009765625,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

network_membership_uuid   string   

The UUID of the Network Membership to get the report for. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

Schedules

Get branches within the user's network

requires authentication

Get branches within the user's network

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/network_branches';
$response = $client->get(
    $url,
    [
        '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/network_branches'
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1988
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012989044189453125,
    "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_branches

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/quick-donation/schedules';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1985
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012159347534179688,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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/architecto/schedules" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://api-qa.foodiverse.net/api/user/branches/architecto/schedules"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/branches/architecto/schedules';
$response = $client->get(
    $url,
    [
        '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/architecto/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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1984
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0012998580932617188,
    "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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The branch. Example: architecto

uuid   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

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();
$url = 'https://api-qa.foodiverse.net/api/user/branches/5ce3a914-8a20-4e83-9e5a-059361de5d04/measure_units';
$response = $client->get(
    $url,
    [
        '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

Headers

Authorization      

Example: Bearer {token}

URL Parameters

branch   string   

The UUID of the branch. Example: 5ce3a914-8a20-4e83-9e5a-059361de5d04

User

Resend user invite

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();
$url = 'https://api-qa.foodiverse.net/api/user/invite/resend';
$response = $client->post(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1999
 

{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_required"
        }
    ],
    "frontendRedirect": false,
    "callTime": 0.0055081844329833984,
    "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

Headers

Authorization      

Example: Bearer {token}

Activate account This endpoint activates the account

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();
$url = 'https://api-qa.foodiverse.net/api/user/activate';
$response = $client->put(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1998
 

{
    "status": "error",
    "data": [
        "Undefined array key \"activation_key\""
    ],
    "frontendRedirect": false,
    "callTime": 0.0018768310546875,
    "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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/user/password/reset';
$response = $client->post(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1997
 

{
    "status": "error",
    "data": [
        {
            "field": "email",
            "message": "e_email_required"
        }
    ],
    "frontendRedirect": false,
    "callTime": 0.002395153045654297,
    "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

Headers

Authorization      

Example: Bearer {token}

Reset 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();
$url = 'https://api-qa.foodiverse.net/api/user/password/reset';
$response = $client->put(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1996
 

{
    "status": "error",
    "data": [
        "Undefined array key \"expires\""
    ],
    "frontendRedirect": false,
    "callTime": 0.0028541088104248047,
    "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

Headers

Authorization      

Example: Bearer {token}

Get active user's organisation 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();
$url = 'https://api-qa.foodiverse.net/api/user/organisation';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1995
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001538991928100586,
    "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

Headers

Authorization      

Example: Bearer {token}

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();
$url = 'https://api-qa.foodiverse.net/api/user';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1994
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0016510486602783203,
    "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

Headers

Authorization      

Example: Bearer {token}

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\": \"|]|{+-\",
    \"password_confirmation\": \"architecto\",
    \"password_current\": \"architecto\"
}"
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": "|]|{+-",
    "password_confirmation": "architecto",
    "password_current": "architecto"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user';
$response = $client->put(
    $url,
    [
        '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' => '|]|{+-',
            'password_confirmation' => 'architecto',
            'password_current' => 'architecto',
        ],
    ]
);
$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": "|]|{+-",
    "password_confirmation": "architecto",
    "password_current": "architecto"
}
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1993
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0018658638000488281,
    "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

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

Body Parameters

first_name   String   

First name of the user. Example: Test

surname   String   

Surname of the user. Example: User

email   String  optional  

The email of the user. Example: [email protected]

mobile_number   String   

Mobile number of the user. Example: +353861234567

language_code   String   

The language code of the user. Example: en_IE

is_organisation_admin   Boolean  optional  

(Can only be set by an organisation admin) Example: 0

password   String  optional  

New password Example: |]|{+-

password_confirmation   String  optional  

New password confirmation (Required if 'password' is set) Example: architecto

password_current   String  optional  

Old password (Required if 'password' is set) Example: architecto

Get 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();
$url = 'https://api-qa.foodiverse.net/api/user/file/my-files';
$response = $client->get(
    $url,
    [
        '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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1992
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0011379718780517578,
    "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

Headers

Authorization      

Example: Bearer {token}

Get active user Locale

requires authentication

This endpoint returns the locale for the authenticated user.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/locale';
$response = $client->get(
    $url,
    [
        '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/locale'
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1991
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.001505136489868164,
    "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/locale

Headers

Authorization      

Example: Bearer {token}

Update active user Locale

requires authentication

This endpoint updates the locale for the authenticated user.

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

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

let body = {
    "language_code": "en_IE"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/locale';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            '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/locale'
payload = {
    "language_code": "en_IE"
}
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1990
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0014710426330566406,
    "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/locale

Headers

Authorization      

Example: Bearer {token}

Content-Type      

Example: application/json

Body Parameters

language_code   String   

The language code of the user. Example: en_IE

Get env feature flags

requires authentication

This endpoint returns the feature flags set in the environment for the authenticated user.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api-qa.foodiverse.net/api/user/feature_flags';
$response = $client->get(
    $url,
    [
        '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/feature_flags'
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
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1989
 

{
    "status": "error",
    "data": [
        "e_unauthorized"
    ],
    "frontendRedirect": false,
    "callTime": 0.0013298988342285156,
    "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/feature_flags

Headers

Authorization      

Example: Bearer {token}