REST-APIサンプル3

 処理概要

AUTH-IDに関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
AUTH-ID v1 /api/v1/auth
/api/v1/auth/{ID}
v2 /api/v2/auth
/api/v2/auth/{ID}

凡例:〇対応、-未対応

 

実行例

AUTH-IDの発行

メソッド URI
POST /api/{VERSION}/auth
JSON
リクエスト

POST /api/v1/auth
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
“auth-id”: “1234567890abcdef”,
“expired”: 3600
}

 

XML
リクエスト

POST /api/v1/auth
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<auth>
<auth-id>
1234567890abcdef
</auth-id>
<expired>
3600
</expired>
</auth>

 

TEXT/PLAIN
リクエスト

POST /api/v1/auth
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

auth-id : 1234567890abcdef
expired : 3600

 

タイムアウト時間の更新

メソッド URI
PUT /api/{VERSION}/auth/{ID}
JSON
リクエスト

PUT /api/v1/auth/1234567890abcdef
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
“expired”: 3600
}

 

XML
リクエスト

PUT /api/v1/auth/1234567890abcdef
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<auth>
<expired>
3600
</expired>
</auth>

 

TEXT/PLAIN
リクエスト

PUT /api/v1/auth/1234567890abcdef
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

expired : 3600

 

タイムアウト時間の確認

メソッド URI
GET /api/{VERSION}/auth/{ID}
JSON
リクエスト

GET /api/v1/auth/1234567890abcdef
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
“expired”: 3450
}

 

XML
リクエスト

GET /api/v1/auth/1234567890abcdef
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<auth>
<expired>
3450
</expired>
</auth>

 

TEXT/PLAIN
リクエスト

GET /api/v1/auth/1234567890abcdef
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

expired : 3450

 

AUTH-IDの削除

メソッド URI
DELETE /api/{VERSION}/auth/{ID}
リクエスト

DELETE /api/v1/auth/1234567890abcdef

 

レスポンス

204 No content

←前のページ

次のページ→