To use Content Moderation SDK for .NET to initiate an API call, initialize a client instance and modify the client configurations as needed.
Background information
When you create a client instance, you must specify the region and the AccessKey ID
and AccessKey secret of your Alibaba Cloud account.
- For more information about the supported regions, see Endpoints.
- For more information about the AccessKey pair of an Alibaba Cloud account, see Obtain an AccessKey pair.
Create a client instance to moderate images, audio, videos, and text
The following regions are supported:
- cn-shanghai: China (Shanghai)
- cn-beijing: China (Beijing)
- cn-shenzhen: China (Shenzhen)
- ap-southeast-1: Singapore (Singapore)
Use the following code to create a client instance to moderate images, audio, videos,
and text:
// Use the AccessKey ID and AccessKey secret of your Alibaba Cloud account.
IClientProfile profile = DefaultProfile.GetProfile("cn-shanghai", "Your AccessKey ID", "Your AccessKey secret");
DefaultAcsClient client = new DefaultAcsClient(profile);
Note If you create a client instance in a region other than the China (Shanghai) region,
replace
cn-shanghai
in the preceding code with the ID of the region, for example, cn-beijing
.