PushV2 - 高级推送

高级推送接口V2。

接口说明

请确保在使用该接口前,以充分了解 EMAS 移动推送产品的收费方式和价格

本接口区分 Android 和 iOS 平台,对于不同平台的推送调用,需要传入平台对应的 AppKey。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
mpush:PushV2none
*全部资源
*

请求参数

名称类型必填描述示例值
AppKeylong

AppKey 信息。

****530646
IdempotentTokenstring

用于防止 API 调用端重试造成服务端重复推送的一个幂等参数。15 分钟内使用相同 IdempotentToken 进行调用时,只会进行一次推送,后续返回第一次成功推送的结果。

说明
  • 参数格式为标准 36 位 UUID(8-4-4-4-12),每个有效字符是 0-9 或 a-f 范围内的一个十六进制的数字,不区分大小写。
  • 此参数仅用于避免重试造成的重复推送,无法避免并发调用造成的重复推送。
  • c8016d13-6e76-****-9bda-769383d11787
    PushTaskPushTask

    推送任务。

    请您阅读文档 PushV2 接口接入指南获取更多指导。

    返回参数

    名称类型描述示例值
    object
    MessageIdstring

    标志一次推送的消息 ID。

    11747540****88320
    RequestIdstring

    请求 ID。

    159E4422-6624-****-8943-DFD98D34858C

    示例

    正常返回示例

    JSON格式

    {
      "MessageId": "11747540****88320",
      "RequestId": "159E4422-6624-****-8943-DFD98D34858C"
    }

    错误码

    HTTP status code错误码错误信息描述
    400InvalidPeriod.ExceedDaysThe period between specified EndTime and StartTime exceeds %s days.开始时间和结束时间超过%s天。
    400Invalid%s.FormatThe specified %s format is invalid.参数格式错误。
    400AccountDisabledYour account is not enabled.功能未启用。
    400FileNotExistThe specified file does not exist.指定的文件不存在。
    400IncorrectPasswordThe password is incorrect.密码错误。
    400NotApnsCertificateThe Certificate is not an APNs certificate.不是APNs证书。
    400PermissionDeniedThe specified AppKey is not authorized.您没有访问该app的权限,请您检查Appkey参数是否属于该账户。
    400SendSpeedNotSupportedSendSpeed is not supported for specified Target.制定目标不支持SendSpeed参数。
    400SmsProfileConfigFailedFailed to configure SMS profile.SMS配置失败。
    400SmsProfileGetFailedFailed to get SMS profile.SMS配置获取失败。
    400SmsRoleAuthorizeFailedFailed to authorize SMS role.SMS角色授权失败。
    400SmsRoleUnauthorizedThe SMS role is unauthorized.SMS角色没有授权。
    400TagsNumberBeyondLimitThe number of tags bound to this app exceeds the limit.当前app绑定的tag数量超过限制。
    400Invalid%s.LengthExceedThe specified %s length cannot be greater than %s.参数长度超限。
    400Invalid%s.BytesExceedThe specified %s exceeds the %s bytes limit.参数的字节数超限。
    400Invalid%s.EmptyThe specified %s cannot be empty.参数不能为空。
    400Invalid.ParameterThe specified parameter is invalid: %s.参数%s无效。
    400TargetNotSupportedTarget is not supported for batch push.批量推送不支持的Target。
    400TargetNotSupportedTarget is not supported for file push.文件推送不支持的Target。
    400TargetNotSupportedTarget is not supported for iOS live activity.iOS灵动岛推送不支持的target
    500InternalErrorThe request processing has failed due to some unknown error. Please try again. If the error still exists, submit a ticket.服务端错误,建议重试,仍然失败则提工单
    500TimeoutThe request processing is timeout.请求处理超时。

    访问错误中心查看更多错误码。