Use the AI Guardrails SDK for .NET to list all business scenarios in your account, including both system defaults and custom configurations. This helps you audit and manage your content moderation setup.
For the full API reference, see DescribeUserBizTypes.
Prerequisites
Before you begin, ensure that you have:
Installed the .NET dependencies using the exact .NET version specified in Install .NET dependencies. Using a different version causes subsequent operation calls to fail
Stored your RAM user's AccessKey ID and AccessKey secret as environment variables
ALIBABA_CLOUD_ACCESS_KEY_IDandALIBABA_CLOUD_ACCESS_KEY_SECRET
Supported regions
The DescribeUserBizTypes operation is available in the following regions:
| Region ID | Location |
|---|---|
cn-shanghai | China (Shanghai) |
cn-beijing | China (Beijing) |
cn-shenzhen | China (Shenzhen) |
ap-southeast-1 | Singapore |
List business scenarios
The following example calls DescribeUserBizTypes and prints each business scenario's name, source, and industry information.
using System;
using Newtonsoft.Json;
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Http;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Green.Model.V20170823;
using System.Collections.Generic;
namespace csharp_sdk_sample
{
class Program
{
static void Main(string[] args)
{
// Load credentials from environment variables to avoid hardcoding sensitive information.
DefaultProfile profile = DefaultProfile.GetProfile(
"cn-shanghai",
Environment.GetEnvironmentVariable("ALIBABA_CLOUD_ACCESS_KEY_ID"),
Environment.GetEnvironmentVariable("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
DefaultAcsClient client = new DefaultAcsClient(profile);
DescribeUserBizTypesRequest describeUserBizTypesRequest = new DescribeUserBizTypesRequest();
// Set the response format.
describeUserBizTypesRequest.AcceptFormat = FormatType.JSON;
// Set the request method.
describeUserBizTypesRequest.Method = MethodType.GET;
describeUserBizTypesRequest.Encoding = "utf-8";
try
{
DescribeUserBizTypesResponse response = client.GetAcsResponse(describeUserBizTypesRequest);
if (response.HttpResponse.Status != 200)
{
Console.WriteLine("the request failed. status:{0}", response.HttpResponse.Status);
}
Console.WriteLine(System.Text.Encoding.Default.GetString(response.HttpResponse.Content));
// Total number of business scenarios returned.
Console.WriteLine("query success. bizTypes size :" + response.BizTypeList.Count);
foreach (DescribeUserBizTypesResponse.DescribeUserBizTypes_Item bizTypeItem in response.BizTypeList)
{
Console.WriteLine(bizTypeItem.BizType); // Business scenario name
Console.WriteLine(bizTypeItem.CiteTemplate); // Whether an industry template was imported
Console.WriteLine(bizTypeItem.IndustryInfo); // Industry information
Console.WriteLine(bizTypeItem.Source); // "custom" or "system"
}
}
catch (Exception ex)
{
Console.WriteLine("Failed with error info: {0}", ex.Message);
}
}
}
}Response fields
Each item in BizTypeList contains the following fields:
| Field | Description |
|---|---|
BizType | The name of the business scenario. |
CiteTemplate | Specifies whether an industry template was imported into this scenario. |
IndustryInfo | The industry information. |
Source | The origin of the business scenario. Valid values: custom (user-created scenario) and system (AI Guardrails built-in default). |
What's next
For the complete parameter reference and response schema, see DescribeUserBizTypes.
To install or update the SDK, see Install .NET dependencies.