本文为您提供了服务端 Java SDK 的媒资管理模块相关的 API 调用示例。主要包含:获取媒资信息。
使用前请先完成初始化,参考 初始化
接口请求参数和返回参数详见 OpenAPI:获取媒资信息
import com.kuaishou.vod.core.Credential;
import com.kuaishou.vod.core.HttpProfile;
import com.kuaishou.vod.openapi.client.VodClient;
import com.kuaishou.vod.openapi.model.request.vod.DescribeMediaInfoRequest;
import com.kuaishou.vod.openapi.model.response.vod.DescribeMediaInfoResponse;
public class Demo {
public static void main(String[] args) throws Exception {
HttpProfile profile = HttpProfile.getDefault();
Credential credential = new Credential(<分配的access_key_id>, <分配的secret_key>);
VodClient client = new VodClient(profile, credential);
DescribeMediaInfoRequest request = new DescribeMediaInfoRequest();
request.MediaId = "媒资 ID";
DescribeMediaInfoResponse response = client.describeMediaInfo(request);
System.out.println("response=" + response.getResponseMeta().getRequestId());
}
}