カテゴリー一覧取得
GET
/categories
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/waiter/categories?level=none&limit=20&sort=sort_no&page=1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.smaregi.dev/TARGET-CONTRACT-ID/waiter/categories?level=none&limit=20&sort=sort_no&page=1' \ --header 'Authorization: Bearer <token>'カテゴリー一覧を取得します
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”level
string
階層レベル
none: 指定なし1: 子カテゴリ以外2: 子カテゴリ
Example
nonelimit
integer
取得件数
Example
20sort
string
ソート順
sort_no: ソート番号id: カテゴリーID
Example
sort_nopage
integer
ページ番号
Example
1Responses
Section titled “Responses”OK
Media typeapplication/json
Array<object>
Categoryカテゴリー情報
object
id
required
カテゴリーID
string
name
カテゴリー名
string
abbr
略称
string
sortNo
ソート番号
integer
parentId
親カテゴリーID
string
createdIn
作成元サービス
string
Examples
Exampleレスポンス例
[ { "id": "2", "name": "デザート", "abbr": "デザート", "sortNo": 1, "parentId": null, "createdIn": "waiter" }, { "id": "3", "name": "ドリンク", "abbr": "ドリンク", "sortNo": 2, "parentId": null, "createdIn": "waiter" }, { "id": "4", "name": "コールドドリンク", "abbr": "冷", "sortNo": 3, "parentId": "3", "createdIn": "waiter" }, { "id": "5", "name": "ホットドリンク", "abbr": "温", "sortNo": 4, "parentId": "3", "createdIn": "waiter" }, { "id": "12", "name": "季節の彩ケーキ特集", "abbr": "季節ケーキ", "sortNo": 5, "parentId": "2", "createdIn": "waiter" }]Headers
Section titled “Headers”Link
string
<前のURI>; rel="prev", <次のURI>; rel="next"
Bad Request
- リクエストパラメーターが不正
- 不正な値が指定された場合
Media typeapplication/json
object
title
required
string
type
required
string
status
integer
detail
string
Examplegenerated
{ "title": "example", "type": "example", "status": 1, "detail": "example"}