### GetAllCerts API Request Example Source: https://www.volcengine.com/docs/508/66017?lang=zh A GET request example to retrieve all certificates. ```http GET https://imagex.volcengineapi.com/?Action=GetAllCerts&Version=2018-08-01 ``` -------------------------------- ### ApplyVpcUploadInfo Request Example Source: https://www.volcengine.com/docs/508/1510754 Example of a GET request to the ApplyVpcUploadInfo endpoint. ```http GET https://imagex.volcengineapi.com/?Action=ApplyVpcUploadInfo&Version=2023-05-01&ServiceId=u3*k ``` -------------------------------- ### Request Example for DescribeImageXDomainBandwidthData Source: https://www.volcengine.com/docs/508/9416 A GET request example demonstrating how to query bandwidth data with specified service IDs, domains, and time parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXDomainBandwidthData&Version=2018-08-01&ServiceIds=s1,s2&DomainNames=d1,d2&BillingRegion=CHN,AP1&GroupBy=DomainName&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### start() Source: https://www.volcengine.com/docs/508/1272434?lang=zh Starts the monitoring and reporting process. ```APIDOC ## start() ### Description Call this method to begin monitoring and reporting image loading events. ### Signature `() => void` ``` -------------------------------- ### GetDomainConfig Request Example Source: https://www.volcengine.com/docs/508/9366?lang=zh Example of a GET request to retrieve domain configuration settings. ```http GET https://imagex.volcengineapi.com/?Action=GetDomainConfig&Version=2018-08-01&DomainName=example.volcimagex.cn&ServiceId=yl***yn { "ServiceId":"yl***yn", "DomainName":"example.volcimagex.cn", } ``` -------------------------------- ### GetAllCerts API Request and Response Examples Source: https://www.volcengine.com/docs/508/66017 Examples showing the HTTP GET request structure, a successful JSON response, and an error response for the GetAllCerts API. ```http GET https://imagex.volcengineapi.com/?Action=GetAllCerts&Version=2018-08-01 ``` ```json { "ResponseMetadata": { "RequestId": "201806041104200100100232280022D30", "Action": "GetAllCerts", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1" }, "Result": [ { "cert_id": "syq7*", "cert_name": "*.imagex.com", "common_name": "*.imagex.com", "create_time": 1603371088, "not_after": 1619755200, "issuer": "TrustAsia TLS RSA CA" } ] } ``` ```json { "ResponseMetadata": { "RequestId": "201806041104200100100232280022D30", "Action": "GetAllCerts", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1", "Error": { "Code": "GetAllCertsErr", "Message": "Backend Service Error" } } } ``` -------------------------------- ### GetImageSettings API Request and Response Examples Source: https://www.volcengine.com/docs/508/66124 Examples demonstrating the HTTP GET request structure and the corresponding JSON response formats for the GetImageSettings API. ```http GET https://imagex.volcengineapi.com/?Action=GetImageSettings&Version=2018-08-01&AppId=179132&Category=HEIF ``` ```json { "ResponseMetadata": { "RequestId": "2020120614035401001202009815090730", "Action": "GetImageSettings", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1" }, "Result":{ "Settings":[ { "SettingId":"S-46f1e5af-5ffb-4c38-a873-307c7bf18ba2", "ParentId":"", "Status":0, "Name":"enable_heif", "Type":"integer", "Comment":"支持云控开启/关闭heif解码能力。1:开启,0:关闭", "DefaultValue":1, "ChildSettings":[ ], "Rules":[ ], "Region":"", "Category":"HEIF", "Public":"", "ValueRange":{ "Lower":null, "Upper":null }, "UpdateAt":"2022-06-20 17:06:14" } ] } } ``` ```json { "ResponseMetadata": { "RequestId": "201806041104200100100232280022D30", "Action": "GetImageSettings", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1", "Error": { "Code": "", "Message": "" } } } ``` -------------------------------- ### GetImageTranscodeQueues Request and Response Examples Source: https://www.volcengine.com/docs/508/1107341 Examples showing the HTTP GET request structure and the corresponding JSON response format for retrieving transcoding queues. ```http GET imagex-lang=zh&Action=GetImageTranscodeQueues&Version=2018-08-01&Offset=0&Limit=10&Region=cn ``` ```json { "ResponseMetadata": { "RequestId": "202306271632015C6D5DA688505318A600", "Action": "GetImageTranscodeQueues", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1" }, "Result": { "Queues": [ { "Id": "649a9dbc3**64d44cf5b0", "Name": "offline", "Desc": "", "Status": "Pending", "Type": "user", "CreateAt": "2023-06-27 16:28:44", "EnableCallback": true, "CallbackConf": { "Method": "HTTP", "Endpoint": "https://demo.com", "DataFormat": "JSON", "Args": "" } }, { "Id": "63db57e36**cce1ffee11bb1", "Name": "default", "Desc": "", "Status": "Pending", "Type": "default", "CreateAt": "2023-02-02 14:27:47", "EnableCallback": false, "CallbackConf": { "Method": "HTTP", "Endpoint": "12", "DataFormat": "JSON", "Args": "" } }, ], "Total": 2 } } ``` -------------------------------- ### startUpWithConfig: Source: https://www.volcengine.com/docs/508/1262414?lang=zh Initializes the BDWebImageManager module with a configuration object. ```APIDOC ## - (void)startUpWithConfig:(BDWebImageStartUpConfig *)config ### Description Initializes the BDWebImageManager module. Note: It is recommended to use TTSDKManager for initialization instead of calling this directly. ### Parameters - **config** (BDWebImageStartUpConfig*) - Required - The configuration object used for initialization. ``` -------------------------------- ### DescribeImageXCompressUsage Request Example Source: https://www.volcengine.com/docs/508/9415 Example of a GET request to the DescribeImageXCompressUsage endpoint. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXCompressUsage&Version=2018-08-01&ServiceIds=s1,s2&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### GetImageServiceSubscription Request Example Source: https://www.volcengine.com/docs/508/9351 Example of a GET request to the GetImageServiceSubscription endpoint. ```http GET https://imagex.volcengineapi.com/?Action=GetImageServiceSubscription&Version=2018-08-01 ``` -------------------------------- ### startUpWithConfig: Source: https://www.volcengine.com/docs/508/1262414?lang=zh Initializes the manager with the provided configuration. ```APIDOC ## void startUpWithConfig:(id)config ### Description Initializes the manager with the provided configuration. ``` -------------------------------- ### start Source: https://www.volcengine.com/docs/508/66132 Starts the upload process for a specific file. ```APIDOC ## start(key) ### Description Initiates the upload process for the file associated with the provided key. ### Parameters - **key** (String) - Required - The key returned by addImageFile. ``` -------------------------------- ### GetResponseHeaderValidateKeys Request Example Source: https://www.volcengine.com/docs/508/66013 Example of a GET request to the GetResponseHeaderValidateKeys endpoint. ```http GET https://imagex.volcengineapi.com/?Action=GetResponseHeaderValidateKeys&Version=2018-08-01 ``` -------------------------------- ### Install and Integrate Image Monitoring SDK Source: https://www.volcengine.com/docs/508/177943?lang=zh Methods for installing and initializing the image monitoring SDK via script or NPM. ```html
``` ```bash npm install @volcengine/imagex-monitor -S ``` ```javascript import { Monitor } from '@volcengine/imagex-monitor'; const monitor = new Monitor({ // config el: document, appId: xxxxx, // 请替换为您在集成准备获取的 appId region: 'cn' //中国 }) monitor.start() ``` -------------------------------- ### General Configuration Options Source: https://www.volcengine.com/docs/508/66132 Example of passing general configuration parameters during instantiation. ```javascript const ttUploader = new TTUploader({ userId: "xxx", appId: 666, imageConfig: { serviceId: "xxx" } }); ``` -------------------------------- ### GetAudioAuditResult Request Example Source: https://www.volcengine.com/docs/508/1784437 Example of a GET request to the GetAudioAuditResult endpoint. ```http GET https://imagex.volcengineapi.com/?Action=GetAudioAuditResult&Version=2023-05-01&TaskId=971917**019018 ``` -------------------------------- ### start(key) Source: https://www.volcengine.com/docs/508/1124892?lang=zh 启动上传任务。如果该上传任务被暂停,则再次调用此方法时将恢复上传。 ```APIDOC ## start(key) ### Description 启动上传任务。如果该上传任务被暂停,则再次调用此方法时将恢复上传。如不传 key,则所有已添加的文件将开始上传。 ### Parameters - **key** (String) - Optional - 上传文件的 key 值 ``` -------------------------------- ### 配置上传基本信息 Source: https://www.volcengine.com/docs/508/66130?lang=zh 在应用启动时配置必要的上传参数,建议在 didFinishLaunchingWithOptions 中执行。 ```objective-c /// 配置基本信息 NSDictionary *appInfo = @{ @"TTVideoEngineAID" : @(12345), /// appid @"TTVideoEngineAppName" : @"test_appName",/// appName @"TTVideoEngineChannel" : @"test_channel", @"TTVideoEngineUserId" : @"user_id", }; [TTImageUploadClientTop configureAppInfo:appInfo];//图片的上传的配置 ``` -------------------------------- ### GetImageStorageVersionFiles Request Example Source: https://www.volcengine.com/docs/508/1359366?lang=zh Example of a GET request to the GetImageStorageVersionFiles endpoint. ```http GET https://imagex.volcengineapi.com/?Action=GetImageStorageVersionFiles&Version=2023-05-01&ServiceId=test ``` -------------------------------- ### GetImageAddOnTag Request Example Source: https://www.volcengine.com/docs/508/1327583 Example of a GET request to the GetImageAddOnTag endpoint. ```http GET https://imagex.volcengineapi.com/?Action=GetImageAddOnTag&Version=2023-05-01&Key=功能属性&Type=AI ``` -------------------------------- ### Monitor.start() Source: https://www.volcengine.com/docs/508/658168 Initializes and starts the image monitoring SDK to track image loading performance. ```APIDOC ## Monitor.start() ### Description Initializes the ImageMonitor instance and begins tracking image loading events within the specified element. ### Parameters - **el** (HTMLElement) - Required - The DOM element to monitor (e.g., document). - **appId** (string) - Required - The unique identifier for the application obtained from the console. - **region** (string) - Required - The region code (e.g., 'cn'). ### Usage ```javascript import { Monitor } from '@volcengine/imagex-monitor'; const monitor = new Monitor({ el: document, appId: 'xxxxx', region: 'cn' }) monitor.start() ``` ``` -------------------------------- ### Request Example for DescribeImageXHitRateRequestData Source: https://www.volcengine.com/docs/508/1211122 Example GET request for the DescribeImageXHitRateRequestData API. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXHitRateRequestData&Version=2023-05-01&ServiceIds=s1,s2&DomainNames=d1,d2&GroupBy=DomainName&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### Upload Resources with PHP SDK Source: https://www.volcengine.com/docs/508/1274186 Demonstrates how to initialize the ImageX client and upload images by specifying the service ID and file paths. Ensure the SDK is installed and configured with appropriate credentials before execution. ```php setAccessKey("ak"); // $client->setSecretKey("sk"); $params = array(); $params["ServiceId"] = "imagex service id"; // 指定上传域名,域名格式参考 https://www.volcengine.com/docs/508/1537728 //$params["UploadHost"] = "upload host"; $filePaths = array("image path 1"); $response = $client->uploadImages($params, $filePaths); print_r($response); ``` -------------------------------- ### DescribeImageXBillingRequestCntUsage Request Example Source: https://www.volcengine.com/docs/508/1130795 A GET request example for the DescribeImageXBillingRequestCntUsage API. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXBillingRequestCntUsage&Version=2018-08-01&ServiceIds=s1,s2&AdvFeats=a1,a2&GroupBy=AdvFeat&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### Env.init 初始化 SDK Source: https://www.volcengine.com/docs/508/148786?lang=zh 在 Application#onCreate 中初始化 SDK,配置应用信息及云控参数。 ```APIDOC ## Env.init ### 初始化配置 Env.openAppLog(false); Env.init(new Config.Builder() .setApplicationContext(context) .setAppID("your app id") .setAppName("your app English name") .setAppVersion(BuildConfig.VERSION_NAME) .setAppChannel("channel name") .setOpenUploadCloudControl(true) .build()); ``` -------------------------------- ### PreviewImageUploadFile API Request Example Source: https://www.volcengine.com/docs/508/1327596 A GET request example for the PreviewImageUploadFile API. ```http GET https://imagex.volcengineapi.com/?Action=PreviewImageUploadFile&Version=2023-05-01&ServiceId=8h**9q&StoreUri=tos-cn-i-8h**9q/imagexdemo.heif ``` -------------------------------- ### SDK Initialization and Usage Source: https://www.volcengine.com/docs/508/1124892 How to initialize the TTUploader instance, set up event listeners, and add files for upload. ```APIDOC ## SDK Initialization and Usage ### Description Initialize the `TTUploader` instance with required user and application credentials, configure event listeners for upload status, and add files to the upload queue. ### Configuration Parameters - **userId** (String) - Required - Unique identifier for the user. - **appId** (Number) - Required - Application ID from the veImageX console. - **imageConfig** (Object) - Required - Configuration object containing `serviceId`. - **uploadHost** (String) - Optional - Custom upload domain. ### Event Listeners - **error**: Triggered when an upload fails. - **progress**: Triggered during upload, provides `percent`. - **complete**: Triggered when the upload finishes successfully. ### Example ```javascript import TTUploader from 'tt-uploader-miniprogram'; const uploader = new TTUploader({ userId: 'volcengine-user1', appId: 7827, imageConfig: { serviceId: 'hj7f' } }); uploader.on('progress', (info) => { console.log('Upload progress:', info.percent); }); const key = uploader.addImageFile({ path: 'file_path', size: 1234, stsToken: { ... }, fileExtension: '.png' }); uploader.start(key); ``` ``` -------------------------------- ### Initialize SDK Instance Source: https://www.volcengine.com/docs/508/1124892 Configure the SDK instance with required user, application, and service identifiers, including optional custom upload hosts. ```javascript const uploader = new TTUploader({ userId: 'Test1', //必填,自定义用户 ID,用于定位某用户的日志。 appId: 67**23, //必填,应用 ID,用于定位某业务应用的日志。 imageConfig: { //必填,图片上传配置。 serviceId: 'hi****2t' //必填,服务 ID,用于指定文件上传所在服务。 }, uploadHost: 'hi****2t.up.imagex-accelerate.volces.com' // 使用服务对应的上传域名进行上传,需要将对应的域名加入白名单 }); ``` -------------------------------- ### Initialize ImagePipelineFactory Source: https://www.volcengine.com/docs/508/1262419 Example of configuring and initializing the ImagePipelineFactory. This should only be executed once per process. ```java ImagePipelineConfig config = ImagePipelineConfig.newBuilder() .setXXX(xxx) .setYYY(yyy) .build(); ImagePipelineFactory factory = new ImagePipelineFactory(config); ImagePipeline pipeline = factory.getImagePipeline(); ``` -------------------------------- ### GetImageEraseModels Request Example Source: https://www.volcengine.com/docs/508/1254832 Example of a GET request to retrieve image restoration models. ```http GET https://imagex.volcengineapi.com/?Action=GetImageEraseModels&Version=2023-05-01&Type=0 ``` -------------------------------- ### CreateImageSettingRule Request and Response Examples Source: https://www.volcengine.com/docs/508/1324619?lang=zh Examples showing the POST request structure for creating a rule and the corresponding JSON response. ```json POST https://imagex.volcengineapi.com/?Action=CreateImageSettingRule&Version=2023-05-01 { "SettingId":"Sd**bc", "AppId":"56**80", "Rule":{ "Value":1, "Cond":{ "Type":"AND", "level":1, "Conds":[ { "Type":"AND", "Conds":[ { "Key":"OS", "Op":"==", "Value":"iOS" } ] } ] }, "Name":"test" } } ``` ```json { "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "CreateImageSettingRule", "Version": "2023-05-01", "Service": "ImageX", "Region": "cn-north-1" }, "Result": { "RuleId": "Re**21" } } ``` -------------------------------- ### GetCompressTaskInfo Request Example Source: https://www.volcengine.com/docs/508/1112506 Example of a GET request to retrieve compression task information. ```http GET https://imagex.volcengineapi.com/?Action=GetCompressTaskInfo&Version=2018-08-01&ServiceId=7j%2A%2A6&TaskId=82370%2A%2A%2A12102 ``` -------------------------------- ### GetImageMigrateTasks Request Example Source: https://www.volcengine.com/docs/508/1108670 Example of a GET request to retrieve image migration tasks. ```http GET https://imagex.volcengineapi.com/?Action=GetImageMigrateTasks&Version=2018-08-01&TaskId=648c0**1cab5d0&Region=cn ``` -------------------------------- ### Asynchronous AI Task Initialization (PHP) Source: https://www.volcengine.com/docs/508/111898 Demonstrates the initial setup for an asynchronous AI task using the PHP SDK. ```PHP setAccessKey("ak"); $client->setSecretKey("sk"); ``` -------------------------------- ### SDK Initialization with Temporary Credentials Source: https://www.volcengine.com/docs/508/1250175 How to initialize the service using temporary AK, SK, and SessionToken. ```APIDOC ## Initialization (Temporary Credentials) ```typescript import { imagex } from "@volcengine/openapi"; const imagexService = imagex.defaultService; // Set temporary credentials imagexService.setAccessKeyId(AccessKeyId); imagexService.setSecretKey(SecretKey); imagexService.setSessionToken(SessionToken); ``` ``` -------------------------------- ### GetImageTranscodeDetails Request Example Source: https://www.volcengine.com/docs/508/1107749 Example of a GET request to retrieve image transcoding details. ```http GET https://imagex.volcengineapi.com/?Action=GetImageTranscodeDetails&Version=2018-08-01&QueueId=64993499**0df83eb707812&StartTime=1687276800&EndTime=1687967999&Offset=0&Limit=10 ``` -------------------------------- ### Compile Demo via Command Line Source: https://www.volcengine.com/docs/508/1283729?lang=zh Use Gradle to clone and build the debug version of the application. ```shell git clone https://github.com/volcengine/ImageXDemo-Android cd ImageXDemo-Android ./gradlew :app:installdebug ``` -------------------------------- ### GetVideoAuditResult Request Example Source: https://www.volcengine.com/docs/508/1784439?lang=zh Example of a GET request to the GetVideoAuditResult endpoint with various query parameters. ```http GET https://imagex.volcengineapi.com/?Action=GetVideoAuditResult&Version=2023-05-01&AuditSuggestion=nopass&ImageType=fail&Limit=10&Marker=6940d****125072&Problem=video_porn&TaskId=971917**019018&Type=UrlFile ``` -------------------------------- ### GetImageAuditTaskResult Request Example Source: https://www.volcengine.com/docs/508/1784436?lang=zh Example of a GET request to retrieve image audit task results. ```http GET https://imagex.volcengineapi.com/?Action=GetImageAuditTaskResult&Version=2023-05-01&AuditSuggestion=nopass&ImageType=fail&Limit=10&Marker=6940d****125072&Problem=porn&TaskId=971917**019018&Type=UrlFile ``` -------------------------------- ### AppLog.start() Source: https://www.volcengine.com/docs/508/176063?lang=zh 在确保获得用户授权并进入业务场景后,调用此方法手动启动 Applog 模块,开始进行日志上报和数据采集操作。 ```APIDOC ### AppLog.start() #### Description 手动启动 Applog 模块,开始日志上报和数据采集。请在获得用户授权后调用。 #### Method `AppLog.start()` ``` -------------------------------- ### MonitorInitOptions Source: https://www.volcengine.com/docs/508/1272435?lang=zh Configuration options for initializing the image loading monitor. ```APIDOC ## MonitorInitOptions ### Description Configuration object used to initialize the image loading listener in the veImageX SDK. ### Parameters - **el** (string | HTMLElement) - Required - The element to monitor. Can be a specific img/picture tag or a selector string. - **selector** (string) - Optional - Filter selector for monitored elements. Defaults to 'img'. - **region** ("cn" | "sg") - Required - The region, which affects the reporting domain. - **appId** (number) - Required - The application ID. - **enableCloudConfig** (boolean) - Optional - Whether to enable cloud configuration delivery. - **userUniqueId** (string) - Optional - Unique identifier for the user. - **defaultConfig** (object) - Optional - Default configuration including report rates. - **include** (RegExp[]) - Optional - Regex rules for URLs to include in reporting. - **exclude** (RegExp[]) - Optional - Regex rules for URLs to exclude from reporting. - **css** (boolean) - Optional - Whether to monitor and report image loading within CSS. ``` -------------------------------- ### DescribeImageXEdgeRequestTraffic Request Example Source: https://www.volcengine.com/docs/508/177110 A GET request example for the DescribeImageXEdgeRequestTraffic API with various query parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXEdgeRequestTraffic&Version=2018-08-01&DomainNames=xxx.com%2Cyyy.com&EndTime=2019-06-02T00%3A00%3A00%2B08%3A00&GroupBy=DomainName&Interval=300&Isp=%E7%A7%BB%E5%8A%A8%2C%E8%81%94%E9%80%9A&Protocols=HTTP%2CHTTPS&Regions=%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86&ServiceIds=ysl%2A%2A%2A%2C4qp%2A%2A%2A&StartTime=2019-06-02T00%3A00%3A00%2B08%3A00&UserCountry=%E4%B8%AD%E5%9B%BD&UserProvince=%E5%8C%97%E4%BA%AC ``` -------------------------------- ### GetImageAllDomainCert API Request Example Source: https://www.volcengine.com/docs/508/146801?lang=zh Example of a GET request to retrieve all domain and certificate information. ```http GET https://imagex.volcengineapi.com/Action=GetImageAllDomainCert&Version=2018-08-01 ``` -------------------------------- ### GetImageSettings Request Example Source: https://www.volcengine.com/docs/508/1324617 Example of a GET request to retrieve image settings for the HEIF category. ```http GET https://imagex.volcengineapi.com/?Action=GetImageSettings&Version=2023-05-01&AppId=56**80&Category=HEIF ``` -------------------------------- ### start Source: https://www.volcengine.com/docs/508/66132?lang=zh 开始执行上传任务。 ```APIDOC ## start ### 描述 根据文件 key 开始上传任务。 ### 参数 - **Key** (String) - 必填 - addImageFile 返回的文件 key ### 示例 ```javascript ttUploader.start(fileKey); ``` ``` -------------------------------- ### DescribeImageXRequestCntUsage Request Example Source: https://www.volcengine.com/docs/508/1209561 Example of a GET request to the DescribeImageXRequestCntUsage endpoint with various query parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXRequestCntUsage&Version=2023-05-01&ServiceIds=s1,s2&AdvFeats=a1,a2&Templates=t1,t2&GroupBy=AdvFeat&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### SDK Initialization with Permanent Credentials Source: https://www.volcengine.com/docs/508/1250175 How to initialize the service using permanent AK/SK credentials. ```APIDOC ## Initialization (Permanent Credentials) ```typescript import { imagex } from "@volcengine/openapi"; const imagexService = imagex.defaultService; // Set permanent credentials imagexService.setAccessKeyId(AccessKeyId); imagexService.setSecretKey(SecretKey); ``` ``` -------------------------------- ### DescribeImageXDomainTrafficData Request Example Source: https://www.volcengine.com/docs/508/1209478 An example of a GET request to the DescribeImageXDomainTrafficData endpoint with specified query parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXDomainTrafficData&Version=2023-05-01&ServiceIds=s1,s2&DomainNames=d1,d2&BillingRegion=CHN,AP1&GroupBy=DomainName&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### GetImageSettingRuleHistory Request Example Source: https://www.volcengine.com/docs/508/1327595 Example of a GET request to retrieve the modification history of image setting rules. ```http GET https://imagex.volcengineapi.com/?Action=GetImageSettingRuleHistory&Version=2023-05-01&1=&AppId=17**32&SettingId=Sc**3b ``` -------------------------------- ### Synchronous AI Image Processing in Go Source: https://www.volcengine.com/docs/508/136551 Demonstrates how to initialize the ImageX service and execute an AI processing task using a workflow template. Ensure environment variables for AccessKey and SecretKey are configured securely before execution. ```go package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_AIProcess(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ // 强烈建议不要把 ak 和 sk 保存到工程代码里,否则可能导致 AccessKey 泄露,威胁您账号下所有资源的安全。 // 本示例通过从环境变量中读取 ak 和 sk,来实现 API 访问的身份验证。运行代码示例前,请配置环境变量 ak 和 sk。 AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.AIProcessReq{ AIProcessBody: &imagex.AIProcessBody{ ServiceID: "91**2g", // 必选。服务 ID。 WorkflowTemplateID: "system_workflow_ai_bgfill", // 必选。模板 ID。固定取值。 WorkflowParameter: "{\"Input\":{\"ObjectKey\":\"example.webp\",\"DataType\":\"uri\"},\"BgfillParam\":{\"Model\":3,\"Top\":0.1,\"Bottom\":0.1,\"Left\":0.1,\"Right\":0.1}}", // 必选。根据本文模板说明 > 输入参数,设置该参数取值。 }, } resp, err := instance.AIProcess(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } } ``` -------------------------------- ### DescribeImageXEdgeRequestBandwidth Request Example Source: https://www.volcengine.com/docs/508/1209572 An example of an HTTP GET request to the DescribeImageXEdgeRequestBandwidth endpoint with various query parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXEdgeRequestBandwidth&Version=2023-05-01&ServiceIds=s1,s2&DomainNames=d1,d2&Regions=中国大陆&UserCountry=中国&UserProvince=北京&Protocols=HTTP,HTTPS&Isp=移动,联通&GroupBy=DomainName&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### Install ImageX SDK Source: https://www.volcengine.com/docs/508/1121833?lang=zh Use yarn to add the ImageX package to your Douyin mini program project. ```bash yarn add @volcengine/imagex-mp-douyin ``` -------------------------------- ### GetImageTranscodeQueues Request Example Source: https://www.volcengine.com/docs/508/1160404 Example of a GET request to retrieve image transcode queues with specified parameters. ```http GET https://imagex.volcengineapi.com/?Action=GetImageTranscodeQueues&Version=2023-05-01&Limit=10&Offset=0&Region=cn&SearchPtn=offline ``` -------------------------------- ### Fresco.initialize Source: https://www.volcengine.com/docs/508/1262419 Initializes the Fresco framework with various configuration options. ```APIDOC ## public static void initialize(Context context) ### Description Initializes the Fresco framework using default configurations. ### Parameters - **context** (Context) - Required - Application context object. ## public static void initialize(Context context, @Nullable ImagePipelineConfig imagePipelineConfig) ### Description Initializes the Fresco framework with a custom image pipeline configuration. ### Parameters - **context** (Context) - Required - Application context object. - **imagePipelineConfig** (@Nullable ImagePipelineConfig) - Optional - Image pipeline configuration. ## public static void initialize(Context context, @Nullable ImagePipelineConfig imagePipelineConfig, @Nullable DraweeConfig draweeConfig, boolean useNativeCode) ### Description Initializes the Fresco framework with custom image pipeline and Drawee configurations, with an option to enable native code. ### Parameters - **context** (Context) - Required - Application context object. - **imagePipelineConfig** (@Nullable ImagePipelineConfig) - Optional - Image pipeline configuration. - **draweeConfig** (@Nullable DraweeConfig) - Optional - Drawee configuration. - **useNativeCode** (boolean) - Required - Whether to use native code. ``` -------------------------------- ### GetDedupTaskStatus API Request Example Source: https://www.volcengine.com/docs/508/138909 Example of a GET request to retrieve the status of an asynchronous image deduplication task. ```http GET https://imagex.volcengineapi.com/?Action=GetDedupTaskStatus&Version=2018-08-01&TaskId=testTaskId ``` -------------------------------- ### 设置上传高级配置 Source: https://www.volcengine.com/docs/508/149778?lang=zh 通过 setUploadConfig 方法配置分片阈值、并发数、超时时间等高级上传参数。 ```APIDOC ## [Objective-C] setUploadConfig ### Description 在开始上传前调用此方法配置分片上传策略、超时时间及并发控制等参数。 ### Method Objective-C Method ### Parameters - **BDFileUploadSliceThreshold** (NSNumber) - 分片上传阈值。 - **BDFileUploadSliceSize** (NSNumber) - 分片大小。 - **BDFileUploadSocketNum** (NSNumber) - 并发连接数。 - **BDFileUploadMaxConcurrentFileNum** (NSNumber) - 同时上传文件并发数。 ### Code Example ```objectivec [imageXUploadClient setUploadConfig:@{ BDFileUploadSliceThreshold:@(1000000), BDFileUploadSliceSize:@(512*1024), BDFileUploadSocketNum:@(4), BDFileUploadMaxConcurrentFileNum:@(3) }]; ``` ``` -------------------------------- ### DescribeImageXCompressUsage Request Example Source: https://www.volcengine.com/docs/508/1209563 Example of a GET request to the DescribeImageXCompressUsage endpoint with specified service IDs and time parameters. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXCompressUsage&Version=2023-05-01&ServiceIds=s1,s2&GroupBy=ServiceId&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300 ``` -------------------------------- ### Integrate and Configure SDK Uploads Source: https://www.volcengine.com/docs/508/1124892 Initialize the uploader with user and service credentials, set up event listeners for progress and errors, and initiate the file upload process. ```javascript import TTUploader from 'tt-uploader-miniprogram'; // 初始化uploader const uploader = new TTUploader({ userId: 'volcengine-user1', // 必填,用户 ID。自定义,建议设置能识别用户的唯一标识 id,用于上传出错时排查问题,不要传入非 ASCII编码 appId: 78**27, // 必填,应用 ID。在应用服务中创建的 AppID,质量监控等以该参数来区分业务方,务必正确填写 imageConfig: { serviceId: 'hj****7f' // 必填,服务 ID。请在 veImageX 控制台-服务管理查看并记录该值 } }); // 设置监听事件 uploader.on('error', (info) => { console.log('上传失败', info) }) uploader.on('progress', (infor) => { console.log('上传进度:', infor.percent) }); uploader.on('complete', (info) => { console.log('上传成功', info) }) // 添加上传文件 const key = uploader.addImageFile({ path: '', // 文件临时路径,从 chooseMedia 回调中获取 size: 1234, // 文件大小,从 chooseMedia 回调中获取 // 从服务端获取到的临时访问凭证,请参考【接入准备-获取上传签名】说明 stsToken: { "CurrentTime":"2023-03-31T07:47:14.866Z", "ExpiredTime":"2023-05-30T07:47:14.866Z", "SessionToken":"STS2****In0=", "AccessKeyId":"AKTPZDM1***iNTU5ODg", "SecretAccessKey":"aNXEA8uvC***Pqg==" }, fileExtension: '.png' }); // 开始上传 uploader.start(key) ``` -------------------------------- ### GetUrlFetchTask Request Example Source: https://www.volcengine.com/docs/508/196882 Example of a GET request to retrieve the status of an asynchronous fetch task using the task ID. ```http GET https://imagex.volcengineapi.com/?Action=GetUrlFetchTask&Version=2018-08-01&Id=92830H07WJS28370 ``` -------------------------------- ### Install Image Monitoring via NPM Source: https://www.volcengine.com/docs/508/658168 Install the monitoring SDK package using npm. ```bash npm install @volcengine/imagex-monitor -S ``` -------------------------------- ### GetImageElements API Request Example Source: https://www.volcengine.com/docs/508/127488 A GET request example for the GetImageElements API, specifying the action, version, and element type. ```http GET https://imagex.volcengineapi.com/?imagex-lang=zh&Action=GetImageElements&Version=2018-08-01&Type=image&SearchPtn=&Offset=0&Limit=20 ``` -------------------------------- ### initLoggerInstance(options: LoggerOptions) Source: https://www.volcengine.com/docs/508/1169885?lang=zh 初始化日志上报实例,配置上报参数及回调函数。 ```APIDOC ## initLoggerInstance(options) ### Description 初始化日志上报实例,用于收集并上报图片加载过程中的相关指标。 ### Parameters #### LoggerOptions - **region** (string) - Required - 区域,取值 'cn' (国内) 或 'sg' (新加坡)。 - **appId** (number) - Required - 应用 ID,用于定位业务线日志。 - **userUniqueId** (string) - Required - 自定义用户 ID。 - **enableCloudConfig** (boolean) - Optional - 是否启用云端配置下发,默认为 false。 - **reportRateConfig** (object) - Optional - 采样率配置。 - **reportRate** (number) - Optional - 正常日志上报采样率,范围 [0, 1],默认 1。 - **reportRateError** (number) - Optional - 错误日志上报采样率,范围 [0, 1],默认 1。 - **callback** (function) - Optional - 日志上报回调函数,接收 (evtName, ...evtParams)。 ### Request Example ```javascript import { initLoggerInstance } from '@volcengine/imagex-mp-taro' initLoggerInstance({ region: 'cn', appId: 123456, userUniqueId: 'miniprogram-test', enableCloudConfig: false, reportRateConfig: { reportRate: 1, reportRateError: 1 }, callback: (evtName, ...evtParams) => { console.log(evtName, evtParams) } }); ``` ``` -------------------------------- ### GetTemplatesFromBin Request Source: https://www.volcengine.com/docs/508/132241 Example of a GET request to the GetTemplatesFromBin endpoint. ```plain GET https://imagex.volcengineapi.com/?Action=GetTemplatesFromBin&Version=2018-08-01&ServiceId=fc5**cf ``` -------------------------------- ### GetImageSettings Response Example Source: https://www.volcengine.com/docs/508/1324617 Example JSON response containing the image settings configuration. ```json { "ResponseMetadata": { "RequestId": "202306041104200100100232280022D31", "Action": "GetImageSettings", "Version": "2023-05-01", "Service": "ImageX", "Region": "cn-north-1" }, "Result": { "Settings": [ { "SettingId": "Sd***bc", "ParentId": "", "Status": 0, "Name": "heif_encode", "AppType": [ "APP" ], "Type": "integer", "Comment": "只有授权码生效期内才可支持云控开启/关闭heif编码能力。1:开启,0:关闭", "DefaultValue": 1, "ChildSettings": [], "Rules": [], "Region": "", "Category": "HEIF", "Public": "", "ValueRange": { "Lower": null, "Upper": 1 }, "UpdateAt": "2024-01-03 11:29:25" }, { "SettingId": "Sb**6e", "ParentId": "", "Status": 0, "Name": "heif_decode", "AppType": [ "APP" ], "Type": "integer", "Comment": "只有授权码生效期内才可支持云控开启/关闭heif解码能力。1:开启,0:关闭", "DefaultValue": 1, "ChildSettings": [], "Rules": [], "Region": "", "Category": "HEIF", "Public": "", "ValueRange": { "Lower": 0, "Upper": 1 }, "UpdateAt": "2023-01-09 20:06:05" } ] } } ``` -------------------------------- ### 设置高级上传参数 Source: https://www.volcengine.com/docs/508/149778?lang=zh 使用 setUploadConfig 方法配置分片阈值、并发数、超时时间及 HTTPS 开关等高级选项。 ```objectivec ....... [imageXUploadClient setUploadConfig:@{ BDFileUploadSliceThreshold:@(1000000) BDFileUploadSliceSize:@(512*1024), BDFileUploadSocketNum:@(4), BDFileUploadTcpOpenTimeOutMilliSec:@(5000), BDFileUploadMaxFailTimes:@(5), BDFileUploadRWTimeout:@(40), BDFileUploadSliceRetryCount:@(5), BDFileUploadFileRetryCount:@(5), BDFileUploadTranTimeOutUnit:@(30), BDFileUploadHttpsEnable:@(BDUploadHttpsOpen), BDFileUploadMaxConcurrentFileNum:@(3) }]; ....... ``` -------------------------------- ### GetImageStyles API Request Example Source: https://www.volcengine.com/docs/508/1254811 A GET request example for retrieving image styles using the specified API endpoint and query parameters. ```http GET https://imagex.volcengineapi.com/?Action=GetImageStyles&Version=2023-05-01&Type=user&SearchPtn=pattern&Limit=10&Offset=0 ``` -------------------------------- ### DescribeImageXSourceRequest API Request Example Source: https://www.volcengine.com/docs/508/1249420 A GET request example for the DescribeImageXSourceRequest action, specifying service IDs, domains, regions, and time intervals. ```http GET https://imagex.volcengineapi.com/?Action=DescribeImageXSourceRequest&Version=2023-05-01&ServiceIds=s1,s2&DomainNames=d1,d2&Regions=中国大陆,北美区&UserCountry=中国&UserProvince=北京&Protocols=HTTP,HTTPS&Isp=移动,联通&DataTypes=req_cnt,2xx,3xx&GroupBy=DomainName,DataType&StartTime=2019-06-02T00:00:00+08:00&EndTime=2019-06-02T00:00:00+08:00&Interval=300&DetailedCode=true ``` -------------------------------- ### start(key) Source: https://www.volcengine.com/docs/508/1124892 Starts the upload task for a specific file or all files if no key is provided. ```APIDOC ## start(key) ### Description Starts the upload task. If a key is provided, only that file is uploaded; otherwise, all pending files are uploaded. ### Parameters - **key** (String) - Optional - The unique key of the file to start uploading. ``` -------------------------------- ### GetAllImageServices Request Example Source: https://www.volcengine.com/docs/508/9360?lang=zh A GET request to retrieve all image services. ```http GET https://imagex.volcengineapi.com/?Action=GetAllImageServices&Version=2018-08-01&SearchPtn= ``` -------------------------------- ### Configure Initialization Parameters Source: https://www.volcengine.com/docs/508/1283729?lang=zh Update the ImageXInitHelper file with your specific application credentials before running the project. ```javascript object ImageXInitHelper { private const val APP_ID ="your app id" // 应用 ID private const val TOKEN ="your token" // Token private const val AUTH_CODE="your auth code" // 授权码 // ... 省略 } ```