@pocket Web API リファレンス (1.0)
Download OpenAPI specification:Download
仕様
| プロトコル | HTTPS |
|---|---|
| フォーマット | JSON |
| 文字コード | UTF-8 |
| エスケープ文字 | 「\」 (バックスラッシュ) |
URL
ご契約サイトURL + 各APIでリクエストに必要なURL
Web APIの利用について
Web APIを利用して情報にアクセスするためには、認証キーが必要になります。
- 認証キーは下記のメニューで作成できます。
- アプリAPI:アプリ設定 > 設定 > 認証設定(サービス連携)
- ユーザ/通知API:管理者設定 > 認証設定(サービス連携)
- リクエストヘッダにX-At-Pocket-API-Keyを追加し、作成した認証キーをセットします。
リクエストヘッダ
| ヘッダ名 | 必須 | 内容 |
|---|---|---|
| X-At-Pocket-API-Key | ○ | 認証設定で作成したキーを指定します |
| X-HTTP-Method-Override | X-HTTP-Method-OverrideにHTTPメソッドを指定してリクエストを行った場合、指定したHTTPメソッドに対応するAPIが実行されます。
|
レスポンス
HTTPステータスが200系の場合、正常終了になります。それ以外はエラーとなります。
エラーの場合はレスポンスボディに以下の内容を含むerrorsが含まれます。
| パラメータ名 | 値の型 | 説明 |
|---|---|---|
| code | 数字 | エラーコードが記載されます。 |
| message | 文字列 | エラーメッセージの概要が記載されます。 |
| details | 配列 | 詳細なエラーメッセージがある場合、エラーメッセージが記載されます。 |
{
"errors": {
"code": 400,
"message": "Bad Request",
"details": [
{
"message": "アプリIDは半角数字で入力してください。"
}
]
}
}
エラーメッセージ
リクエストでエラーが発生した場合、2つのエラー情報を返却します。
- HTTPステータスコード
- 応答本文内のJSONメッセージ
エラーメッセージはアプリ管理メニュー内の「サービス連携 > 監査ログ」からも確認できます。
エラー内容と対応方法
| コード | メッセージ | エラー内容と対応方法 |
|---|---|---|
| 400 | Bad Request | 必須フィールドまたは必須パラメータが提供されていない。提供された値が無効の場合、または提供されたフィールドの組み合わせが無効であることを意味します。 エラーの詳細内容がerrorsフィールドに記載されて返却されるので、内容を確認して適切な対応を行ってください。 |
| 401 | Unauthorized | 認証が無効なことを意味します。 使用している認証用文字列が無効なため、正しい値を指定してください。 |
| 402 | Request exhausted per month | 月当たりのAPIの利用制限数に達したことを意味します。 制限が解除されるまで対象のAPIはご利用頂けません。 |
| 402 | Request exhausted per 100 second | 100秒当たりのAPIの利用制限数に達したことを意味します。 制限が解除されるまで対象のAPIはご利用頂けません。 |
| 403 | Access Denied | リクエストしたAPIの利用権限が無いことを意味します。 利用権限が付与されているか確認を行ってください。 |
| 404 | Not Found | 指定されたリソースが見つからなかったことを意味します。 |
| 405 | Method Not Allowed | 不正なHTTPメソッドでリクエストされた事を意味します。 有効なHTTPメソッドはGET、POST、PUT、DELETEのみです。 |
| 500 | Internal Server Error | リクエストの処理中に予期しないエラーが発生しました。 サーバ側の障害の可能性がある為、時間をおいて再度実行してください。 |
制限事項
@pocket Web APIの利用には以下の制限があります。制限は今後変更される可能性があります。
- リクエスト件数はAPI単位でカウントを行い、月単位でリセットされます。
※ 利用制限数は 月30,000件 までとなります。ただし、通知APIに限り 月100,000件 まで利用可能です。 - リクエストのカウントはサイト単位で行います。複数ユーザでリクエストを行った場合、各リクエストが1回としてカウントされます。
- 100秒当たりの利用制限数は100回までとなります。
- 一度に取得できる最大件数は1,000件までです。
- 一度に登録できる最大件数は1,000件までです。
- 存在しないフィールドをリクエストに含めた場合、その値は無視されます。
ファイルデータの扱い
ファイルデータの登録・更新は下記のような形式で行います。
| パラメータ名 | 値の型 | 必須 | 説明 |
|---|---|---|---|
| name | 文字列 | ○ | ファイル名 |
| type | 文字列 | ○ | ファイルタイプ |
| content | 文字列 | ○ | base64エンコードしたファイルデータ |
{
"field-1": [
{
"name": "Sample.png",
"type": "image/png",
"content": "..."
},
{
"name": "Sample2.png",
...
}
]
}
フォーム一覧取得
登録されているフォームを取得します
query Parameters
| name | string (アプリ名) |
| page | integer (ページ番号) |
| limit | integer (1ページの最大件数) |
Responses
Response samples
- 200
Content type
application/json
{- "forms": [
- {
- "id": 0,
- "name": "string",
- "prefix": "string",
- "digits": 0,
- "startDay": "2019-08-24",
- "endDay": "2019-08-24",
- "readablePeriod": 0,
- "explanation": "string",
- "note": "string",
- "size": 0,
- "count": 0,
- "creatorCode": "string",
- "createdAt": "2019-08-24",
- "updaterCode": "string",
- "updatedAt": "2019-08-24"
}
]
}Response samples
- 200
Content type
application/json
{- "id": 0,
- "name": "string",
- "prefix": "string",
- "digits": 0,
- "startDay": "2019-08-24",
- "endDay": "2019-08-24",
- "readablePeriod": 0,
- "explanation": "string",
- "note": "string",
- "size": 0,
- "count": 0,
- "creatorCode": "string",
- "createdAt": "2019-08-24",
- "updaterCode": "string",
- "updatedAt": "2019-08-24"
}フィールド一覧取得
登録されているフィールドを取得します
path Parameters
| appsId required | integer (フォームID) |
query Parameters
| name | string (フィールド名) |
| page | integer (ページ番号) |
| limit | integer (1ページの最大件数) |
Responses
Response samples
- 200
Content type
application/json
{- "fields": [
- {
- "appsId": 0,
- "fieldId": 0,
- "parentFieldId": -1,
- "fieldType": "string",
- "caption": "string",
- "explanation": "string",
- "uniqueId": "string",
- "note": "string",
- "required": true,
- "requiredId": 0,
- "requiredCompare": 0,
- "requiredValue": "string",
- "min_length": 0,
- "max_length": 0,
- "max": 0,
- "min": 0,
- "digit": 0,
- "calc": "string",
- "calcFieldId": 0,
- "prefix": "string",
- "suffix": "string",
- "autolink": "string",
- "autoFormat": "string",
- "selectItems": [
- {
- "id": 0,
- "selectName": "string",
- "code1": "string",
- "code2": "string",
- "code3": "string",
- "code4": "string",
- "code5": "string",
- "calc": "string",
- "regulationValue": true
}
], - "multiple": true,
- "default": "string",
- "relationId": 0,
- "relationFieldId": 0,
- "relationType": "string",
- "subTable": [
- {
- "fieldId": 0,
- "fieldType": "string",
- "caption": "string",
- "uniqueId": "string",
- "required": true,
- "requiredId": 0,
- "requiredCompare": 0,
- "requiredValue": "string",
- "min_length": 0,
- "max_length": 0,
- "max": 0,
- "min": 0,
- "digit": 0,
- "calc": "string",
- "calcFieldId": 0,
- "prefix": "string",
- "suffix": "string",
- "selectItems": [
- {
- "id": 0,
- "selectName": "string",
- "code1": "string",
- "code2": "string",
- "code3": "string",
- "code4": "string",
- "code5": "string",
- "calc": "string",
- "regulationValue": true
}
], - "multiple": true,
- "default": "string",
- "relationId": 0,
- "relationFieldId": 0,
- "relationType": "string",
- "usage": 0,
- "requiredFieldType": "string"
}
], - "primaryKey": true,
- "usage": 0,
- "requiredFieldType": "string"
}
]
}フィールド詳細取得
フィールドIDからフィールドを取得します
path Parameters
| appsId required | integer (フォームID) |
| fieldId required | integer (フィールドID) |
Responses
Response samples
- 200
Content type
application/json
{- "appsId": 0,
- "fieldId": 0,
- "parentFieldId": -1,
- "fieldType": "string",
- "caption": "string",
- "explanation": "string",
- "uniqueId": "string",
- "note": "string",
- "required": true,
- "requiredId": 0,
- "requiredCompare": 0,
- "requiredValue": "string",
- "min_length": 0,
- "max_length": 0,
- "max": 0,
- "min": 0,
- "digit": 0,
- "calc": "string",
- "calcFieldId": 0,
- "prefix": "string",
- "suffix": "string",
- "autolink": "string",
- "autoFormat": "string",
- "selectItems": [
- {
- "id": 0,
- "selectName": "string",
- "code1": "string",
- "code2": "string",
- "code3": "string",
- "code4": "string",
- "code5": "string",
- "calc": "string",
- "regulationValue": true
}
], - "multiple": true,
- "default": "string",
- "relationId": 0,
- "relationFieldId": 0,
- "relationType": "string",
- "subTable": [
- {
- "fieldId": 0,
- "fieldType": "string",
- "caption": "string",
- "uniqueId": "string",
- "required": true,
- "requiredId": 0,
- "requiredCompare": 0,
- "requiredValue": "string",
- "min_length": 0,
- "max_length": 0,
- "max": 0,
- "min": 0,
- "digit": 0,
- "calc": "string",
- "calcFieldId": 0,
- "prefix": "string",
- "suffix": "string",
- "selectItems": [
- {
- "id": 0,
- "selectName": "string",
- "code1": "string",
- "code2": "string",
- "code3": "string",
- "code4": "string",
- "code5": "string",
- "calc": "string",
- "regulationValue": true
}
], - "multiple": true,
- "default": "string",
- "relationId": 0,
- "relationFieldId": 0,
- "relationType": "string",
- "usage": 0,
- "requiredFieldType": "string"
}
], - "primaryKey": true,
- "usage": 0,
- "requiredFieldType": "string"
}レコード一覧取得
登録されているレコードを取得します。
path Parameters
| appsId required | integer (アプリID) アプリID |
query Parameters
| fields | string (フィールドコード) フィールドコード(フィールド識別名をカンマ区切りで指定) |
| order | string (ソートフィールド) ソートフィールド |
| page | integer (ページ番号) >= 1 ページ番号 |
| limit | integer (1ページの最大件数) 1ページの最大件数 |
Responses
Response samples
- 200
Content type
application/json
{- "records": [
- {
- "appsId": 1,
- "recordId": 1,
- "uniqueId": "string",
- "creatorCode": "string",
- "creator": "string",
- "createdAt": "string",
- "updaterCode": "string",
- "updater": "string",
- "updatedAt": "string",
- "accessUrl": "string",
- "accessEditUrl": "string",
- "isDeleted": -1,
- "record": { }
}
]
}レコード情報取得
レコードIDからレコード情報を取得します。
path Parameters
| appsId required | integer (アプリID) アプリID |
| recordId required | integer (レコードID) レコードID |
Responses
Response samples
- 200
Content type
application/json
{- "appsId": 1,
- "recordId": 1,
- "uniqueId": "string",
- "creatorCode": "string",
- "creator": "string",
- "createdAt": "string",
- "updaterCode": "string",
- "updater": "string",
- "updatedAt": "string",
- "accessUrl": "string",
- "accessEditUrl": "string",
- "isDeleted": -1,
- "record": { }
}レコード更新
レコードを更新します。
path Parameters
| appsId required | integer (アプリID) アプリID |
| recordId required | integer (レコードID) レコードID |
Request Body schema: application/json
| appsId | integer (フォームID) >= 1 |
| recordId | integer (レコードID) >= 1 |
| uniqueId | string (識別ID) |
| creatorCode | string (登録者管理コード) |
| creator | string (登録者名) |
| createdAt | string (登録日時) |
| updaterCode | string (更新者管理コード) |
| updater | string (更新者名) |
| updatedAt | string (更新日時) |
| accessUrl | string (アクセスURL) |
| accessEditUrl | string (アクセス(編集)URL) |
| isDeleted | integer (削除タイプ) [ -1 .. 1 ] |
| record required | object (レコードデータ) |
Responses
Request samples
- Payload
Content type
application/json
{- "appsId": 1,
- "recordId": 1,
- "uniqueId": "string",
- "creatorCode": "string",
- "creator": "string",
- "createdAt": "string",
- "updaterCode": "string",
- "updater": "string",
- "updatedAt": "string",
- "accessUrl": "string",
- "accessEditUrl": "string",
- "isDeleted": -1,
- "record": { }
}レコードインポート
アプリレコードを一括登録します。
path Parameters
| appsId required | integer (アプリID) |
Request Body schema: application/json
Array of objects (レコードデータ) <= 100 items | |||||||||||||||||||||||||||
Array (<= 100 items)
| |||||||||||||||||||||||||||
Responses
Request samples
- Payload
Content type
application/json
{- "records": [
- {
- "appsId": 1,
- "recordId": 1,
- "uniqueId": "string",
- "creatorCode": "string",
- "creator": "string",
- "createdAt": "string",
- "updaterCode": "string",
- "updater": "string",
- "updatedAt": "string",
- "accessUrl": "string",
- "accessEditUrl": "string",
- "isDeleted": -1,
- "record": { }
}
]
}組織一覧取得
登録されている組織を取得します。
query Parameters
| name | string (組織名) 組織名 |
| page | integer (ページ番号) ページ番号 |
| limit | integer (1ページの最大件数) 1ページの最大件数 |
Responses
Response samples
- 200
Content type
application/json
{- "organizations": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "parentCode": "string",
- "note": "string"
}
]
}組織登録
組織を登録します。
Request Body schema: application/json
| code required | string (組織管理コード) <= 256 characters |
| name required | string (組織名) <= 256 characters |
| kana required | string (組織名かな) <= 512 characters |
| alias | string (組織別名) <= 256 characters |
| aliasKana | string (組織別名かな) <= 256 characters |
| parentCode | string (上位組織管理コード) <= 256 characters |
| note | string (備考) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "parentCode": "string",
- "note": "string"
}組織更新
組織を更新します。
path Parameters
| code required | string (組織管理コード) |
Request Body schema: application/jsonoptional
| code required | string (組織管理コード) <= 256 characters |
| name required | string (組織名) <= 256 characters |
| kana required | string (組織名かな) <= 512 characters |
| alias | string (組織別名) <= 256 characters |
| aliasKana | string (組織別名かな) <= 256 characters |
| parentCode | string (上位組織管理コード) <= 256 characters |
| note | string (備考) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "parentCode": "string",
- "note": "string"
}組織インポート
組織をインポートします。
Request Body schema: application/json
Array of objects (組織データ) <= 100 items | |||||||||||||||
Array (<= 100 items)
| |||||||||||||||
Responses
Request samples
- Payload
Content type
application/json
{- "organizations": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "parentCode": "string",
- "note": "string"
}
]
}役職一覧取得
登録されている役職を取得します。
query Parameters
| name | string (役職名) 役職名 |
| page | integer (ページ番号) ページ番号 |
| limit | integer (1ページの最大件数) 1ページの最大件数 |
Responses
Response samples
- 200
Content type
application/json
{- "positions": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "note": "string"
}
]
}役職登録
役職を登録します。
Request Body schema: application/json
| code required | string (役職管理コード) <= 256 characters |
| name required | string (役職名) <= 128 characters |
| kana required | string (役職名かな) <= 256 characters |
| alias | string (役職別名) <= 128 characters |
| aliasKana | string (役職別名かな) <= 256 characters |
| note | string (説明) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "note": "string"
}役職更新
役職を更新します。
path Parameters
| code required | string (役職管理コード) |
Request Body schema: application/jsonrequired
| code required | string (役職管理コード) <= 256 characters |
| name required | string (役職名) <= 128 characters |
| kana required | string (役職名かな) <= 256 characters |
| alias | string (役職別名) <= 128 characters |
| aliasKana | string (役職別名かな) <= 256 characters |
| note | string (説明) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "note": "string"
}役職インポート
役職をインポートします。
Request Body schema: application/json
Array of objects (組織データ) <= 100 items | |||||||||||||
Array (<= 100 items)
| |||||||||||||
Responses
Request samples
- Payload
Content type
application/json
{- "positions": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "alias": "string",
- "aliasKana": "string",
- "note": "string"
}
]
}ユーザ一覧取得
登録されているユーザを取得します。
query Parameters
| name | string (ユーザ名) ユーザ名 |
| page | integer (ページ番号) ページ番号 |
| limit | integer (1ページの最大件数) 1ページの最大件数 |
Responses
Response samples
- 200
Content type
application/json
{- "user": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "loginId": "string",
- "expire": "9999/12/31",
- "outsideAccess": true,
- "organizationCode": "string",
- "positionCode": "string",
- "loginErrorCount": 0,
- "subBelong": [
- {
- "organizationCode": "string",
- "positionCode": "string"
}
]
}
]
}ユーザ登録
ユーザを登録します。
Request Body schema: application/json
| code required | string (ユーザ管理コード) <= 256 characters |
| name required | string (ユーザ名) <= 256 characters |
| kana required | string (ユーザ名かな) <= 512 characters |
| loginId required | string (ログインユーザID) <= 256 characters |
| loginPass required | string (ログインパスワード) <= 256 characters |
| expire | string <date> (アカウント有効期限) Default: "9999/12/31" |
| outsideAccess | boolean (外部接続許可) Default: false |
| organizationCode required | string (優先する組織の管理コード) |
| positionCode | string (役職) |
Array of objects (その他所属する組織の管理コード) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "loginId": "string",
- "loginPass": "string",
- "expire": "9999/12/31",
- "outsideAccess": false,
- "organizationCode": "string",
- "positionCode": "string",
- "subBelong": [
- {
- "organizationCode": "string",
- "positionCode": "string"
}
]
}Response samples
- 200
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "loginId": "string",
- "expire": "9999/12/31",
- "outsideAccess": true,
- "organizationCode": "string",
- "positionCode": "string",
- "loginErrorCount": 0,
- "subBelong": [
- {
- "organizationCode": "string",
- "positionCode": "string"
}
]
}ユーザ更新
ユーザを更新します。
path Parameters
| code required | string (ユーザ管理コード) |
Request Body schema: application/json
| code required | string (ユーザ管理コード) <= 256 characters |
| name required | string (ユーザ名) <= 256 characters |
| kana required | string (ユーザ名かな) <= 512 characters |
| loginId required | string (ログインユーザID) <= 256 characters |
| loginPass | string (ログインパスワード) <= 256 characters |
| expire | string <date> (アカウント有効期限) Default: "9999/12/31" |
| outsideAccess | boolean (外部接続許可) |
| organizationCode required | string (優先する組織の管理コード) |
| positionCode | string (役職の管理コード) |
| loginErrorCount | integer (ログインエラー回数) Default: 0 |
| isRetired | boolean (退職者かどうか) Default: false |
Array of objects (その他所属する組織) |
Responses
Request samples
- Payload
Content type
application/json
{- "code": "string",
- "name": "string",
- "kana": "string",
- "loginId": "string",
- "loginPass": "string",
- "expire": "9999/12/31",
- "outsideAccess": true,
- "organizationCode": "string",
- "positionCode": "string",
- "loginErrorCount": 0,
- "isRetired": false,
- "subBelong": [
- {
- "organizationCode": "string",
- "positionCode": "string"
}
]
}ユーザインポート
ユーザをインポートします。
Request Body schema: application/json
Array of objects (ユーザデータ) <= 100 items | |||||||||||||||||||||||||
Array (<= 100 items)
| |||||||||||||||||||||||||
Responses
Request samples
- Payload
Content type
application/json
{- "user": [
- {
- "code": "string",
- "name": "string",
- "kana": "string",
- "loginId": "string",
- "loginPass": "string",
- "expire": "9999/12/31",
- "outsideAccess": true,
- "organizationCode": "string",
- "positionCode": "string",
- "loginErrorCount": 0,
- "isRetired": false,
- "subBelong": [
- {
- "organizationCode": "string",
- "positionCode": "string"
}
]
}
]
}Response samples
- 200
Content type
application/json
{- "code": "string",
- "notices": [
- {
- "appsId": "string",
- "appsName": "string",
- "icon": {
- "name": "string",
- "src": "string"
}, - "noticeList": [
- {
- "id": "string",
- "label": "string",
- "count": 0,
- "url": "string"
}
]
}
]
}