レガシープラン管理API
このページでは、レガシーのポートベースプラン向けの管理APIについて説明します。これは、トラフィックベースのゲートウェイではなく、固定のポート範囲を持つ既存顧客向けのプランです。これらのエンドポイントを使用して、送信元IPをホワイトリストに登録し、ポートごとのジオデフォルトを設定し、割り当てられたポート一覧を取得します。
すべてのエンドポイントはapi_tokenクエリパラメータで認証します。パネルのAccount → API Tokensでトークンを生成してください。
?api_token=YOUR_API_TOKEN{membership}パスパラメータはお使いのプランIDで、パネルのプランページに表示されます。
Authorized IPs
Section titled “Authorized IPs”レガシープランは送信元IPのみで認証を行います。スクレイパーが接続元とするIPをホワイトリストに登録してください。
認可済みIPの一覧取得
Section titled “認可済みIPの一覧取得” GET https://shifter.io/api/v1/backconnect/{membership}/authorized-ips
| Parameter | In | Required | Description |
|---|---|---|---|
membership | path | yes | The plan ID |
api_token | query | yes | Your account API token |
Example:
curl "https://shifter.io/api/v1/backconnect/MEMBERSHIP_ID/authorized-ips?api_token=YOUR_API_TOKEN"Response:
{ "ips": ["198.51.100.10", "203.0.113.42"]}認可済みIPの更新
Section titled “認可済みIPの更新” PUT https://shifter.io/api/v1/backconnect/{membership}/authorized-ips
指定された値で認可済みIPの一覧を置き換えます。
| Parameter | In | Required | Description |
|---|---|---|---|
membership | path | yes | The plan ID |
api_token | query | yes | Your account API token |
ips[] | body | yes | Array of IPv4 addresses to whitelist |
Example (form-encoded, with method override):
curl -X POST "https://shifter.io/api/v1/backconnect/MEMBERSHIP_ID/authorized-ips?api_token=YOUR_API_TOKEN" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "_method=PUT&ips[]=198.51.100.10&ips[]=203.0.113.42"Geo defaults
Section titled “Geo defaults”レガシーポートにはプランごとのジオ割り当てがあります。一度設定すれば、プラン内のすべてのポートが、設定された国(または高度なフィルタ)内のIPを経由してルーティングされます。
現在のジオ割り当ての取得
Section titled “現在のジオ割り当ての取得” GET https://shifter.io/api/v1/backconnect/{membership}/geo
| Parameter | In | Required | Description |
|---|---|---|---|
membership | path | yes | The plan ID |
api_token | query | yes | Your account API token |
Response:
{ "geo": ["us", "gb"], "advanced_geo": []}ジオ割り当ての更新
Section titled “ジオ割り当ての更新” PUT https://shifter.io/api/v1/backconnect/{membership}/geo
| Parameter | In | Required | Description |
|---|---|---|---|
membership | path | yes | The plan ID |
api_token | query | yes | Your account API token |
geo[] | body | yes | Array of ISO-3166-1 alpha-2 country codes |
advanced_geo[] | body | no | Array of advanced geo filters (city or ASN) |
curl -X POST "https://shifter.io/api/v1/backconnect/MEMBERSHIP_ID/geo?api_token=YOUR_API_TOKEN" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "_method=PUT&geo[]=us&geo[]=uk&geo[]=ca"List proxies
Section titled “List proxies” GET https://shifter.io/api/v1/backconnect/{membership}/proxies
レガシープラン内の各ポートに対するhost:portエントリの一覧を返します。
| Parameter | In | Required | Description |
|---|---|---|---|
membership | path | yes | The plan ID |
api_token | query | yes | Your account API token |
Response:
{ "proxies": [ { "host": "apollo.p.shifter.io", "port": 10001 }, { "host": "zeus.p.shifter.io", "port": 10002 }, { "host": "cronos.p.shifter.io", "port": 10003 } ]}Method overrides
Section titled “Method overrides”多くのプロキシ対応HTTPクライアントは、標準以外のメソッドを取り除いてしまいます。管理APIでは、_method=PUTフォームフィールドを付けたPOSTをPUTと同等のものとして受け付けます。
See also
Section titled “See also”- レガシーポートモデル
- Authentication 、レガシー認証がResidential ProxiesおよびISP Proxiesとどう異なるか