コンテンツにスキップ
ログイン サインアップ

レガシープラン管理API

このページでは、レガシーのポートベースプラン向けの管理APIについて説明します。これは、トラフィックベースのゲートウェイではなく、固定のポート範囲を持つ既存顧客向けのプランです。これらのエンドポイントを使用して、送信元IPをホワイトリストに登録し、ポートごとのジオデフォルトを設定し、割り当てられたポート一覧を取得します。

すべてのエンドポイントはapi_tokenクエリパラメータで認証します。パネルAccount → API Tokensでトークンを生成してください。

?api_token=YOUR_API_TOKEN

{membership}パスパラメータはお使いのプランIDで、パネルのプランページに表示されます。

レガシープランは送信元IPのみで認証を行います。スクレイパーが接続元とするIPをホワイトリストに登録してください。

GET https://shifter.io/api/v1/backconnect/{membership}/authorized-ips
ParameterInRequiredDescription
membershippathyesThe plan ID
api_tokenqueryyesYour account API token

Example:

Terminal window
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"]
}
PUT https://shifter.io/api/v1/backconnect/{membership}/authorized-ips

指定された値で認可済みIPの一覧を置き換えます。

ParameterInRequiredDescription
membershippathyesThe plan ID
api_tokenqueryyesYour account API token
ips[]bodyyesArray of IPv4 addresses to whitelist

Example (form-encoded, with method override):

Terminal window
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"

レガシーポートにはプランごとのジオ割り当てがあります。一度設定すれば、プラン内のすべてのポートが、設定された国(または高度なフィルタ)内のIPを経由してルーティングされます。

GET https://shifter.io/api/v1/backconnect/{membership}/geo
ParameterInRequiredDescription
membershippathyesThe plan ID
api_tokenqueryyesYour account API token

Response:

{
"geo": ["us", "gb"],
"advanced_geo": []
}
PUT https://shifter.io/api/v1/backconnect/{membership}/geo
ParameterInRequiredDescription
membershippathyesThe plan ID
api_tokenqueryyesYour account API token
geo[]bodyyesArray of ISO-3166-1 alpha-2 country codes
advanced_geo[]bodynoArray of advanced geo filters (city or ASN)
Terminal window
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"
GET https://shifter.io/api/v1/backconnect/{membership}/proxies

レガシープラン内の各ポートに対するhost:portエントリの一覧を返します。

ParameterInRequiredDescription
membershippathyesThe plan ID
api_tokenqueryyesYour 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 }
]
}

多くのプロキシ対応HTTPクライアントは、標準以外のメソッドを取り除いてしまいます。管理APIでは、_method=PUTフォームフィールドを付けたPOSTをPUTと同等のものとして受け付けます。