### Install Go SDK using go get Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/README.md This snippet demonstrates how to install the Tencent Ads Marketing API Go SDK using the `go get` command. This is a simpler method for quickly obtaining the SDK. ```shell go get github.com/tencentad/marketing-api-go-sdk ``` -------------------------------- ### BidwordFlowGet Go Example Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/BidwordFlowApi.md Example of how to use the BidwordFlowGet method to query keyword traffic. Requires context and BidwordFlowGetRequest object. Supports JSON and XML content types. ```go package main import ( "context" "fmt" "github.com/tencentad/marketing-api-go-sdk/pkg/client" "github.com/tencentad/marketing-api-go-sdk/pkg/model/v1_3" ) func main() { // Initialize the SDK client cli := client.NewClient(&client.Options{ AccessToken: "YOUR_ACCESS_TOKEN", AccountId: 123456789, }) // Create a context ctx := context.Background() // Prepare the request data data := &v1_3.BidwordFlowGetRequest{ CampaignId: uint64(12345), // Example Campaign ID CampaignName: "example_campaign", AdgroupId: uint64(67890), // Example Adgroup ID AdgroupName: "example_adgroup", Bidword: []string{"keyword1", "keyword2"}, // Add other optional parameters as needed } // Call the BidwordFlowGet method resp, err := cli.BidwordFlow().BidwordFlowGet(ctx, data) if err != nil { fmt.Printf("Error calling BidwordFlowGet: %s\n", err) return } // Process the response fmt.Printf("Response: %+v\n", resp) } ``` -------------------------------- ### MarketingTargetTypesGet Go SDK Example Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/MarketingTargetTypesApi.md Example of how to use the MarketingTargetTypesGet method from the TencentAds Marketing API Go SDK. This method fetches available marketing target content types. It requires a context and an optional configuration struct, and returns a response or an error. ```go package main import ( "context" "github.com/tencentad/marketing-api-go-sdk/pkg/client" "github.com/tencentad/marketing-api-go-sdk/pkg/model" "github.com/tencentad/marketing-api-go-sdk/pkg/api" "github.com/tencentad/marketing-api-go-sdk/pkg/optional" ) func main() { // Initialize the client cli := client.NewClient(&client.Options{ AccessToken: "YOUR_ACCESS_TOKEN", // ... other options }) // Initialize the API api := api.NewMarketingTargetTypesApi(cli) // Create context ctx := context.Background() // Define optional parameters opt := api.NewMarketingTargetTypesApiMarketingTargetTypesGetOpts(). SetAccountId(optional.Int64(12345)). SetFields([]string{"id", "name"}) // Call the API method resp, _, err := api.MarketingTargetTypesGet(ctx, opt) if err != nil { // Handle error panic(err) } // Process the response // resp is of type *model.MarketingTargetTypesGetResponse _ = resp } ``` -------------------------------- ### Call API Interface (Campaigns Get) - Go Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/README.md This Go code shows how to call the `Campaigns().Get()` API method to retrieve campaign data. It includes setting up the SDK with an Access Token, specifying an account ID, and using optional parameters for filtering. The example demonstrates error handling for API responses and local validation issues. Note that model data types are pointers. ```go package main import ( "encoding/json" "fmt" "github.com/antihax/optional" "github.com/tencentad/marketing-api-go-sdk/pkg/ads" "github.com/tencentad/marketing-api-go-sdk/pkg/api" "github.com/tencentad/marketing-api-go-sdk/pkg/model" "github.com/tencentad/marketing-api-go-sdk/pkg/config" "github.com/tencentad/marketing-api-go-sdk/pkg/errors" ) func main() { accessToken := "YOUR ACCESS TOKEN" tads := ads.Init(&config.SDKConfig{ AccessToken: accessToken, }) // your account id accountId := int64(0) field := "promoted_object_type" operator := "EQUALS" campaignsGetOpts := &api.CampaignsGetOpts{ Filtering: optional.NewInterface([]model.FilteringStruct{model.FilteringStruct{ Field:&field, Operator:&operator, Values:[]string{"PROMOTED_OBJECT_TYPE_APP_IOS"}, }}) } ctx := *tads.Ctx // oauth/token接口即对应Campaigns().Get()方法 response, _, err := tads.Campaigns().Get(ctx, accountId, campaignsGetOpts) if err != nil { if resErr, ok := err.(errors.ResponseError); ok { // When Api returns an error errStr, _ := json.Marshal(resErr) // TODO for api error fmt.Println("Response error:", string(errStr)) } else { // When validation fails or other local issues // TODO for other error fmt.Println("Error:", err) } } fmt.Println(response) } ``` -------------------------------- ### Configure SDK Environment and Access Token - Go Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/README.md This Go snippet demonstrates how to initialize the SDK with an Access Token and set the API environment (sandbox or production). The `UseSandbox()` method defaults to the sandbox environment; call `UseProduction()` for the production environment. ```go package main import ( "github.com/tencentad/marketing-api-go-sdk/pkg/ads" "github.com/tencentad/marketing-api-go-sdk/pkg/config" ) func main() { accessToken := "YOUR ACCESS TOKEN" tads := ads.Init(&config.SDKConfig{ AccessToken: accessToken, }) // 默认访问沙箱环境,如访问正式环境,请调用tads.UseProduction() tads.UseSandbox() } ``` -------------------------------- ### Brand Get API Endpoint Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/BrandGetResponse.md This section describes the Brand Get API endpoint and its response structure. ```APIDOC ## GET /brand ### Description Retrieves a list of brands. This endpoint returns detailed information about brands, including any associated errors. ### Method GET ### Endpoint /brand ### Parameters #### Query Parameters (No specific query parameters documented for this endpoint in the provided text.) #### Request Body (This endpoint does not appear to accept a request body.) ### Request Example (No request example provided in the input text.) ### Response #### Success Response (200) - **Code** (int64) - Optional. Default is null. - **Message** (string) - Optional. Default is null. - **MessageCn** (string) - Optional. Default is null. - **Errors** ([]ApiErrorStruct) - Optional. Default is null. A list of API errors. - **Data** (BrandGetResponseData) - Optional. Default is null. Contains the brand data. #### Response Example ```json { "Code": 0, "Message": "Success", "MessageCn": "成功", "Errors": null, "Data": { "brands": [ { "id": 1, "name": "Example Brand" } ] } } ``` ``` -------------------------------- ### Install Go SDK using go mod Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/README.md This snippet shows how to add the Tencent Ads Marketing API Go SDK to your project using Go modules. Replace `${VERSION}` with the desired SDK version. This method is recommended for managing dependencies. ```shell go mod edit -require="github.com/tencentad/marketing-api-go-sdk@${VERSION}" go mod download ``` -------------------------------- ### Create Landing Page using Components (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/XijingPageByComponentsApi.md This Go code snippet demonstrates how to use the XijingPageByComponentsAdd method from the TencentAds Go SDK to create a landing page based on provided components. It requires a context and a request object containing the page details. The response will contain information about the created landing page. ```go package main import ( "context" "fmt" "github.com/tencentad/marketing-api-go-sdk/api" ) func main() { // Initialize the API client (replace with your actual client initialization) client := api.NewClient(api.ClientParams{ AccessToken: "YOUR_ACCESS_TOKEN", Nonce: "YOUR_NONCE", Timestamp: 0, // Replace with actual timestamp }) // Define the request data for creating the landing page // This is a placeholder, you need to construct XijingPageByComponentsAddRequest properly data := api.XijingPageByComponentsAddRequest{ // Populate with actual component data and page configurations } // Call the XijingPageByComponentsAdd method response, err := client.XijingPageByComponentsApi.XijingPageByComponentsAdd(context.Background(), &data) if err != nil { fmt.Printf("Error creating landing page: %v\n", err) return } // Process the response fmt.Printf("Landing page created successfully: %+v\n", response) } ``` -------------------------------- ### GET /targetings/get - Get Targetings Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/TargetingsApi.md Retrieve a list of your current targeting options with filtering and pagination capabilities. ```APIDOC ## GET /targetings/get ### Description Retrieves targeting options. ### Method GET ### Endpoint /targetings/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - The account ID for which to retrieve targetings. - **filtering** (optional.Interface of []FilteringStruct) - Optional - Filtering criteria for the targetings. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of items per page. - **fields** (optional.Interface of []string) - Optional - A list of fields to return in the response. ### Request Example ```json { "ctx": "context.Background()", "accountId": 12345, "optional": { "filtering": [], "page": 1, "pageSize": 10, "fields": ["id", "name"] } } ``` ### Response #### Success Response (200) - **TargetingsGetResponse** (TargetingsGetResponse) - The response object containing the list of targeting options. #### Response Example ```json { "data": { "list": [], "pageInfo": {} } } ``` ``` -------------------------------- ### GET /custom_tag_files/get - Get Custom Tag Files Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/CustomTagFilesApi.md Retrieves a list of custom tag files associated with an account. ```APIDOC ## GET /custom_tag_files/get ### Description Retrieves a list of custom tag files associated with an account. ### Method GET ### Endpoint /custom_tag_files/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - Account ID - **filtering** ([]FilteringStruct) - Optional - Filtering criteria - **page** (int64) - Optional - Page number for pagination - **pageSize** (int64) - Optional - Number of items per page - **fields** ([]string) - Optional - List of fields to return ### Request Example ```json { "accountId": 12345, "filtering": [ { "field": "tag_name", "operator": "=", "value": "test_tag" } ], "page": 1, "pageSize": 10, "fields": ["tag_id", "tag_name"] } ``` ### Response #### Success Response (200) - **list** (array) - List of custom tag files - **tagId** (int64) - The ID of the tag file - **tagName** (string) - The name of the tag file - **createTime** (string) - The creation time of the tag file #### Response Example ```json { "code": 0, "message": "Success", "data": { "list": [ { "tagId": 67890, "tagName": "example_tag", "createTime": "2023-10-27T10:00:00Z" } ], "pageInfo": { "page": 1, "pageSize": 10, "totalNum": 1 } } } ``` ``` -------------------------------- ### Download, Installation, and Activation Metrics Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/ReportStruct.md This section details metrics for app downloads, installations, and activations, including counts, rates, and costs associated with each stage. ```APIDOC ## Download, Installation, and Activation Metrics ### Description Metrics related to the user journey from downloading an app to activation, including download counts, installation rates, and activation costs. ### Parameters #### Request Body - **PurchaseMemberCardPv** (int64) - Optional - Page Views for member card purchases. - **PurchaseMemberCardDedupPv** (int64) - Optional - Unique Page Views for member card purchases. - **PurchaseMemberCardDedupCost** (int64) - Optional - Cost for unique member card purchases. - **PurchaseMemberCardDedupRate** (float64) - Optional - Conversion rate for unique member card purchases. - **DownloadCount** (int64) - Optional - Number of app downloads. - **ActivatedRate** (float64) - Optional - Rate of user activations. - **DownloadRate** (float64) - Optional - Download conversion rate. - **DownloadCost** (int64) - Optional - Cost per download. - **AddDesktopPv** (int64) - Optional - Page Views for adding to desktop. - **AddDesktopCost** (int64) - Optional - Cost for adding to desktop. - **InstallCount** (int64) - Optional - Number of app installations. - **InstallRate** (float64) - Optional - Installation conversion rate. - **InstallCost** (int64) - Optional - Cost per installation. - **ActivatedCount** (int64) - Optional - Number of user activations. - **ActivatedCost** (int64) - Optional - Cost per activation. - **ClickActivatedRate** (float64) - Optional - Activation rate attributed by clicks. ### Request Example ```json { "DownloadCount": 5000, "InstallCount": 4000, "ActivatedCount": 3000, "InstallRate": 0.8 } ``` ### Response #### Success Response (200) - **DownloadCount** (int64) - Number of app downloads. - **InstallCount** (int64) - Number of app installations. - **ActivatedCount** (int64) - Number of user activations. - **InstallRate** (float64) - Installation conversion rate. #### Response Example ```json { "DownloadCount": 5000, "InstallCount": 4000, "ActivatedCount": 3000, "InstallRate": 0.8 } ``` ``` -------------------------------- ### POST /product_catalogs/add Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/ProductCatalogsApi.md Creates a new product catalog. Requires authentication and catalog details in the request body. ```APIDOC ## POST /product_catalogs/add ### Description Creates a new product catalog. Requires authentication and catalog details in the request body. ### Method POST ### Endpoint /product_catalogs/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (ProductCatalogsAddRequest) - Required - The details of the product catalog to create. ### Request Example ```json { "example": "Request body for ProductCatalogsAdd" } ``` ### Response #### Success Response (200) - **ProductCatalogsAddResponse** - The response object containing details of the created product catalog. #### Response Example ```json { "example": "Response body for ProductCatalogsAdd" } ``` ``` -------------------------------- ### GET /bidword/get - Get Keywords Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/BidwordApi.md Retrieves keyword information for ad campaigns. This endpoint supports filtering, pagination, and field selection for the returned data. ```APIDOC ## GET /bidword/get ### Description Retrieves keyword information for ad campaigns. ### Method GET ### Endpoint /bidword/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - The account ID for which to retrieve keywords. - **filtering** (optional.Interface of []FilteringStruct) - Optional - Filtering criteria for the keywords. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of keywords per page. - **isDeleted** (optional.Bool) - Optional - Whether to retrieve deleted keywords. - **fields** (optional.Interface of []string) - Optional - A list of fields to return in the response. ### Request Example ```json { "example": "request example for BidwordGet" } ``` ### Response #### Success Response (200) - **BidwordGetResponse** (BidwordGetResponse) - The response object containing the retrieved keyword data. #### Response Example ```json { "example": "response body for BidwordGetResponse" } ``` ``` -------------------------------- ### ProductCatalogsAdd: Create Product Catalog (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/ProductCatalogsApi.md This function creates a product catalog. It requires a context and a ProductCatalogsAddRequest object. The response will be a ProductCatalogsAddResponse. Authentication is handled via accessToken, nonce, and timestamp. ```Go func (a *ProductCatalogsApi) ProductCatalogsAdd(ctx context.Context, data *ProductCatalogsAddRequest) (ProductCatalogsAddResponse, *http.Response, error) { // Implementation details for creating a product catalog // ... return ProductCatalogsAddResponse{}, &http.Response{}, nil } ``` -------------------------------- ### GET /async_tasks/get - Get Async Task Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/AsyncTasksApi.md Retrieves information about existing asynchronous tasks. Allows filtering and pagination for efficient querying. ```APIDOC ## GET /async_tasks/get ### Description Retrieves information about existing asynchronous tasks. Allows filtering and pagination for efficient querying. ### Method GET ### Endpoint /async_tasks/get ### Parameters #### Query Parameters - **accountId** (int64) - Required - The ID of the account associated with the tasks. - **filtering** (optional.Interface of []FilteringStruct) - Optional - Filters for the tasks based on specified criteria. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of items per page. - **fields** (optional.Interface of []string) - Optional - A list of fields to include in the response. ### Response #### Success Response (200) - **data** (AsyncTasksGetResponse) - The response object containing a list of asynchronous tasks matching the query. #### Response Example ```json { "example": "response body for AsyncTasksGetResponse" } ``` ``` -------------------------------- ### Create Dynamic Ad Video (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/DynamicAdVideoApi.md Creates a dynamic ad video for advertising campaigns. Requires a context and a DynamicAdVideoAddRequest object. Returns a DynamicAdVideoAddResponse. ```go func (a *DynamicAdVideoApiService) DynamicAdVideoAdd(ctx context.Context, data *DynamicAdVideoAddRequest) (*DynamicAdVideoAddResponse, error) { // Implementation details... return nil, nil } ``` -------------------------------- ### GET /split_tests/get - Get Split Tests Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/SplitTestsApi.md Retrieves information about existing split tests. This endpoint is useful for monitoring and analyzing ongoing or completed experiments. ```APIDOC ## GET /split_tests/get ### Description Retrieves information about existing split tests. ### Method GET ### Endpoint /split_tests/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - The ID of the account associated with the split tests. - **filtering** (optional.Interface of []FilteringStruct) - Optional - Criteria for filtering the split tests. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of results per page. - **fields** (optional.Interface of []string) - Optional - A list of fields to include in the response. ### Request Example ```json { "accountId": 12345, "filtering": [ { "field": "status", "operator": "EQUALS", "value": "ACTIVE" } ], "page": 1, "pageSize": 10, "fields": ["id", "name", "status"] } ``` ### Response #### Success Response (200) - **SplitTestsGetResponse** - Description of the response payload containing the requested split test information. #### Response Example ```json { "message": "This is a placeholder for the SplitTestsGetResponse payload." } ``` ``` -------------------------------- ### Initiate Fund Transfer (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/FundTransferApi.md Demonstrates how to initiate a fund transfer between an agent and a sub-client using the TencentAds Go SDK. This function requires a context, authentication headers, and transfer details. ```Go package main import ( "context" "github.com/tencentad/marketing-api-go-sdk/api" "github.com/tencentad/marketing-api-go-sdk/model" ) func main() { // Initialize the API client (replace with your actual client initialization) // client, err := api.NewClient(&api.Config{AccessToken: "YOUR_ACCESS_TOKEN", ...}) // if err != nil { // panic(err) // } // Example data for FundTransferAddRequest // transferData := &model.FundTransferAddRequest{ // FromAccountId: model.StringPtr("12345"), // ToAccountId: model.StringPtr("67890"), // Amount: model.Float64Ptr(100.50), // TransferType: model.StringPtr("AGENT_TO_SUBCLIENT"), // } // ctx := context.Background() // Call the FundTransferAdd method // resp, err := client.FundTransferApi.FundTransferAdd(ctx, transferData) // if err != nil { // panic(err) // } // Process the response // fmt.Printf("%+v\n", resp) } ``` -------------------------------- ### GET /dynamic_ad_images/get - Get Dynamic Ad Images Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/DynamicAdImagesApi.md Retrieves information about dynamic ad images. Supports filtering, pagination, and field selection for targeted results. ```APIDOC ## GET /dynamic_ad_images/get ### Description Retrieves information about dynamic ad images. Supports filtering, pagination, and field selection for targeted results. ### Method GET ### Endpoint /dynamic_ad_images/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - The ID of the account. - **filtering** ([]FilteringStruct) - Optional - Filters for the dynamic ad images. - **page** (int64) - Optional - The page number for pagination. - **pageSize** (int64) - Optional - The number of items per page. - **fields** ([]string) - Optional - A list of fields to return in the response. ### Request Example ```json { "accountId": 12345, "filtering": [...], "page": 1, "pageSize": 10, "fields": ["image_id", "url"] } ``` ### Response #### Success Response (200) - **data** (DynamicAdImagesGetResponse) - The response object containing dynamic ad image information. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### Create Short Play Selling Strategy (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/LandingPageSellStrategyApi.md This function creates a selling strategy for short plays. It requires a context and a LandingPageSellStrategyAddRequest object as input. The response includes the created strategy details. Authentication is handled via accessToken, nonce, and timestamp. ```Go func LandingPageSellStrategyAdd(ctx context.Context, data LandingPageSellStrategyAddRequest) LandingPageSellStrategyAddResponse ``` -------------------------------- ### Create Landing Page using Components (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/XijingPageByComponentsApi.md This Go function, XijingPageByComponentsAdd, is used to create a landing page based on provided components. It requires a context and a XijingPageByComponentsAddRequest object. The response will be a XijingPageByComponentsAddResponse object. It utilizes authentication via accessToken, nonce, and timestamp. ```go import ( "context" "github.com/tencentad/marketing-api-go-sdk/api/v3/model" ) // Assuming you have initialized the API client and have the necessary authentication details // var apiClient *api.APIClient // var ctx context.Context func ExampleXijingPageByComponentsAdd(ctx context.Context, data model.XijingPageByComponentsAddRequest) (*model.XijingPageByComponentsAddResponse, error) { // ... initialization of apiClient ... resp, _, err := apiClient.XijingPageByComponentsApi.XijingPageByComponentsAdd(ctx, data) if err != nil { return nil, err } return resp, nil } ``` -------------------------------- ### GET /local_store_packages/get - Get Local Store Package Information Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/LocalStorePackagesApi.md Retrieves information about local store packages. Requires accountId and optional parameters like filtering, pagination, and fields. ```APIDOC ## GET /local_store_packages/get ### Description Retrieves information about local store packages. ### Method GET ### Endpoint /local_store_packages/get ### Parameters #### Path Parameters None #### Query Parameters - **ctx** (context.Context) - Required - context for authentication, logging, cancellation, deadlines, tracing, etc. - **accountId** (int64) - Required - The ID of the account. - **filtering** (optional.Interface of []FilteringStruct) - Optional - Filters for the query. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of items per page. - **fields** (optional.Interface of []string) - Optional - A list of fields to return in the response. ### Request Example ```json { "ctx": "", "accountId": 12345, "filtering": [ { "field": "status", "operator": "EQUALS", "value": "active" } ], "page": 1, "pageSize": 10, "fields": ["package_id", "name"] } ``` ### Response #### Success Response (200) - **response** (LocalStorePackagesGetResponse) - The response object containing the local store package information. #### Response Example ```json { "response": "" } ``` ``` -------------------------------- ### Get Marketing Target Assets List (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/MarketingTargetAssetsApi.md Retrieves a list of marketing target assets. Requires context and marketingTargetType. Optional parameters include account ID, filtering, pagination, and fields. Returns a MarketingTargetAssetsGetResponse. Uses GET request. ```go func (api *MarketingTargetAssetsApi) MarketingTargetAssetsGet(ctx context.Context, marketingTargetType string, optional *MarketingTargetAssetsApiMarketingTargetAssetsGetOpts) (*MarketingTargetAssetsGetResponse, error) { // Implementation details... return nil, nil } ``` -------------------------------- ### Create Product Catalog (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/ProductCatalogsApi.md The ProductCatalogsAdd method creates a new product catalog. It requires a context and a ProductCatalogsAddRequest object containing catalog details. The response includes information about the newly created catalog. This function is part of the TencentAds Go SDK. ```Go package main import ( "context" "fmt" "github.com/tencentad/marketing-api-go-sdk/api" ) func main() { // Assuming you have initialized the API client // apiClient := api.NewClient(&api.Config{... ctx := context.Background() // Replace with your actual request data // data := &api.ProductCatalogsAddRequest{...} // resp, err := apiClient.ProductCatalogsApi.ProductCatalogsAdd(ctx, data) // if err != nil { // fmt.Printf("Error creating product catalog: %v\n", err) // return // } // fmt.Printf("Product catalog created successfully: %+v\n", resp) } ``` -------------------------------- ### POST /dynamic_creative_previews/add Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/DynamicCreativePreviewsApi.md Creates a dynamic creative preview. This endpoint allows for online previewing of creative bindings. ```APIDOC ## POST /dynamic_creative_previews/add ### Description Creates a dynamic creative preview. This endpoint allows for online previewing of creative bindings. ### Method POST ### Endpoint /dynamic_creative_previews/add ### Parameters #### Request Body - **data** (DynamicCreativePreviewsAddRequest) - Required - Dynamic creative preview request object. ### Request Example ```json { "data": { ... } } ``` ### Response #### Success Response (200) - **DynamicCreativePreviewsAddResponse** (object) - The response object containing details of the created dynamic creative preview. #### Response Example ```json { "code": 0, "message": "OK", "data": { ... } } ``` ``` -------------------------------- ### Create Property Data Source (Go) Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/PropertySetsApi.md The PropertySetsAdd function creates a new property data source. It requires a context and a PropertySetsAddRequest object containing the data for the new source. The response will be a PropertySetsAddResponse object. ```go func (a *PropertySetsApi) PropertySetsAdd(ctx context.Context, data PropertySetsAddRequest) (*PropertySetsAddResponse, error) { // Implementation details... return nil, nil } ``` -------------------------------- ### LeadsCallVirtualNumberGetRequest Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/LeadsCallVirtualNumberGetRequest.md Represents a request to get lead call virtual numbers. ```APIDOC ## LeadsCallVirtualNumberGetRequest ### Description Represents a request to retrieve virtual number information for leads, potentially for call tracking or management. ### Method GET ### Endpoint /leads/call/virtualNumber/get ### Parameters #### Query Parameters - **AccountId** (int64) - Optional - The account ID associated with the request. - **LeadsId** (int64) - Optional - The ID of the lead for which to retrieve virtual number information. - **Caller** (string) - Optional - The caller's phone number. - **Callee** (string) - Optional - The callee's phone number. - **RequestId** (string) - Optional - A unique identifier for the request, used for tracking and deduplication. ### Request Example ```json { "AccountId": 12345, "LeadsId": 67890, "Caller": "+15551234567", "Callee": "+15559876543", "RequestId": "unique-request-id-123" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the virtual number details. - **virtual_number** (string) - The virtual number assigned. - **expiration_time** (string) - The expiration time of the virtual number. #### Response Example ```json { "code": 0, "message": "OK", "data": { "virtual_number": "+18005551212", "expiration_time": "2023-10-27T10:00:00Z" } } ``` ``` -------------------------------- ### TargetingTagReportsGetResponse Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/TargetingTagReportsGetResponse.md Defines the structure for the response of a targeting tag reports Get request. ```APIDOC ## TargetingTagReportsGetResponse ### Description Represents the response object for retrieving targeting tag reports. It includes status codes, messages, and detailed report data. ### Method Not Applicable (Response Structure) ### Endpoint Not Applicable (Response Structure) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Code** (int64) - The status code of the API request. Optional, defaults to null. - **Message** (string) - The success or error message in English. Optional, defaults to null. - **MessageCn** (string) - The success or error message in Chinese. Optional, defaults to null. - **Errors** ([]ApiErrorStruct) - A list of API errors if any occurred. Optional, defaults to null. - **Data** (TargetingTagReportsGetResponseData) - The main data payload containing the targeting tag reports. Optional, defaults to null. #### Response Example ```json { "Code": 0, "Message": "Success", "MessageCn": "成功", "Errors": null, "Data": { "...": "TargetingTagReportsGetResponseData details..." } } ``` ``` -------------------------------- ### WalletTransferAdd Go SDK Example Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/WalletTransferApi.md This Go code snippet demonstrates how to initiate a transfer between an agent and a wallet using the Tencent Ads Marketing API. It requires a context and a WalletTransferAddRequest object, and returns a WalletTransferAddResponse. Ensure proper authentication headers like accessToken, nonce, and timestamp are set. ```go package main import ( "context" "fmt" "github.com/tencentad/marketing-api-go-sdk/api" "github.com/tencentad/marketing-api-go-sdk/model" ) func main() { // Initialize the API client (replace with your actual client initialization) client := api.NewClient(&api.Config{ AccessToken: "YOUR_ACCESS_TOKEN", Nonce: "YOUR_NONCE", Timestamp: "YOUR_TIMESTAMP", // Other configurations... }) // Prepare the request data data := &model.WalletTransferAddRequest{ // Populate with your transfer details // Example: // FromAccountId: pulumi.StringPtr("12345"), // ToAccountId: pulumi.StringPtr("67890"), // Amount: pulumi.IntPtr(100), // CurrencyType: "CNY", } // Call the WalletTransferAdd method resp, err := client.WalletTransferApi.WalletTransferAdd(context.Background(), data) // Handle the response if err != nil { fmt.Printf("Error initiating transfer: %v\n", err) return } // Process the successful response if resp.Code == "OK" { fmt.Println("Transfer initiated successfully:") // Access response data as needed // fmt.Printf("%+v\n", resp.Data) } else { fmt.Printf("Transfer failed: %s\n", resp.Message) } } ``` -------------------------------- ### POST /product_catalogs/add Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/ProductCatalogsApi.md Creates a new product catalog. This endpoint requires authentication and accepts product catalog details in the request body. ```APIDOC ## POST /product_catalogs/add ### Description Creates a new product catalog. ### Method POST ### Endpoint /product_catalogs/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (ProductCatalogsAddRequest) - Required - Details of the product catalog to be created. ### Request Example ```json { "data": { "catalog_name": "Example Catalog", "product_list_url": "http://example.com/products.csv" } } ``` ### Response #### Success Response (200) - **ProductCatalogsAddResponse** (object) - The response object containing details of the created product catalog. #### Response Example ```json { "code": 0, "message": "Success", "data": { "catalog_id": "12345" } } ``` ``` -------------------------------- ### DynamicAdVideoTemplatesGetListStruct Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/DynamicAdVideoTemplatesGetListStruct.md Represents the structure for getting a list of dynamic ad video templates. ```APIDOC ## DynamicAdVideoTemplatesGetListStruct ### Description This structure defines the properties available when requesting a list of dynamic ad video templates. It includes various fields for template identification, content URLs, duration constraints, and associated product fields. ### Method GET ### Endpoint /ad/campaigns/dynamic_creative/video_templates/get ### Parameters #### Query Parameters - **account_id** (int64) - Required - Account ID - **filtering** (DynamicAdVideoTemplatesGetListStruct) - Optional - Filter conditions - **page_info** (PageInfo) - Optional - Pagination information #### Request Body (Not applicable for GET requests, parameters are typically in query or path) ### Request Example (Not applicable for this structure definition, refer to specific endpoint examples for full request structure) ### Response #### Success Response (200) - **list** ([]DynamicAdVideoTemplatesGetListStruct) - List of dynamic ad video templates - **page_info** (PageInfo) - Pagination information #### Response Example ```json { "list": [ { "template_id": 12345, "template_name": "Summer Sale Video", "template_type": "VIDEO_TYPE_BASIC", "product_catalog_id": 67890, "adcreative_template_id": 54321, "cover_image_url": "http://example.com/cover.jpg", "intro_video_url": "http://example.com/intro.mp4", "delivery_video_url": "http://example.com/delivery.mp4", "support_channel": true, "coverage": 0.85, "min_video_duration": 5.0, "max_video_duration": 30.0, "video_product_fields": ["title", "price"], "image_product_fields": ["image"], "extra": {}, "sub_template_list": [] } ], "page_info": { "page": 1, "page_size": 20, "total_num": 100, "total_page": 5 } } ``` ### Model Properties (DynamicAdVideoTemplatesGetListStruct) - **template_id** (int64) - Optional - Default: null - **template_name** (string) - Optional - Default: null - **template_type** (VideoTemplateType) - Optional - Default: null - **product_catalog_id** (int64) - Optional - Default: null - **adcreative_template_id** (int64) - Optional - Default: null - **cover_image_url** (string) - Optional - Default: null - **intro_video_url** (string) - Optional - Default: null - **delivery_video_url** (string) - Optional - Default: null - **support_channel** (bool) - Optional - Default: null - **coverage** (float64) - Optional - Default: null - **min_video_duration** (float64) - Optional - Default: null - **max_video_duration** (float64) - Optional - Default: null - **video_product_fields** ([]string) - Optional - Default: null - **image_product_fields** ([]string) - Optional - Default: null - **extra** (Extra) - Optional - Default: null - **sub_template_list** ([]SubTemplateStruct) - Optional - Default: null ``` -------------------------------- ### Get Playable Pages using TencentAds Go SDK Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/PlayablePagesApi.md The PlayablePagesGet method retrieves existing playable pages. It requires an account ID and accepts optional parameters for filtering, pagination (page and pageSize), and specifying returned fields. The API request is a GET request with 'text/plain' content type. ```go import ( "context" "github.com/tencentad/marketing-api-go-sdk/api" "github.com/tencentad/marketing-api-go-sdk/api/optional" ) func main() { // Assuming apiClient is initialized // apiClient, _ := api.NewClient(nil) var ctx context.Context accountId := int64(12345) // Example with optional parameters op := &api.PlayablePagesApiPlayablePagesGetOpts{ Page: optional.Int64(1), PageSize: optional.Int64(10), Fields: optional.NewInterfaceSlice([]string{"playable_page_id", "playable_page_name"}), } // PlayablePagesGetResponse, err := apiClient.PlayablePagesApi.PlayablePagesGet(ctx, accountId, op) // Handle response and error } ``` -------------------------------- ### POST /creative_components/add Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/CreativeComponentsApi.md Creates a creative component. Requires authentication and provides options for content type and response format. ```APIDOC ## POST /creative_components/add ### Description Creates a creative component. ### Method POST ### Endpoint /creative_components/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (CreativeComponentsAddRequest) - Required - The request body for creating a creative component. ### Request Example ```json { "example": "{\"component_name\": \"example_component\", \"component_type\": \"TEXT\", \"content\": \"This is an example component.\"}" } ``` ### Response #### Success Response (200) - **data** (CreativeComponentsAddResponse) - The response object containing details of the created creative component. #### Response Example ```json { "example": "{\"component_id\": \"12345\", \"message\": \"Creative component created successfully.\"}" } ``` ``` -------------------------------- ### WechatChannelsAdAccountValidationGet Go SDK Example Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/v3/WechatChannelsAdAccountValidationApi.md Example of using the WechatChannelsAdAccountValidationGet method from the TencentAds Go SDK to perform video channel account opening verification. This function requires a context, account ID, and can accept optional parameters for nickname, head image ID, WeChat channels account ID, and a list of fields to return. ```Go import ( "context" "github.com/tencentad/marketing-api-go-sdk/api" "github.com/tencentad/marketing-api-go-sdk/api/model" "github.com/tencentad/marketing-api-go-sdk/api/util/optional" ) func ExampleWechatChannelsAdAccountValidationApi_WechatChannelsAdAccountValidationGet(ctx context.Context, api *api.SDKClient, accountId int64) (*model.WechatChannelsAdAccountValidationGetResponse, error) { // Optional parameters setup opts := &api.WechatChannelsAdAccountValidationApiWechatChannelsAdAccountValidationGetOpts{} // Example of setting an optional parameter // opts.Nickname = optional.NewString("example_nickname") resp, err := api.WechatChannelsAdAccountValidationApi.WechatChannelsAdAccountValidationGet(ctx, accountId, opts) if err != nil { return nil, err } return resp, nil } ``` -------------------------------- ### POST /xijing_page_by_components/add Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/XijingPageByComponentsApi.md 蹊径-基于组件创建落地页 (Xijing - Create Landing Page Based on Components) ```APIDOC ## POST /xijing_page_by_components/add ### Description 蹊径-基于组件创建落地页 (Xijing - Create Landing Page Based on Components). ### Method POST ### Endpoint /xijing_page_by_components/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (XijingPageByComponentsAddRequest) - Required - The request body containing details for creating the landing page. ### Request Example ```json { "data": { ... } } ``` ### Response #### Success Response (200) - **XijingPageByComponentsAddResponse** - The response object containing details of the created landing page. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### Product Series Management API Source: https://github.com/tencentad/marketing-api-go-sdk/blob/master/docs/ProductSeriesApi.md Endpoints for creating and retrieving product series. All URIs are relative to https://sandbox-api.e.qq.com/v1.3. ```APIDOC ## POST /product_series/add ### Description Creates a product series. ### Method POST ### Endpoint /product_series/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (ProductSeriesAddRequest) - Required - The request body for creating a product series. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **ProductSeriesAddResponse** (ProductSeriesAddResponse) - The response object containing the result of the product series creation. #### Response Example ```json { "example": "response body" } ``` ``` ```APIDOC ## GET /product_series/get ### Description Retrieves product series. ### Method GET ### Endpoint /product_series/get ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (int64) - Required - The account ID. - **catalogId** (int64) - Required - The catalog ID. - **filtering** (optional.Interface of []ProductSeriesSearchFilteringStruct) - Optional - Filters for product series. - **page** (optional.Int64) - Optional - The page number for pagination. - **pageSize** (optional.Int64) - Optional - The number of items per page. - **fields** (optional.Interface of []string) - Optional - A list of fields to return. #### Request Body None ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **ProductSeriesGetResponse** (ProductSeriesGetResponse) - The response object containing the retrieved product series. #### Response Example ```json { "example": "response body" } ``` ```