Public
Documentation Settings

MealBase Lite

This postman collection documents the APIs available to Front-End developers of the website https://www.mealbase.app.

Users

GET/users

https://www.mealbase.app/api/v1/users

Use this route to retreive a list of users.
Users with a roles of 'admin|support' can retreive a list of users.
Everyone else can only retreive their own account information. It's an event app, not a user account app.


Query Params

NameDescription
_idA user account ID
emailAn email address.
limitNumber of results to return, 1 - 100, default 20.
skipNumber of results to skip. Default is 0.
sortByField to sort by. email|createAt
sortOrderOrder in which to return results. 1 or -1
deletedReturn accounts that have been soft deleted; true or false
roleReturn accounts with this role; admin|support|user
searchSearch email addresses for partial match.


Examples

js
/api/vi/users?search=johndoe
/api/vi/users?limit=50&skip=100&sortBy=email&sortOrder=-1
PARAMS
_id

123456789

The _id of the account you wish to retreive.

email

XAshA-12@email.com

The email address of the account to retreive.

limit

20

Number of results to return. Min is 0; max is 100; default is 20.

skip

7

Number of records to skip. Not less than 0; default is 0.

sortBy

email

Field to sort result by.

sortOrder

-1

Alphabetical is 1; reverse is -1; default is 1.

deleted

true

Return deleted accounts; true|false

role

admin

Filter by user's roles; admin|user

search

user

Search email address

Example Request
curl
curl --location 'https://www.mealbase.app/api/v1/users'
200 OK
Example Response
json
{
  "message": "",
  "success": true,
  "data": [
    {
      "_id": "5eb22909a121dc241edab7ea",
      "roles": [
        "user"
      ],
      "createdAt": "2020-05-06T03:03:37.000Z",
      "updatedAt": "2020-05-08T03:47:12.000Z",
      "email": "001@email.com",
      "__v": 0
    }
  ]
}
X-Powered-By

Express

Content-Type

application/json; charset=utf-8

Content-Length

200

ETag

W/"c8-sVqcrvOl0CLifVkCiha96anKxoM"

Date

Fri, 08 May 2020 03:47:35 GMT

Connection

keep-alive

POST/users

https://www.mealbase.app/api/v1/users

Create a new user account; A.K.A Register new user.
Email address must be unique.

HEADERS
Content-Type

application/json

Bodyraw
{
	"email":"user001@email.com",
	"password":"P@ssw0rd!", 
    "recaptcha": "slkjsdflkjsdlkjsdf"
}
Example Request
curl
curl --location 'https://www.mealbase.app/api/v1/users' \
--header 'Content-Type: application/json' \
--data-raw '{
	"email":"user009@email.com",
	"password":"P@ssw0rd!"
}'
200 OK
Example Response
json
{
  "message": "",
  "success": true,
  "data": {
    "roles": [
      "user"
    ],
    "_id": "5eb4d66d4c106f485ae86768",
    "createdAt": "2020-05-08T03:47:57.000Z",
    "updatedAt": "2020-05-08T03:47:57.000Z",
    "email": "user009@email.com"
  }
}
X-Powered-By

Express

Set-Cookie

RightNowJWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXIwMDlAZW1haWwuY29tIiwiX2lkIjoiNWViNGQ2NmQ0YzEwNmY0ODVhZTg2NzY4Iiwicm9sZXMiOlsidXNlciJdLCJpYXQiOjE1ODg5MDk2NzcsImV4cCI6MTU4ODk5NjA3NywiaXNzIjoicmlnaHRub3cifQ.K6_4-nCQnZDkvtS-zWJ6RBshkDvEK6wEE9kGKSTZfCo; Path=/; Expires=Fri, 15 May 2020 03:47:57 GMT; HttpOnly

Content-Type

application/json; charset=utf-8

Content-Length

194

ETag

W/"c2-tSJ7zMPff7r/5VIECSHMovtl+a8"

Date

Fri, 08 May 2020 03:47:57 GMT

Connection

keep-alive

PUT/users

https://www.mealbase.app/api/v1/users

Edit an existing user's account.
Admin can edit any account.
Support can edit email or reset password.
Users can only edit their own accounts.

HEADERS
Content-Type

application/json

Bodyraw
{
	"_id":"5f037fdca23762253380345b",
	"newPassword": "password",
	"password":"P@ssw0rd!"
}
Example Request
curl
curl --location --request PUT 'https://www.mealbase.app/api/v1/users' \
--header 'Content-Type: application/json' \
--data-raw '{
	"email":"001@email.com"
}'
200 OK
Example Response
json
{
  "message": "",
  "success": true,
  "data": {
    "roles": [
      "user"
    ],
    "_id": "5eb22909a121dc241edab7ea",
    "createdAt": "2020-05-06T03:03:37.000Z",
    "updatedAt": "2020-05-08T03:47:12.000Z",
    "email": "001@email.com"
  }
}
X-Powered-By

Express

Content-Type

application/json; charset=utf-8

Content-Length

190

ETag

W/"be-1TwIh3mFHU0b1KH37n+6sWMPfUA"

Date

Fri, 08 May 2020 03:47:12 GMT

Connection

keep-alive