Skip to content

Latest commit

 

History

History
281 lines (213 loc) · 11.9 KB

FileApi.md

File metadata and controls

281 lines (213 loc) · 11.9 KB

FileApi

All URIs are relative to https://business-api.tiktok.com

Method HTTP request Description
adImageInfo GET /open_api/v1.3/file/image/ad/info/ The function is used to obtain the information of images from the Asset Library. File image info
adImageUpload POST /open_api/v1.3/file/image/ad/upload/ The function is used to to upload pictures to the Asset Library and use the obtained image ID for creating ads. File image Upload
adVideoInfo GET /open_api/v1.3/file/video/ad/info/ The function is used to get the information about a list of videos File Video Ad Info from the Asset Library.
adVideoSearch GET /open_api/v1.3/file/video/ad/search/ The function is used to to search for video creatives in the Asset Library of an ad account. [File Video Search](to search for video creatives in the Asset Library of an ad account.) Library.
adVideoUpload POST /open_api/v1.3/file/video/ad/upload/ The function is used to upload a video to the Asset Library and use the obtained video ID for creating ads. File Video Upload

adImageInfo

Response adImageInfo(advertiserId, imageIds, accessToken)

The function is used to obtain the information of images from the Asset Library. File image info

Example

// Import classes:
//import business_api.ApiException;
//import io.swagger.client.api.FileApi;


FileApi apiInstance = new FileApi();
String advertiserId = "advertiserId_example"; // String | Advertiser ID.
List<String> imageIds = Arrays.asList("imageIds_example"); // List<String> | Image ID list. Up to 100 IDs per request.
String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
try {
    Response result = apiInstance.adImageInfo(advertiserId, imageIds, accessToken);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FileApi#adImageInfo");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
advertiserId String Advertiser ID. [required]
imageIds List<String> Image ID list. Up to 100 IDs per request. [required]
accessToken String Authorized access token. For details, see Authentication. [required]

Return type

Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

adImageUpload

Response adImageUpload(accessToken, advertiserId, fileId, fileName, imageFile, imageSignature, imageUrl, uploadType)

The function is used to to upload pictures to the Asset Library and use the obtained image ID for creating ads. File image Upload

Example

// Import classes:
//import business_api.ApiException;
//import io.swagger.client.api.FileApi;


FileApi apiInstance = new FileApi();
String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
String advertiserId = "advertiserId_example"; // String | 
String fileId = "fileId_example"; // String | 
String fileName = "fileName_example"; // String | 
File imageFile = new File("imageFile_example"); // File | 
String imageSignature = "imageSignature_example"; // String | 
String imageUrl = "imageUrl_example"; // String | 
String uploadType = "uploadType_example"; // String | 
try {
    Response result = apiInstance.adImageUpload(accessToken, advertiserId, fileId, fileName, imageFile, imageSignature, imageUrl, uploadType);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FileApi#adImageUpload");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
accessToken String Authorized access token. For details, see Authentication. [required]
advertiserId String [optional]
fileId String [optional]
fileName String [optional]
imageFile File [optional]
imageSignature String [optional]
imageUrl String [optional]
uploadType String [optional]

Return type

Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

adVideoInfo

Response adVideoInfo(advertiserId, videoIds, accessToken)

The function is used to get the information about a list of videos File Video Ad Info from the Asset Library.

Example

// Import classes:
//import business_api.ApiException;
//import io.swagger.client.api.FileApi;


FileApi apiInstance = new FileApi();
String advertiserId = "advertiserId_example"; // String | Advertiser ID.
List<String> videoIds = Arrays.asList("videoIds_example"); // List<String> | Video ID list. Up to 60 IDs per request.
String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
try {
    Response result = apiInstance.adVideoInfo(advertiserId, videoIds, accessToken);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FileApi#adVideoInfo");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
advertiserId String Advertiser ID. [required]
videoIds List<String> Video ID list. Up to 60 IDs per request. [required]
accessToken String Authorized access token. For details, see Authentication. [required]

Return type

Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

adVideoSearch

Response adVideoSearch(advertiserId, accessToken, filtering, page, pageSize)

The function is used to to search for video creatives in the Asset Library of an ad account. [File Video Search](to search for video creatives in the Asset Library of an ad account.) Library.

Example

// Import classes:
//import business_api.ApiException;
//import io.swagger.client.api.FileApi;


FileApi apiInstance = new FileApi();
String advertiserId = "advertiserId_example"; // String | Video ID list. Up to 60 IDs per request.
String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
FilteringVideoAdSearch filtering = new FilteringVideoAdSearch(); // FilteringVideoAdSearch | Filters on the data. This parameter is an array of filter objects.
Integer page = 56; // Integer | Current page number. Default value: 1. Value range: ≥ 1.
Integer pageSize = 56; // Integer | Page size. Default value: 20. Value range: 1-100.
try {
    Response result = apiInstance.adVideoSearch(advertiserId, accessToken, filtering, page, pageSize);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FileApi#adVideoSearch");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
advertiserId String Video ID list. Up to 60 IDs per request. [required]
accessToken String Authorized access token. For details, see Authentication. [required]
filtering FilteringVideoAdSearch Filters on the data. This parameter is an array of filter objects. [optional]
page Integer Current page number. Default value: 1. Value range: ≥ 1. [optional]
pageSize Integer Page size. Default value: 20. Value range: 1-100. [optional]

Return type

Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

adVideoUpload

Response adVideoUpload(accessToken, advertiserId, autoBindEnabled, autoFixEnabled, fileId, fileName, flawDetect, isThirdParty, uploadType, videoFile, videoId, videoSignature, videoUrl)

The function is used to upload a video to the Asset Library and use the obtained video ID for creating ads. File Video Upload

Example

// Import classes:
//import business_api.ApiException;
//import io.swagger.client.api.FileApi;


FileApi apiInstance = new FileApi();
String accessToken = "accessToken_example"; // String | Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162).
String advertiserId = "advertiserId_example"; // String | 
Boolean autoBindEnabled = true; // Boolean | 
Boolean autoFixEnabled = true; // Boolean | 
String fileId = "fileId_example"; // String | 
String fileName = "fileName_example"; // String | 
Boolean flawDetect = true; // Boolean | 
Boolean isThirdParty = true; // Boolean | 
String uploadType = "uploadType_example"; // String | 
File videoFile = new File("videoFile_example"); // File | 
String videoId = "videoId_example"; // String | 
String videoSignature = "videoSignature_example"; // String | 
String videoUrl = "videoUrl_example"; // String | 
try {
    Response result = apiInstance.adVideoUpload(accessToken, advertiserId, autoBindEnabled, autoFixEnabled, fileId, fileName, flawDetect, isThirdParty, uploadType, videoFile, videoId, videoSignature, videoUrl);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FileApi#adVideoUpload");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
accessToken String Authorized access token. For details, see Authentication. [required]
advertiserId String [optional]
autoBindEnabled Boolean [optional]
autoFixEnabled Boolean [optional]
fileId String [optional]
fileName String [optional]
flawDetect Boolean [optional]
isThirdParty Boolean [optional]
uploadType String [optional]
videoFile File [optional]
videoId String [optional]
videoSignature String [optional]
videoUrl String [optional]

Return type

Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json