カテゴリー取得
GET
/categories/{category_id}
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/waiter/categories/example?with_children=none';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/example?with_children=none' \ --header 'Authorization: Bearer <token>'カテゴリー情報を取得します
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”category_id
required
string
カテゴリーID
Query Parameters
Section titled “Query Parameters”with_children
string
子カテゴリー情報を含むかを指定します。
all: 全て含むnone: 含めない(キーchildrenを含めない)
Example
noneResponses
Section titled “Responses”OK
Media typeapplication/json
CategoryParent
object
id
required
カテゴリーID
string
name
カテゴリー名
string
abbr
略称
string
sortNo
ソート番号
integer
parentId
親カテゴリーID
string
createdIn
作成元サービス
string
children
子カテゴリーリスト
Array<object>
CategoryChildカテゴリー情報
object
id
required
カテゴリーID
string
name
カテゴリー名
string
abbr
略称
string
sortNo
ソート番号
integer
parentId
親カテゴリーID
string
createdIn
作成元サービス
string
Examples
{ "id": "2", "name": "デザート", "abbr": "デザート", "sortNo": 1, "parentId": null, "createdIn": "waiter", "children": [ { "id": "12", "name": "季節の彩ケーキ特集", "abbr": "季節ケーキ", "sortNo": 2, "parentId": "2", "createdIn": "waiter" } ]}{ "id": "2", "name": "デザート", "abbr": "デザート", "sortNo": 1, "parentId": null, "createdIn": "waiter"}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"}指定したデータが存在しない場合
Media typeapplication/json
object
title
required
string
type
required
string
status
integer
detail
string
Examplegenerated
{ "title": "example", "type": "example", "status": 1, "detail": "example"}