多地区支持
ProductAI默认使用api.productai.cn,或者api-cn-east-1.productai.cn 中国华东 (中国大陆杭州) 提供服务。目前,全球部署有两处服务节点:
地区 | 地址 |
---|
中国华东 (中国大陆杭州) | api-cn-east-1.productai.cn |
亚洲太平洋 (中国香港) | api-ap-southeast-1.productai.com |
用户可以在调用服务时,设定服务节点的域名参数,服务请求将由该节点响应。国内用户推荐使用默认设置,海外用户推荐中国香港的服务节点。
注:两个节点提供的服务并不相同。请与你的客户经理联系确认在对应节点是否提供你所需要的服务
API支持
# 使用中国大陆杭州节点 curl -X POST \ -H 'x-ca-version: 1.0' \ -H 'x-ca-accesskeyid: ACCESS_KEY_ID' \ -d 'url=https://yyyy' \ https://api.productai.cn/search/SERVICE_ID
# 或 curl -X POST \ -H 'x-ca-version: 1.0' \ -H 'x-ca-accesskeyid: ACCESS_KEY_ID' \ -d 'url=https://yyyy' \ https://api-cn-east-1.productai.cn/search/SERVICE_ID
# 使用中国香港节点 curl -X POST \ -H 'x-ca-version: 1.0' \ -H 'x-ca-accesskeyid: ACCESS_KEY_ID' \ -d 'url=https://yyyy' \ https://api-ap-southeast-1.productai.com/search/SERVICE_ID
|
SDK支持
from productai import Client
cli = Client(ACCESS_KEY_ID, SECRET_KEY, url_root='https://api.productai.cn')
cli = Client(ACCESS_KEY_ID, SECRET_KEY) cli.url_root = 'https://api-ap-southeast-1.productai.com'
|
use ProductAI;
$product_ai = new ProductAI\API($access_key_id=ACCESS_KEY_ID, $secret_key=SECRET_KEY); $product_ai->api = 'https://api-ap-southeast-1.productai.com';
|
IProfile profile = new DefaultProfile(); profile.setAccessKeyId(ACCESS_KEY_ID); profile.setSecretKey(SECRET_KEY); profile.setVersion("1"); profile.setGlobalLanguage(LanguageType.Chinese);
IWebClient client = new DefaultProductAIClient(profile); client.setHost("api-ap-southeast-1.productai.com");
|
IProfile profile = new DefaultProfile { Version = "1", AccessKeyId = ACCESS_KEY_ID, SecretKey = SECRET_KEY, GlobalLanguage = LanguageType.Chinese };
var client = new DefaultProductAIClient(profile, "api-ap-southeast-1.productai.com");
|