文档中心 > API类目 > 天猫精灵开放API

alibaba.ailabs.iot.saas.message.template.get (获取模板详情信息)

获取iot模板详情信息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
open_template_id String 可选 4324are 对外消息模板唯一id(业务)
account_id Number 可选 4234 平台账号id
application_id String 可选 areq2323 应用id

响应参数

名称 类型 示例值 描述
result BaseResult 返回包装类
  • └ ret_code
  • Number
  • 返回码
  • ret_value
  • MessageTemplateDetailDto
  • 返回值
  • app_box_template
  • AppBoxTemplate
  • APP消息盒子消息模板
  • app_message
  • AppMessage
  • APP消息内容
  • └ title
  • String
  • 标题
  • └ content
  • String
  • 内容
  • fatigue_rule
  • FatigueRule
  • 疲劳度控制
  • └ type
  • String
  • EXPRESSION
  • EXPRESSION:单日允许次数、NUMERIC:间隔时间段允许推送次数
  • └ frequency
  • String
  • 1
  • 推送次数,当type为EXPRESSION时,一天内允许推送次数;当type为NUMERIC时,间隔时间段允许推送次数
  • └ interval
  • String
  • 3
  • 当type为NUMERIC时有效,指定时间段「时间段」推送一条
  • └ unit_type
  • String
  • SECONDS
  • 当type为NUMERIC时有效,指定时间段「单位」推送一条。MILLSECONDS:毫秒,SECONDS:秒,MINUTES:分钟,HOURS:小时,DAY:天
  • app_desk_template
  • AppDeskTemplate
  • APP弹窗消息模板
  • app_message
  • AppMessage
  • APP消息内容
  • └ title
  • String
  • 标题
  • └ content
  • String
  • 内容
  • fatigue_rule
  • FatigueRule
  • 疲劳度控制
  • └ type
  • String
  • EXPRESSION:单日允许次数、NUMERIC:间隔时间段允许推送次数
  • └ frequency
  • String
  • 推送次数,当type为EXPRESSION时,一天内允许推送次数;当type为NUMERIC时,间隔时间段允许推送次数
  • └ interval
  • String
  • 当type为NUMERIC时有效,指定时间段「时间段」推送一条
  • └ unit_type
  • String
  • 当type为NUMERIC时有效,指定时间段「单位」推送一条。MILLSECONDS:毫秒,SECONDS:秒,MINUTES:分钟,HOURS:小时,DAY:天
  • push_period_list
  • PushPeriod []
  • 允许推送时间段
  • └ start_time
  • String
  • 06:00:00
  • 开始时间
  • └ end_time
  • String
  • 14:00:00
  • 截止时间
  • tts_immediate_template
  • TtsImmediateTemplate
  • TTS弹窗消息模板
  • └ tts_message
  • String
  • TTS内容
  • fatigue_rule
  • FatigueRule
  • 疲劳度控制
  • └ type
  • String
  • EXPRESSION:单日允许次数、NUMERIC:间隔时间段允许推送次数
  • └ frequency
  • String
  • 推送次数,当type为EXPRESSION时,一天内允许推送次数;当type为NUMERIC时,间隔时间段允许推送次数
  • └ interval
  • String
  • 当type为NUMERIC时有效,指定时间段「时间段」推送一条
  • └ unit_type
  • String
  • 当type为NUMERIC时有效,指定时间段「单位」推送一条。MILLSECONDS:毫秒,SECONDS:秒,MINUTES:分钟,HOURS:小时,DAY:天
  • push_period_list
  • PushPeriod []
  • 允许推送时间段
  • └ start_time
  • String
  • 开始时间
  • └ end_time
  • String
  • 截止时间
  • └ message
  • String
  • 错误信息
  • └ success
  • Boolean
  • true
  • 是否执行成功
  • └ trace_id
  • String
  • 请求唯一标识

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAilabsIotSaasMessageTemplateGetRequest req = new AlibabaAilabsIotSaasMessageTemplateGetRequest();
req.setOpenTemplateId("4324are");
req.setAccountId(4234L);
req.setApplicationId("areq2323");
AlibabaAilabsIotSaasMessageTemplateGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_ailabs_iot_saas_message_template_get_response>
    <result>
        <ret_code></ret_code>
        <ret_value>
            <app_box_template>
                <app_message>
                    <title></title>
                    <content></content>
                </app_message>
                <fatigue_rule>
                    <type>EXPRESSION</type>
                    <frequency>1</frequency>
                    <interval>3</interval>
                    <unit_type>SECONDS</unit_type>
                </fatigue_rule>
            </app_box_template>
            <app_desk_template>
                <app_message>
                    <title></title>
                    <content></content>
                </app_message>
                <fatigue_rule>
                    <type></type>
                    <frequency></frequency>
                    <interval></interval>
                    <unit_type></unit_type>
                </fatigue_rule>
                <push_period_list>
                    <push_period>
                        <start_time>06:00:00</start_time>
                        <end_time>14:00:00</end_time>
                    </push_period>
                </push_period_list>
            </app_desk_template>
            <tts_immediate_template>
                <tts_message></tts_message>
                <fatigue_rule>
                    <type></type>
                    <frequency></frequency>
                    <interval></interval>
                    <unit_type></unit_type>
                </fatigue_rule>
                <push_period_list>
                    <push_period>
                        <start_time></start_time>
                        <end_time></end_time>
                    </push_period>
                </push_period_list>
            </tts_immediate_template>
        </ret_value>
        <message></message>
        <success>true</success>
        <trace_id></trace_id>
    </result>
</alibaba_ailabs_iot_saas_message_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

返回
顶部