クラウドサービスAPI仕様実態調査結果2018年版
REST APIを設計する方法(2018年版設計指針 Json to Json方式)
<調査結果>
・RESTアーキテクチャで推奨されている単語デリミタに「ハイフン」を使っている例はない。
・RESTアーキテクチャで非推奨のパスカルケースやスネークケース、キャメルケースを使っている例が多い。
・各社それぞれ設計思想が異なり、いわゆる「一般的REST仕様」というものは存在しない。
・API入出力方式には、多くの言語で扱いやすいJSON to JSONを採用している。
・ミッションクリティカルなAPIの場合には、有効期限付セッショントークン認証に加えて、HMACやECDSAなどの暗号技術による署名認証を実装している。
・Microsoft APIが最も機密性が緩く、Apple APIが最も堅牢である。
入出力 consumes to produces | メソッド methods | パス paths | パス例 | パラメータ parameters | 認証 authentication | |
---|---|---|---|---|---|---|
Oracle Compute Cloud Service | json to json | POST,GET,PUT,DELETE | スネーク | /paas/service/dbcs/api/v1.1/instances/identity_domain/service_name | スネーク | 認証トークンをhttpヘッダcookieに指定 https://docs.oracle.com/cd/E83857_01/iaas/compute-iaas-cloud/stcsa/Authentication.html |
Cisco APIC API | json to json/xml | POST,GET,DELETE | パスカル | /RequestCenter/nsapi/definition/categories?catalogType=serviceCatalog | キャメル | user/passwordをペイロード渡しトークン取得、トークンをhttp ヘッダcookie に指定 |
Google Cloud API | json to json
| POST,GET,PATCH,DELETE | キャメル | /v1/{parent=apps/*}/authorizedCertificates | キャメル | OAuth2.0(サービスごとのaccessTokenをhttpヘッダーに指定) |
Microsoft Computer Vision API | json/octet-stream/form-data to json | POST,GET | キャメル | /vision/v2.0/textOperations/{operationId} | キャメル | SubscriptionKeyをhttpヘッダに指定 |
Apple App Store Connect API | json to json | POST,GET,PATCH,DELETE | キャメル | /v1/userInvitations | キャメル | JsonWebToken(accountID,expireをECDSA公開鍵の秘密鍵でES256署名(トークン)をhttpヘッダに指定→Appleが公開鍵でベリファイする) |
Amazon API Gateway API | json to json | POST,GET,PUT,DELETE | 小文字 | /restapis/ | 小文字 | access keyID,HMAC共通鍵の秘密鍵でSHA256署名をhttpヘッダまたはクエリパラメータ指定 https://docs.aws.amazon.com/apigateway/api-reference/signing-requests/ |
Facebook Graph API | json to json | POST,GET,DELETE | スネーク | /{page_id}/leadgen_draft_forms | スネーク | OAuth 2.0(AccessTokenをクエリパラメータ指定) https://developers.facebook.com/docs/graph-api/using-graph-api/ |
Twitter API | json to json | POST,GET | スネーク | /1.1/direct_messages/events/new.json | スネーク | OAuth1.0a(oauth_consumer_key,oauth_nonce(base64 encoding 32 bytes of random data),oauth_token,HMAC共通鍵の秘密鍵でSHA1署名をhttpヘッダに指定) https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request |
Instagram API | json | GET | スネーク | /oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code | スネーク | OAuth 2.0(AccessToken,HMAC共通鍵の秘密鍵でのSHA256署名をhttp form-dataに指定) |
Bitflyer API | json to json | GET,POST | スネーク | /v1/me/withdraw | スネーク | APIKey,HMAC共通鍵の秘密鍵でのSHA256署名をhttpヘッダに指定 |
Zaif API | octet-stream to json | GET,POST | スネーク | /currency_pairs/{currency_pair} | 小文字 | APIKey,HMAC共通鍵の秘密鍵でSHA512署名をhttpヘッダに指定 https://techbureau-api-document.readthedocs.io/ja/latest/trade/3_how_to_implement/3_swift.html |