Skip to content

API Document

tomokon edited this page Mar 3, 2021 · 26 revisions

フォーマット

  • URL
  • Method
  • 説明
  • Request
  • Response

エンドポイント

貸出登録

  • /lending
  • POST
  • 貸す人が貸出情報の登録をする。
{
  'accessToekn': string (貸す人のアクセストークン),
  'content': string (貸すもの),
  'deadline': Datetime (期限)
}
{
  'lendingId': int (貸出id)
}

借りた人登録

  • /lending
  • PUT
  • lendingIdで指定された貸出情報に借りた人(アクセストークンから取得)を紐付ける.
{
  'accessToken': string (借りる人のアクセストークン),
  'lendingid': string (貸出id)
}
{
  'lendingId': int (貸出id),
  'content': string (借りたもの),
  'deadline': Datetime (期限),
  'ownerName': string (貸した人の名前)
}

貸したもの一覧取得

  • /lending
  • GET
  • あるユーザの貸したものの一覧を取得する
{
  'accessToekn': string (アクセストークン)
}
{
  'list': {
            ...LendInfo, 
            'borrowerName': string (借りた人の名前)
          }[]
}

借りたもの一覧取得

  • /lending
  • GET
  • あるユーザの借りたものの一覧を取得する
{
  'accessToekn': string (アクセストークン)
}
{
  'list': {
            ...LendInfo, 
            'borrowerName': string (借りた人の名前)
          }[]
}

返却報告

  • /lending/return
  • PUT
  • 貸出情報のステータスを返却済みにする
{
  'ledingId': int (貸出id)
}
{
  'lendInfo': LendInfo
}

エンドポイント(bot)

  • /bot/~~~


カスタムオブジェクト

貸出情報

LendInfo
{
  'lendingId': int (貸出id),
  'ownerId': int (貸した人のid),
  'borrowerId': int (借りた人のid),
  'content': string (貸すもの),
  'deadline': Datetime (期限)
}

Clone this wiki locally