TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
MiniappDistributionMaterialCreateRequest req = new MiniappDistributionMaterialCreateRequest();
MiniappDistributionMaterialCreateRequest.MiniAppEntranceMaterialBizOpenDTO obj1 = new MiniappDistributionMaterialCreateRequest.MiniAppEntranceMaterialBizOpenDTO();
obj1.setDataStr("{\"a\":\"b\"}");
obj1.setPParamsValueStr("{\"c\":\"c1\"}");
obj1.setPath("pages/index");
obj1.setQParamsValueStr("{\"d\":\"d1\"}");
obj1.setAppId(300002222222L);
obj1.setCardId(22L);
obj1.setName("测试默认素材");
obj1.setSceneId(16L);
req.setMaterialRequest(obj1);
MiniappDistributionMaterialCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
MiniappDistributionMaterialCreateRequest req = new MiniappDistributionMaterialCreateRequest();
MiniappDistributionMaterialCreateRequest.MiniAppEntranceMaterialBizOpenDTODomain obj1 = new MiniappDistributionMaterialCreateRequest.MiniAppEntranceMaterialBizOpenDTODomain();
obj1.DataStr = "{\"a\":\"b\"}";
obj1.PParamsValueStr = "{\"c\":\"c1\"}";
obj1.Path = "pages/index";
obj1.QParamsValueStr = "{\"d\":\"d1\"}";
obj1.AppId = 300002222222L;
obj1.CardId = 22L;
obj1.Name = "测试默认素材";
obj1.SceneId = 16L;
req.MaterialRequest_ = obj1;
MiniappDistributionMaterialCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new MiniappDistributionMaterialCreateRequest;
$material_request = new MiniAppEntranceMaterialBizOpenDTO;
$material_request->data_str="{\"a\":\"b\"}";
$material_request->p_params_value_str="{\"c\":\"c1\"}";
$material_request->path="pages/index";
$material_request->q_params_value_str="{\"d\":\"d1\"}";
$material_request->app_id="300002222222";
$material_request->card_id="22";
$material_request->name="测试默认素材";
$material_request->scene_id="16";
$req->setMaterialRequest(json_encode($material_request));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.miniapp.distribution.material.create' \
-d 'partner_id=apidoc' \
-d 'session=882e139b-5d22-4396-a27b-c53369133d1e' \
-d 'sign=C88095E427874728CE31ECC9E1E1154C' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-14+08%3A04%3A33' \
-d 'v=2.0' \
-d 'material_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.MiniappDistributionMaterialCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.material_request=""
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.miniapp.distribution.material.create");
add_param(pRequest,"material_request","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.miniapp.distribution.material.create', {
'material_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})