High-performance call pattern

更新时间:
复制 MD 格式

This document is for users who require low-latency and high-performance API access.

Region configuration

Select a region close to your server for the service API's public network address. This reduces call latency.

If your server is deployed on Alibaba Cloud, select a private network address based on your server's region. Private network calls significantly reduce end-to-end latency compared to public network calls.

The following table lists the supported regions and their configurations.

Region

regionId

Public endpoint

Private endpoint

Shenzhen

cn-shenzhen

saf.cn-shenzhen.aliyuncs.com

saf-vpc.cn-shenzhen.aliyuncs.com

Shanghai

cn-shanghai

saf.cn-shanghai.aliyuncs.com

saf-vpc.cn-shanghai.aliyuncs.com

Hangzhou

cn-hangzhou

saf.cn-hangzhou.aliyuncs.com

saf-vpc.cn-hangzhou.aliyuncs.com

Zhangjiakou

cn-zhangjiakou

saf.cn-zhangjiakou.aliyuncs.com

saf-vpc.cn-zhangjiakou.aliyuncs.com

Beijing

cn-beijing

saf.cn-beijing.aliyuncs.com

saf-vpc.cn-beijing.aliyuncs.com

China (Hong Kong)

cn-hongkong

saf.cn-hongkong.aliyuncs.com

saf-vpc.cn-hongkong.aliyuncs.com

Singapore

ap-southeast-1

saf.ap-southeast-1.aliyuncs.com

saf-vpc.ap-southeast-1.aliyuncs.com

Call methods

You can access the Fraud Detection API in one of two ways: use the official SDK or make native HTTPS calls directly to the endpoint.

1. Access using the official SDK

  • Method: DefaultProfile.addEndpoint(regionId, "saf", endPoint);

  • Example: For a server deployed on an Alibaba Cloud ECS instance in Shanghai: DefaultProfile.addEndpoint("cn-shanghai", "saf", "saf-vpc.cn-shanghai.aliyuncs.com");

Note

Select a RegionId from the table based on your server's deployment location. If your server is deployed on Alibaba Cloud, use the private endpoint.

2. Call directly using the endpoint

  • Example: For a server deployed on an Alibaba Cloud ECS instance in Shanghai, set the API address to https://saf-vpc.cn-shanghai.aliyuncs.com.

Important

If you cannot ping the private endpoint, confirm that your deployment environment supports VPC networks.