Proxy
URLフォワーディング機能に関するAPIです。proxy設定の登録後は以下のようにデバイスからプロキシ先のWebにアクセスすることができます。
- to index.html:
{API server domain}/proxy/{device_id}/{proxy_id}
- to other/path:
{API server domain}/proxy/{device_id}/{proxy_id}/other/path
- with query:
{API server domain}/proxy/{device_id}/{proxy_id}/other/path?query=text
関連機能: URLフォワーディング
全てのURLフォワーディング設定を取得します。
GET https://api.legs.iij.jp/api/proxy?token=api-token
Parameters
type |
parameter |
require |
example |
description |
query |
token |
yes |
api-token |
API Token |
Response Body 200
show example
[
{
"id": "3Y_gYX530AZ5mPfd9T_5A69ZCtZgg2dn",
"account_id": 1,
"url": "http://localhost:3000",
"created_at": "2019-02-25T16:51:17+09:00"
},
{
"id": "xbxVxw8TH2Qcd475TbqSh3DqHEFy6RAZ",
"account_id": 1,
"url": "http://user:pass@other-host.com",
"created_at": "2019-02-26T16:50:20+09:00"
}
]
URLフォワーディング設定を作成します。
POST https://api.legs.iij.jp/api/proxy?token=api-token
Parameters
type |
parameter |
require |
example |
description |
query |
token |
yes |
api-token |
API Token |
Request Body
show example
{
"url": "http://localhost:3000"
}
Response Body 201
show example
{
"id": "xbxVxw8TH2Qcd475TbqSh3DqHEFy6RAZ",
"account_id": 1,
"url": "http://localhost:3000",
"created_at": "2019-03-13T17:08:12.402519+09:00"
}
IDで指定したURLフォワーディング設定を更新します。
PUT https://api.legs.iij.jp/api/proxy/{proxy_id}?token=api-token
Parameters
type |
parameter |
require |
example |
description |
path |
proxy_id |
yes |
xbxVxw8TH2Qcd475TbqSh3DqHEFy6RAZ |
configuration ID |
query |
token |
yes |
api-token |
API Token |
Request Body
show example
{
"url": "http://localhost:5000"
}
Response Body 200
show example
{
"id": "xbxVxw8TH2Qcd475TbqSh3DqHEFy6RAZ",
"account_id": 1,
"url": "http://localhost:5000",
"created_at": "2019-03-13T17:08:12.402519+09:00"
}
IDで指定したURLフォワーディング設定を削除します。
DELETE https://api.legs.iij.jp/api/proxy/{proxy_id}?token=api-token
Parameters
type |
parameter |
require |
example |
description |
path |
proxy_id |
yes |
xbxVxw8TH2Qcd475TbqSh3DqHEFy6RAZ |
configuration ID |
query |
token |
yes |
api-token |
API Token |
Response Body 204