文档中心 > API类目 > 客户运营平台API

taobao.opencrm.system.template.get (官方模版获取接口)

官方模版获取接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
channel String 必须 card_smg 渠道code,短信渠道有card_smg卡片短信、digital_smg数字短信、text_smg文本短信
channel_type String 可选 5 渠道下的模版类型code,例如卡片短信下的单图文模版,不传则获取改渠道下的所有系统模版

响应参数

名称 类型 示例值 描述
result Result 统一返回对象 统一返回对象
  • └ code
  • String
  • 1001
  • 错误码
  • └ msg
  • String
  • 未知错误
  • 错误描述
  • result
  • GeneralMsgTemplateVO []
  • 1239843
  • 查询结果
  • └ channel
  • String
  • card_smg
  • 渠道code
  • └ channel_type
  • String
  • 5
  • 渠道下模版类型code
  • └ construct
  • String
  • [{"materialCode":"item","canBeAlgoRec":true,"page":1,"position":1},{"materialCode":"text","page":1,"position":2}]
  • 模版构造
  • └ channel_format_rules
  • String
  • 图片:商品16:9主图 标题:商品标题,上限17字 正文:自定义文本内容,上限69字 按钮:按钮标题为查看详情,默认跳转商品详情页,可自定义替换跳转地址,占位符key:mediaSmsUrl
  • 渠道物料内容格式规范,纯文本
  • └ template_name
  • String
  • 单图文卡片短信模版
  • 模版名称
  • └ channel_const
  • String
  • 1
  • 预留参数,渠道模版构造
  • └ biz_scene
  • String
  • 1
  • 预留参数,业务场景
  • └ biz_scene_group
  • String
  • 1
  • 预留参数,业务场景组

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
OpencrmSystemTemplateGetRequest req = new OpencrmSystemTemplateGetRequest();
req.setChannel("card_smg");
req.setChannelType("5");
OpencrmSystemTemplateGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<opencrm_system_template_get_response>
    <result>
        <code>1001</code>
        <msg>未知错误</msg>
        <result>
            <general_msg_template_v_o>
                <channel>card_smg</channel>
                <channel_type>5</channel_type>
                <construct>[{&quot;materialCode&quot;:&quot;item&quot;,&quot;canBeAlgoRec&quot;:true,&quot;page&quot;:1,&quot;position&quot;:1},{&quot;materialCode&quot;:&quot;text&quot;,&quot;page&quot;:1,&quot;position&quot;:2}]</construct>
                <channel_format_rules>图片:商品16:9主图 标题:商品标题,上限17字 正文:自定义文本内容,上限69字 按钮:按钮标题为查看详情,默认跳转商品详情页,可自定义替换跳转地址,占位符key:mediaSmsUrl</channel_format_rules>
                <template_name>单图文卡片短信模版</template_name>
                <channel_const>1</channel_const>
                <biz_scene>1</biz_scene>
                <biz_scene_group>1</biz_scene_group>
            </general_msg_template_v_o>
        </result>
    </result>
</opencrm_system_template_get_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部