Nishiki Web API (1.0.0)

Download OpenAPI specification:Download

Nishiki

user

user of Nishiki system

Create a new user

Create a new user

Request Body schema: application/json
required
name
string or null

username. this name is not provided, the name will be set as a default value.

emailAddress
required
string

Responses

Request samples

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

Get a user

Get a user

path Parameters
userId
required
string

ID of user

Responses

Response samples

Content type
application/json
{
  • "id": "679adc58-b03a-4fb6-993b-c72404087375",
  • "name": "John"
}

Update a user data

Update a user data

path Parameters
userId
required
string

ID of user

Request Body schema: application/json
required
name
string

user's name

Responses

Request samples

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

Delete a user.

The groups and containers will be deleted as well if those are possessed by only this user..

path Parameters
userId
required
string

ID of user

Responses

auth

Get a User ID

The user is identified by the token.

Responses

Response samples

Content type
application/json
{
  • "userId": "2dd6dd70-5b3a-4329-9b70-01fd18c4b23c"
}

container

Get a list of the user's container

The requesting user is identified by the token of request.

Responses

Response samples

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

create a new container

create a new container

Request Body schema: application/json
required
groupId
string
name
string

Responses

Request samples

Content type
application/json
{
  • "groupId": "groupId",
  • "name": "my-container"
}

Response samples

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

get a container information

get a container information

path Parameters
containerId
required
string

ID of container

Responses

Response samples

Content type
application/json
{
  • "id": "939a4c50-ee7b-4558-b8d5-371514e77bed",
  • "name": "Shared-house's Fridge",
  • "group": {
    },
  • "foods": [
    ]
}

Update a container's name

The requesting user is identified by the token of request.

path Parameters
containerId
required
string

ID of container

Request Body schema: application/json
required
containerName
string

Responses

Request samples

Content type
application/json
{
  • "containerName": "new-container"
}

Delete a container

This operation also deletes all foods in the container.

path Parameters
containerId
required
string

ID of container

Responses

add a new food

add a new food

path Parameters
containerId
required
string
Request Body schema: application/json
required
name
required
string
unit
required
string or null
category
required
string
quantity
required
integer or null <float>
expiry
required
string or null <date-time>

DateTime must follow ISO 8601 format including time zone.

Responses

Request samples

Content type
application/json
{
  • "name": "bouillon",
  • "unit": "l",
  • "category": "Vegetables",
  • "quantity": 1,
  • "expiry": "1970-01-01T00:00:00.000Z"
}

Response samples

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

update a food

update a food

path Parameters
containerId
required
string

ID of container

foodId
required
string

ID of food

Request Body schema: application/json
required
name
required
string
unit
required
string or null
category
required
string
quantity
required
integer or null <float>
expiry
required
string or null <date-time>

DateTime must follow ISO 8601 format including time zone.

Responses

Request samples

Content type
application/json
{
  • "name": "bouillon",
  • "unit": "l",
  • "category": "Vegetables",
  • "quantity": 1,
  • "expiry": "1970-01-01T00:00:00.000Z"
}

delete a food

delete a food

path Parameters
containerId
required
string

ID of container

foodId
required
string

ID of food

Responses

group

Get a list of groups linked to a user

The requesting user is detected by the token.

Responses

Response samples

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

create a new group

create a new group

Request Body schema: application/json
groupName
string or null

Responses

Request samples

Content type
application/json
{
  • "groupName": "Shared-house"
}

Response samples

Content type
application/json
{
  • "groupId": "d4825cf5-0b1b-dce3-1aa1-ed9adfd6b0bd"
}

Join to a group

Join to a group using the invitation link hash.

query Parameters
Action
required
string

a place holder, must be 'joinToGroup'

Request Body schema: application/json
required
invitationLinkHash
string

Responses

Request samples

Content type
application/json
{
  • "invitationLinkHash": "3b6619cffb5f96e1acfa578badae372f"
}

Response samples

Content type
application/json
{
  • "groupId": "d4825cf5-0b1b-dce3-1aa1-ed9adfd6b0bd"
}

Get a group

Get a group

path Parameters
groupId
required
string

ID of group

Responses

Response samples

Content type
application/json
{
  • "groupId": "82597aad-0d1b-4672-8b9a-fd3764cb9928",
  • "groupName": "Shared-house"
}

Update a group's name

The requesting user is identified by the token of request.

path Parameters
groupId
required
string

ID of group

Request Body schema: application/json
required
groupName
string

Responses

Request samples

Content type
application/json
{
  • "groupName": "new-group"
}

Delete a group

This operation also deletes all containers and foods in the group.

path Parameters
groupId
required
string

ID of group

Responses

Generate an invitation link

Generate an invitation link, return hash of invitation link

query Parameters
Action
required
string

a place holder, must be 'generateInvitationLink'

Responses

Response samples

Content type
application/json
{
  • "invitationLinkHash": "3b6619cffb5f96e1acfa578badae372f"
}

get a list of the group's container

get a list of the group's container

path Parameters
groupId
required
string

ID of group

Responses

Response samples

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

Get a list of users in the group

Get a list of users in the group

path Parameters
groupId
required
string

Responses

Response samples

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

Delete a user from their specific group

Delete a user from their specific group

path Parameters
groupId
required
string

ID of group

userId
required
string

ID of user

Responses