新快现里接口文档模板错误是怎么回事?

API接口文档_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
API接口文档
上传于||暂无简介
大小:2.54KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢*建议/问题类型
选择建议/问题类型
产品缺陷/问题反馈
操作流程、界面优化建议
业务政策优化建议
资料内容太旧
资料描述不清晰或不完整
*建议/问题描述
*联系方式(必须填写一种)
反馈成功啦!感谢您宝贵的意见或建议,我们火速处理!
提交失败!请稍候再试!
来自华为开发者联盟
华为PUSH开放平台HCTT(Huawei Cloud Terminal Touch)为合作伙伴提供一条从云端(应用侧)向移动终端无线推送消息的通道,通过此通道,应用可为用户带来更为即时、丰富的业务体验。
Provider:指PUSH消息的提供方,一般为应用的服务器端App server
Push Service:指PUSH服务器
Push Agent: 指PUSH服务在手机端的代理,即APP嵌入的SDK包
App:即应用的客户端软件
华为PUSH通道目前基于IP连接,通过无线互联网网络传送,由于网络的不完全可靠性,在用户不在线时,不保证消息的实时送达。
当用户因为各种原因不在线时,PUSH提供消息缓存机制,在48小时内,当用户在此联网时即时推送到用户终端。超过48小时,消息可能被删除。
应用接入PUSH平台前,应先通过开发者社区注册,然后创建应用,应用审核通过后将获取应用ID:APP ID,应用安全码:APP Secre和APP TYPE。
应用提供者基于获取的应用ID和接口文档开发完成后可和PUSH开放平台对接测试,验证完成后通过上线审核即可上线。
应用在注册和接入过程中,将根据应用场景获取以下关键参数:
1) APP ID:应用的标识,全局唯一。用以区分是接入方。
2) APP TYPE:应用类型。用以区分可调用的能力及约束。
应用在发送消息时,需要传送接受消息的用户标识:
1) TMID:用户标识唯一标识一部用户终端。此标识在应用通过开放接口注册到PUSH平台时会获得,需要应用客户端将此标识传递给应用服务端。
客户端开发请参照《华为PushSDK集成说明.pdf》。
本接口基于HTTPS协议,采用HTTPS POST方式,每个调用参数分为两个部分组成:系统级别参数和应用级别参数。
所有的请求和响应数据编码皆为utf-8格式。
4.2.1 android结构体
notification_title
Notification bar上显示的标题
notification_content
Notification bar上显示的内容
notification_status_icon
系统小图标名称
该图标预置在客户端,在通知栏顶部展示
content_file_url
仅富媒体消息需要填写该字段
富媒体消息的附件为.zip格式,客户端解压后默认打开index.html。".zip"文件的大小不能超过100K哦,否则会拒绝发送的
只要在开发者联盟上实名认证,都会赠送5G的云存储空间,可以在开发者联盟portal给每个应用申请云存储空间。富媒体附件一定要保存到云存储空间的哦~~
云存储文件地址格式:/dl/appName/path/filename,其中"/dl/"为写死的部分,"appName/path/file"应用可以根据自身实际情况填写
如何上传附件请参考:资料中心-&云存储服务-&SDK下载 中的样例代码
1:直接打开应用
2:通过自定义动作打开应用
3:打开URL
4:富媒体消息
5:短信收件箱广告
6:彩信收件箱广告
注意:当手机收到短信、彩信收件箱广告后,在收件人一栏显示的是应用在联盟上注册的名字哦~
smsContent
短信收件箱广告内容
当doings的取值为5时,该字段必须填写
彩信收件箱广告附件链接
当doings的取值为6时,该字段必须填写
彩信附件为.zip格式,压缩包中必须要有.smil描述文件,并且符合标准smil语法哦。.zip文件的大小不能超过100K哦,否则会拒绝发送的
只要在开发者联盟上实名认证,都会赠送5G的云存储空间,可以在开发者联盟portal给每个应用申请云存储空间。富媒体附件一定要保存到云存储空间的哦~~
云存储文件地址格式:/dl/appName/path/filename,其中“/dl/”为写死的部分,“appName/path/file” 应用可以根据自身实际情况填写
如何上传附件请参考:资料中心-&云存储服务-&SDK下载 中的样例代码
当doings的取值为3时,必须携带该字段
自定义打开应用动作
当doings的取值为2时,必须携带该字段
JSON array
用户自定义键值对
"extras":[{"season":"Spring"},{"weather":"raining"}]
直接打开应用样例:
{"notification_title":"hello","notification_content ":"hello","doings":1}
通过自定义动作打开应用样例:
{"notification_title":"hello","notification_content":"hello","doings":2,"intent":"com.huawei.pushagent"}
打开URL样例:
{" notification_title":"the good news!","notification_content":"Price reduction!","doings":3,"url":""}
富媒体消息样例:
{"notification_title":"hello","notification_content ":"hello","doings":4,"content_file_url":"http://xxxx/xx.zip"}
短信收件广告样例:
{"notification_title":"hello","notification_content ":"hello","doings":5, "smsContent":"Free phone!"}
彩信收件箱广告样例:
{"notification_title":"hello","notification_content ":"hello","doings":6,"mmsUrl":"http://xxxx/xx"}
4.2.2 IOS结构体
JSON OBJECT
详见4.2.2.1章节
JSON Integer
1:直接打开应用
3:打开URL
JSON String
当doings的取值为3时,必须携带该字段
样例 1: The following payload has an aps dictionary with a simple, recommended form for alert messages with the default alert buttons (Close and View). It uses a string as the value of alert rather than a dictionary. This payload also has a custom array property.
"aps" : { "alert" : "Message received from Bob" },
"acme2" : [ "bang",
样例 2. The payload in the example uses an aps dictionary to request that the device display an alert message with an Close button on the left and a localized title for the "action" button on the right side of the alert. In this case, “PLAY” is used as a key into the Localizable.strings file for the currently selected language to get the localized equivalent of “Play”. The aps dictionary also requests that the application icon be badged with the number 5
"aps" : {
"alert" : {
"body" : "Bob wants to play poker",
"action-loc-key" : "PLAY"
"badge" : 5,
"acme1" : "bar",
"acme2" : [ "bang",
样例 3. The payload in this example specifies that device should display an alert message with both Close and View buttons. It also request that the application icon be badged with the number 9 and that a bundled alert sound be played when the notification is delivered
"aps" : {
"alert" : "You got your emails.",
"badge" : 9,
"sound" : "bingbong.aiff"
"acme1" : "bar",
"acme2" : 42
样例 4. The payload in this example uses the loc-key and loc-args child properties of the alert dictionary to fetch a formatted localized string from the application’s bundle and substitute the variable string values (loc-args) in the appropriate places. It also specifies a custom sound and includes a custom property
"aps" : {
"alert" : {
"loc-key" : "GAME_PLAY_REQUEST_FORMAT",
"loc-args" : [ "Jenna", "Frank"]
"sound" : "chime"
"acme" : "foo"
4.2.2.1 aps结构体
JSON OBJECT OR JSON STRING
If this property is included, the system displays a standard alert. You may specify a string as the value of alert or a dictionary as its value. If you specify a string, it becomes the message text of an alert with two buttons: Close and View. If the user taps View, the application is launched.
Alternatively, you can specify a dictionary as the value of alert. See chapter 2.4.1 for descriptions of the keys of this dictionary
The number to display as the badge of the application icon.
If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0
JSON STRING
The name of a sound file in the application bundle. The sound in this file is played as an alert. If the sound file doesn’t exist or default is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds
4.2.2.2 Alert JSON OBJECT
JSON STRING
The text of the alert message
action-loc-key
JSON STRING
If a string is specified, the system displays an alert with two buttons, whose behavior is described in chapter 2.4. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. If the value is null, the system displays an alert with a single OK button that simply dismisses the alert when tapped
JSON STRING
A key to an alert-message string in a Localizable.strings file for the current localization (which is set by the user’s language preference). The key string can be formatted with %@ and %n$@specifiers to take the variables specified in loc-args
与loc-args成对出现
JSON ARRAY
Variable string values to appear in place of the format specifiers in loc-key
与loc-key成对出现
launch-image
JSON STRING
The filename of an image file in th it may include the extension or omit it. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot,uses the image identified by the UILaunchImageFile key in the application’s Info.plist file, or falls back toDefault.png.
This property was added in iOS 4.0
4.3.1 Push请求
方法名称:openpush.message.single_send
方法描述:单条发送Push消息。
请求消息参数描述
deviceToken
32 字节长度,由系统分配的合法TMID
发送到设备上的消息,最长为4096 字节
0:高优先级
1:普通优先级
消息是否需要缓存
标识消息类型(缓存机制),由调用端赋值,取值范围(1~100)。当TMID+msgType的值一样时,仅缓存最新的一条消息
如果开发者填写了该字段,则需要保证该字段唯一
如果开发者没有携带该字段,则推送平台会生成一个全局唯一的ID
字段最大长度64位
expire_time
unix时间戳,格式: 19:55
消息过期删除时间
如果不填写,默认超时时间为当前时间后48小时
4.3.2 响应参数说明
响应消息参数描述
resultcode
0: success
100:Invalid unknown params.
20203:No permission to send message to these tmIDs.
20204:Invalid expire time.
20205:Not enough quota.
对结果码的描述
消息跟踪ID
如果请求消息中填写了该字段,则将请求消息中的值返回
方法名称:openpush.message.batch_send
方法描述:群发Push消息
4.4.1 输入参数说明
请求消息参数描述
deviceTokenList
Device token列表,最多填1000个
发送到设备上的消息,最长为4096 字节
消息是否需要缓存
标识消息类型(缓存机制),由调用端赋值,取值范围(1~100)。当TMID+msgType的值一样时,仅缓存最新的一条消息
expire_time
unix时间戳,格式: 19:55
消息过期删除时间
如果不填写,默认超时时间为当前时间后48小时
4.4.2 响应参数说明
响应消息参数描述
resultcode
0: success
100:Invalid unknown params.
20203:No permission to send message to these tmIDs.
20204:Invalid expire time.
20205:Not enough quota.
对结果码的描述
消息跟踪ID
如果请求消息中填写了该字段,则将请求消息中的值返回
方法名称:openpush.openapi.lbs_send
方法描述:该接口用户创建地理围栏消息,如果有用户进入地理围栏,则给用户发送通知栏消息
4.5.1 输入参数说明
请求消息参数描述
经纬度信息
{"location":{"type":"1","coordinates":[{"lat":"32.57844","lng":"117.502087"},{"lat":"30.848528","lng":"118.458746"},{"lat":"31.33934","lng":"120.316873"},{"lat":"32.656293","lng":"119.580981"}]}}
Latlng表示经纬度列表,多个经纬度围城一个封闭区域,必须按照顺序填写,否则会影响定位准确度
纬度在前,经度在后,纬度、经度之间用英文“,”分隔
Type表示封闭区域类型,目前仅支持1,表示多边形
样例: xxx, ddd
多个token用","分隔
注意:该字段暂不生效
样例:{"tags":[{"location":["ShangHai","GuangZhou"]},}"age":["20","30"]}]}
含义:在广州或者上海,并且年龄为20或30岁的用户
exclude_tags
需要剔除的用户的标签
样例:{"exclude_tags":[{"music":["blue"]},{"fruit":["apple"]}]}
含义:不给喜欢蓝调音乐的用户,或者喜欢苹果的用户发送消息
android结构体
样例:{" notification_title":"the good news!","notification_content":"Price reduction!","doings":3,"url":""}
消息生效时间。如果不携带该字段,则表示消息实时生效。实际使用时,该字段精确到分
消息发送时间戳,timestamp格式ISO -06-03T17:30:08+08:00
expire_time
消息过期删除时间
消息过期时间,timestamp格式ISO -06-03T17:30:08+08:00
allow_periods
消息允许展示时间段,时间精确到半小时,24小时制,可以填写一个或者多个时间段
消息到达客户端后,由客户端决定是否将消息弹出或展示
时间段样例:[[09:30,12:00],[15:00,16:00]],表示上午9点30到12点之间和下午3点到4点之间可以展示消息
各时间段之间不允许重叠
4.5.2 响应参数描述
响应消息参数描述
result_code
request_id
由服务器生成,方便用户问题追查与定位
result_desc
返回码备注,失败原因,成功时无需填写
: Failed to get userId or devAppId from context
: Illegal parameter
:Attachment is too big
:The app is not exist
响应消息样例:
{"result_code":"0","request_id":"123456"}
方法名称:openpush.openapi.notification_send
方法描述:该方法用于发送通知栏消息
4.6.1 输入参数说明
请求消息参数描述
1:指定用户,必须指定tokens字段
2:所有人,无需指定tokens,tags,exclude_tags
3:一群人,必须指定tags或者exclude_tags字段
样例: xxx, ddd
多个token用","分隔
用户标签,目前仅对android用户生效
样例:{"tags":[{"location":["ShangHai","GuangZhou"]},}"age":["20","30"]}]}
含义:在广州或者上海,并且年龄为20或30岁的用户
exclude_tags
需要剔除的用户的标签,目前仅对android用户生效
样例:{"exclude_tags":[{"music":["blue"]},{"fruit":["apple"]}]}
含义:不给喜欢蓝调音乐的用户,或者喜欢苹果的用户发送消息
android结构体
给android设备发送消息时,必须填写该字段
样例:{" notification_title":"the good news!","notification_content":"Price reduction!","doings":3,"url":""}
消息生效时间。如果不携带该字段,则表示消息实时生效。实际使用时,该字段精确到分
消息发送时间戳,timestamp格式ISO -06-03T17:30:08+08:00
expire_time
消息过期删除时间
消息过期时间,timestamp格式ISO -06-03T17:30:08+08:00
device_type
目标设备类型
1:android
默认为android
消息结构体
发送给非android设备的消息内容
{"ios":{"aps" : { "alert" : "Message received from Bob" },"acme2" : [ "bang", "whiz" ], "doings":1 }}
目前仅支持IOS设备
target_user_type
1:IOS开发用户
2:IOS生产用户
目前仅给IOS设备发送消息需要填写该字段
allow_periods
消息允许展示时间段,时间精确到半小时,24小时制,可以填写一个或者多个时间段
消息到达客户端后,由客户端决定是否将消息弹出或展示
时间段样例:[[09:30,12:00],[15:00,16:00]],表示上午9点30到12点之间和下午3点到4点之间可以展示消息
各时间段之间不允许重叠
4.6.2 响应参数描述
响应消息参数描述
result_code
request_id
由服务器生成,方便用户问题追查与定位
result_desc
返回码备注,失败原因,成功时无需填写
: Failed to get userId or devAppId from context
: Illegal parameter
:Attachment is too big
:The app is not exist
响应消息样例:
{"result_code":"0","request_id":"123456"}
方法名称:openpush.openapi.set_user_tag
4.7.1 输入参数说明
请求消息参数描述
比如:地区
比如:上海
4.7.2 响应参数说明
响应消息参数描述
result_code
request_id
由服务器生成,方便用户问题追查与定位
result_desc
:Failed to get userId or devAppId from context
: Illegal parameter
:Illegal tokens
:The app is not exist
响应消息样例:
响应消息为JSON格式
{"result_code":"0","request_id":""}
方法名称:openpush.openapi.query_app_tags
4.8.1 输入参数说明
该方法不需要输入参数
4.8.2 响应参数说明
响应消息参数描述
request_id
由服务器生成,方便用户问题追查与定位
样例:{&tags&:[{&location&:[&ShangHai&,&GuangZhou&]},{&age&:[&20&,&30&]}]}
响应消息样例:
响应消息为JSON格式
{&request_id&:&&,&tags&:[{&location&:[&ShangHai&,&GuangZhou&]},{&age&:[&20&,&30&]}]}
方法名称:openpush.openapi.delete_user_tag
4.9.1 输入参数说明
请求消息参数描述
比如:地区
4.9.2 响应参数说明
响应消息参数描述
result_code
request_id
由服务器生成,方便用户问题追查与定位
result_desc
:Failed to get userId or devAppId from context
: Illegal parameter
:Illegal tokens
:The app is not exist
响应消息样例:
响应消息为JSON格式
{"result_code":"0","request_id":""}
方法名称:openpush.openapi.query_user_tag
4.10.1 输入参数说明
请求消息参数描述
4.10.2 响应参数说明
响应消息参数描述
request_id
由服务器生成,方便用户问题追查与定位
样例:{&tags&:[{&location&:&ShangHai"},{"age":"20"}]}
响应消息样例:
响应消息为JSON格式
{&request_id&:&&,&tags&:[{&location&:&ShangHai&},{"age":"20"}]}
该接口仅能查询single_send和batch_send接口发送的消息
方法名称:openpush.openapi.query_msg_result
4.11.1 输入参数说明
请求消息参数描述
request_id
开发者调用sengle_send和batch_send接口时返回的requestID字段值
如果携带该字段,则表示查询request_id中的token对应的消息结果;如果不携带该字段,则查询request_id对应的所有token的消息结果
4.11.2 响应参数说明
响应消息参数描述
request_id
消息跟踪ID
请求消息中的request_id
JSON ARRAY
result结构体:
0:成功送达
1:待发送 (没送到,但又没过期、没被覆盖的消息,还在等待补发的)
3:过期丢弃
响应消息样例:
{&result&:[{&status&:0,&token&:&"}],"request_id":"123456"}
该接口用于开发者根据时间获取,指定时间段内新生成的PUSH用户标识
PUSH用户标识根据时间,每天生成一个文件
方法名称:openpush.openapi.get_token_by_date
4.12.1 输入参数说明
请求消息参数描述
表示获取这一天新产生的token
不能填写当天时间,可以填写当前之前的时间
4.12.1 响应参数说明
响应消息参数描述:
result_code
0:success
:Failed to get userId or devAppId from context
: Illegal parameter
: There is no token file
:The app is not exist
result_desc
响应码描述
0:success
:Failed to get userId or devAppId from context
: Illegal parameter
: There is no token file
:The app is not exist
当没有获取到文件下载链接时必须填写该字段,用于高速开发者为什么没有获取到文件
request_id
每次请求唯一标识
tokenFile_url
文件存在的时候,则该字段填写文件下载链接,每个链接的有效期时间为12小时,12小时过后则链接失效
文件为.zip格式
unzip_password
文件解压密码
获取文件之后用这个密码解压缩
响应消息样例:
{&request_id&:&7254&,&result_code&:&0&,&tokenFile_url&:&http://xxx&,&unzip_password&:&xxx&}
4.13.1 HTTP返回码
服务器内部错误
服务端暂时不可达
4.13.2 错误代码对照表
系统级错误代码
一个未知的错误发生
服务临时不可用
未知的方法
应用已达到设定的请求上限
请求来自未经授权的IP地址
调用次数超过了限制
调用太频繁
无效未知参数
无效的API_KEY
无效的SESSION_KEY
必须是POST提交
无效的签名
缺少系统参数:app_id,app_key 等
app没有调用当前服务的权限
app_id和secret需要重新获取(如算法升级等)
路由失败,无法识别服务投递地址
业务级错误代码
tmID is null
tmID参数为空
tmID is too many
tmID参数太长了
Message is null
消息内容为空
Data too long, please send data less than 1024 bytes
消息内容不得超过1024字节
Illegal cache Mode
非法的缓存模式
Illegal msg Type
非法的消息类型
Device Quota Exceeded
发送给某个tmID终端的Push消息太多
message Unreachable
消息不可达
Send message Timeout
发送消息超时
Illegal file Url
非法的文件url地址
No permission to send message to these tmIDs
无权给这些tmID发送消息。
Invalid expire time
无效的过期时间
Illegal parameter
request_id is not exist
requestId不存在
Illegal token
Attachment is too big
The app is not exist
应用不存在
Not enough quota
反馈成功!感谢您的支持,我们将尽快处理。
如您对本页信息有疑问,请反馈给我们。 请先
@ 华为软件技术有限公司 版权所有 保留一切权利 苏B2-号 | 苏ICP备号-9接口文档_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
上传于||文档简介
&&软​件​开​发​接​口​文​档
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩7页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢怎么写接口文档_百度知道接口文档_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
上传于||文档简介
&&医​疗​方​面
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩12页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 支付宝接口开发文档 的文章

 

随机推荐