Skip to main content

API Documentation

Backend Server API

Download OpenAPI specification:Download

User

User Authentication and Management

Sign In

Request Body schema: application/json
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string"
}

Sign Up

Request Body schema: application/json
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "dailyStepGoal": { }
}

Validate User Token

Request Body schema: application/json
token
string

Responses

Request samples

Content type
application/json
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "isValid": true
}

Get User Info

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "userInfo": {
    }
}

Update User

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

username
string

User Name

password
string

Password

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Delete User

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Update Step Count

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

userId
number

User ID

steps
number

Step Count

Responses

Request samples

Content type
application/json
{
  • "userId": 0,
  • "steps": 0
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Check Step Count

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "dailyStepCount": 0,
  • "weeklyStepCount": 0
}

Update User's Step Goal

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

dailyStepGoal
number

Daily Step Goal

Responses

Request samples

Content type
application/json
{
  • "dailyStepGoal": 0
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Check User's Step Goal

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

userId
number

User ID

steps
number

User's Steps

Responses

Request samples

Content type
application/json
{
  • "userId": 0,
  • "steps": 0
}

Response samples

Content type
application/json
true

Reset Daily Step Counter for All Users

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Reset Weekly Step Counter for All Users

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Set User's Birthday

Authorizations:
None
Request Body schema: application/json
username
string
birthday
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "birthday": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "userInfo": {
    }
}

Pet

Pet Interaction and Management

Get Pet Name

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "name": "string"
}

Update Pet Name

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

name
string

Updated Pet Name

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Create a New Pet

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "petInfo": {
    }
}

Get Pet's Status

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "health": 0,
  • "mood": 0,
  • "extra": {
    },
  • "activities": [ ]
}

Update Pet Status

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

health
number
mood
number

Responses

Request samples

Content type
application/json
{
  • "health": 0,
  • "mood": 0
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "health": 0,
  • "mood": 0
}

Reset the Pet's Status

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

reset_type
number

ENUM - 0: ALL, 1: HEALTH, 2: MOOD

Responses

Request samples

Content type
application/json
{
  • "reset_type": 0
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Increase the Pet's Mood

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

type
string

Activity Type

Responses

Request samples

Content type
application/json
{
  • "type": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "mood": 0,
  • "activities": [ ]
}

Reset the Pet's Activities

Run as a Cron Job.

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "matchedCount": 0,
  • "modifiedCount": 0
}

Get Pet Choice

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "choice": "string"
}

Update Pet Choice

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

choice
string

Choice

Responses

Request samples

Content type
application/json
{
  • "choice": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Feed Pet

Authorizations:
None
Request Body schema: application/json

User ID is provided in the request headers.

food
string

Food

Responses

Request samples

Content type
application/json
{
  • "food": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Delete Pet

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Check Account Activity -- Pet

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Food

Food Recognition and Analytics

Recognize Food

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "topMatches": [ ]
}

Get Food's Health Rating

Authorizations:
None
Request Body schema: application/json
food
string

Food Name

Responses

Request samples

Content type
application/json
{
  • "food": "string"
}

Response samples

Content type
application/json
{
  • "food": "string",
  • "healthRating": 0
}

Get Food's Nutrition Info

Authorizations:
None
Request Body schema: application/json
food
string

Food Name

Responses

Request samples

Content type
application/json
{
  • "food": "string"
}

Response samples

Content type
application/json
{
  • "food": "string",
  • "nutritionInfo": "string"
}

List All Possible Food Options

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "foodOptions": [ ]
}

Get Food's Category

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "food": "string",
  • "categoryInfo": "string"
}

Leaderboard

Configuring the User Leaderboard

List User Leaderboard

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "leaderboardList": [ ],
  • "top5Users": [ ]
}