用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
## 创建媒体任务 > 文档 https://cloud.tencent.com/document/product/460/48233 > TemplateId参考【数据万象-》储存桶-》模板】 > QueueId队列,参考【数据万象-》储存桶-》任务】 > signRequest 签名请求参考:https://cloud.tencent.com/document/product/436/7778 ```php $data = "<Request> <Tag>Transcode</Tag> <Input> <Object>{输入对象}</Object> </Input> <Operation> <TemplateId>t03ed6a4e1b374429eadec266bd6859347</TemplateId> <Output> <Region>{地区代码}</Region> <Bucket>{储存桶}</Bucket> <Object>{输出路径,不含后缀名}</Object> </Output> </Operation> <QueueId>{队列id}</QueueId> <CallBack>{回调,可空}</CallBack> </Request>"; $http = new \GuzzleHttp\Client(['base_uri'=>'https://{储存桶}.ci.{地区代码}.myqcloud.com/', 'debug'=>true]); $sg = new CosSignatureUtil('{accessKey}', '{secretKey}'); $req = new \GuzzleHttp\Psr7\Request('POST', '/jobs', ['Content-Type' => 'application/xml'], $data); $req = $sg->signRequest($req); $resp = $http->send($req); $status = $resp->getBody(); if ($resp->getStatusCode() == 200) { echo '创建转码任务成功'; } ```