Current User
Return User for current token.
Parameters
includequery string
Include associations (delimited with comma). Available associations: specializations.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Notifications
Return notifications of current user.
Parameters
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/notifications`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Addresses
Return all addresses for currently logged in user.
Parameters
sortquery string
Sort ascending or descending order.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/addresses`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Address by id
Return a address of currently logged in user.
Parameters
idpath integerRequired
Update a Address by specific
id
.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/addresses/${id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Business
Return all businesses for currently logged in user.
Parameters
includequery string
Include associations (delimited with comma). Available associations: addresses, groups, menus, open_periods, order_periods, orders, partners, pictures, products, reviews.
sortquery string
Sort ascending or descending order.
filterformData, object
Form Data needed when filtering.
statestring
State in which business is currently.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/businesses`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Business by id
Return a business of currently logged in user.
Parameters
idpath integerRequired
Update a Business by specific
id
.includequery string
Include associations (delimited with comma). Available associations: addresses, groups, menus, open_periods, order_periods, orders, partners, pictures, products, reviews
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/businesses/${id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Cards
Return all cards successfully used by this user.
Parameters
includequery string
Include associations (delimited with comma). Available associations: user
sortquery string
Sort ascending or descending order.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/cards`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Devices
Return all devices of the current user.
Parameters
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/devices`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Reviews
Return all reviews for currently logged in user.
Parameters
includequery string
Include associations (delimited with comma). Available associations: user, business, pictures, products
sortquery string
Sort ascending or descending order.
filterformData, object
Form Data needed when filtering.
statestring
Current state of review.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/reviews`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Review by id
Return a review of currently logged in user.
Parameters
idpath integerRequired
Update a Review by specific
id
.includequery string
Include associations (delimited with comma). Available associations: user, business, pictures, products
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/reviews/${id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Subscriptions
Return all subscriptions of this user.
Parameters
sortquery string
Sort ascending or descending order.
filterformData, object
Form Data needed when filtering.
scopestring
Subscriptions scoped to the group of statuses.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/subscriptions`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Orders
Return all orders for currently logged in user.
Parameters
includequery string
Include associations (delimited with comma). Available associations: addresses, elements, business
sortquery string
Sort ascending or descending order.
filterformData, object
Form Data needed when filtering.
statestring
Current state of order.
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/orders`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Order by id
Return a order of currently logged in user.
Parameters
idpath integerRequired
Update a Order by specific
id
.includequery string
Include associations (delimited with comma). Available associations: addresses, elements, business
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/orders/${id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Businesses Liked
Return all businesses liked by currently logged in user.
Parameters
includequery string
Include associations (delimited with comma). Available associations: addresses, groups, menus, open_periods, order_periods, orders, partners, pictures, products, reviews
pagequery integer
Page offset to fetch.
per_pagequery integer
Number of results to return per page.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/liked_businesses`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Authenticate Pusher
Authenticate Pusher for the user.
Parameters
authentication_forformData stringRequired
For what resource you want to authenticate the user. Acceptable values: business or user.
user_channelformData stringRequired
Acceptable values: conversations or notifications.
record_idformData stringRequired
UUID.
socket_idformData stringRequired
Socket that the client needs to obtain and send
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/authenticate_pusher`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Generate Partoo Token
Generate partoo connection token for user.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/partoo/generate_token`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Update Current User
Update current user details.
Parameters
dataformData, objectRequired
Form Data needed when updating current user details.
typestringRequired
Provide Current User
type
. Current selection is only users.attributesformData, object
Attributes object.
allergiesstring
User allergic reactions.
avatarfile
Upload a profile picture.
biostring
User bio.
birthdaydate
Date should be formated as a ISO date.
citystring
Current City they live in.
country_codestring
Current country code.
coverfile
Upload a cover picture.
cvfile
Upload a user cv.
emailstring
User email address.
experiencestring
User experience.
facebook_urlstring
Facebook url.
favourite_drinkstring
User's favourite drink.
favourite_foodstring
User's favourite food.
genderstring
The gender the user associate as.
instagram_urlstring
Instagram url.
linkedin_urlstring
Linkedin url.
monthly_bars_budgetinteger
Monthly budget.
monthly_delivery_takeaway_budgetinteger
Monthly delivery and takeaway budget.
monthly_restaurants_budgetinteger
Monthly restaurants budget.
namestring
User's full name.
phonestring
User phone number.
phone_country_codestring
User phone number country code.
phone_country_prefixstring
User phone number country prefix.
post_codestring
User post code.
public_emailstring
User public facing email.
recovery_emailstring
User recovery email.
region_codestring
User region code.
short_descriptionstring
Short description relating to user.
specializations_liststring
Slugs of specializations delimeted by comma.
streetstring
User street name.
street_numberstring
User street number.
twitter_urlstring
Twitter url.
website_urlstring
Website url.
languagestring
Prefferd language.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Password Reset
Reset current user's password.
Parameters
dataformData, objectRequired
Form Data needed when reseting current user's password.
typestringRequired
Provide Current User
type
. Current selection is only users.attributesformData, object
Attributes object.
current_passwordstringRequired
User's current password
passwordstringRequired
New password
password_confirmationstringRequired
New password confirmation
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/reset_password`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Detective Application
Request to become Food Detective.
Parameters
dataformData, objectRequired
Form Data needed when requesting to become Food Detective.
typestringRequired
Provide Current User
type
. Current selection is only users.attributesformData, object
Attributes object.
citystring
Current City they live in.
country_codestring
Current country code.
cvfile
Upload a user cv.
namestring
User's full name.
phonestring
User phone number.
phone_country_codestring
User phone number country code.
phone_country_prefixstring
User phone number country prefix.
post_codestring
User post code.
region_codestring
User region code.
streetstring
User street name.
street_numberstring
User street number.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/become_a_food_detective`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
All Notifications Read
Update all user's notifications as read.
Parameters
dataformData, objectRequired
Form Data needed when updating all user's notifications as read.
typestringRequired
Provide Current User
type
. Current selection is only notifications.attributesformData, object
Attributes object.
notification_idsinteger[]
IDs of notifications that we want to mark as read.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/notifications/mark_all_as_read`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)});
const data = await res.json();
}
Delete User Account
Delete user's account.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}});
const data = await res.json();
}
Delete Account
Request to delete account. Business stays available.
{
const res = await fetch(`${BASE_URL}/api/v1/users/me/delete_account`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}});
const data = await res.json();
}