文档管理中心
您当前正在浏览HarmonyOS最新文档,覆盖已发布的所有API版本,可在API参考中筛选您使用的API版本。详细的版本配套关系请参考版本说明
指南与API参考API参考应用服务Push Kit(推送服务)REST API场景化消息推送请求示例

请求示例

通知消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:0
  7. // Request Body
  8. {
  9. "payload": {
  10. "notification": {
  11. "category": "xxxxxx", // category替换为实际通知消息类型
  12. "title": "普通标题",
  13. "body": "普通内容",
  14. "clickAction": {
  15. "actionType": 0
  16. },
  17. "style": 0,
  18. "image":"https://lf*******246.png"
  19. }
  20. },
  21. "target": {
  22. "token": ["MAAALgE4G98BAAAAst*******jg"]
  23. }
  24. }

应用在前台时接收通知消息

应用只在后台展示通知消息;应用在前台时,通知消息将不会展示,但可以接收通知消息后自行完成业务处理,详情请参见应用在前台时处理通知消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:0
  7. // Request Body
  8. {
  9. "payload": {
  10. "notification": {
  11. "category": "MARKETING",
  12. "title": "普通通知标题",
  13. "body": "普通通知内容",
  14. "clickAction": {
  15. "actionType": 0
  16. },
  17. "foregroundShow": false // 设置为false则应用在前台时不会展示通知消息,默认为true表示前后台都展示
  18. }
  19. },
  20. "target": {
  21. "token": ["MAMzLg**********lPW"]
  22. },
  23. "pushOptions": {
  24. "testMessage": true,
  25. "ttl": 86400
  26. }
  27. }

角标刷新消息

开发者可单独下发角标刷新消息,通过携带badge字段指定角标数值,接收该消息后,将以数字形式展示桌面应用角标,以此提醒用户及时查看消息。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:0
  7. // Request Body
  8. {
  9. "payload": {
  10. "notification": {
  11. "badge": {
  12. "setNum": 99
  13. }
  14. }
  15. },
  16. "pushOptions": {
  17. "biTag": "this is biTag",
  18. "ttl": 600
  19. },
  20. "target": {
  21. "token": ["MAAALgE4G98BAAAAst************jq"]
  22. }
  23. }

卡片刷新消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:1
  7. // Request Body
  8. {
  9. "payload": {
  10. "formData": {
  11. "textKey": "待刷新服务卡片的业务数据"
  12. },
  13. "version": 922337203,
  14. "images": [
  15. {
  16. "keyName": "imageKey",
  17. "url": "https://xxx.png",
  18. "require": 1
  19. }
  20. ],
  21. "formId": 0,
  22. "moduleName": "testName",
  23. "formName": "testFormName",
  24. "abilityName": "testAbilityName"
  25. },
  26. "pushOptions": {
  27. "biTag": "bi**62",
  28. "ttl": 86400
  29. },
  30. "target": {
  31. "token": [
  32. "MAAALgE4G98BAAAAst************ttQd4Tw"
  33. ]
  34. }
  35. }

语音播报消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:2
  7. // Request Body
  8. {
  9. "payload": {
  10. "extraData": "Extension extra data",
  11. "notification": {
  12. "category": "PLAY_VOICE",
  13. "title": "普通标题",
  14. "body": "普通内容",
  15. "clickAction": {
  16. "actionType": 0
  17. },
  18. "style": 0,
  19. "image":"https://lf*******246.png"
  20. }
  21. },
  22. "target": {
  23. "token": ["MAAALgE4G98BAAAAst*******jg"]
  24. }
  25. }

后台消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:6
  7. // Request Body
  8. {
  9. "payload": {
  10. "extraData": "携带的数据"
  11. },
  12. "target": {
  13. "token": ["MAAALgE4G98BAAAAst************jq"]
  14. }
  15. }

创建实况窗消息

航班场景(event为FLIGHT)

计划出发,使用左右文本模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 1,
  15. "operation": 0,
  16. "event": "FLIGHT",
  17. "status": "DEPART", // 计划出发
  18. "activityData": {
  19. "notificationData": {
  20. "keywords": {
  21. "flightNo": "MU1471"
  22. },
  23. "type": 5,
  24. "contentTitle": "航班{{status}}", // 航班计划出发
  25. "contentText": [
  26. {
  27. "text": "航班号:"
  28. },
  29. {
  30. "text": "{{flightNo}}", // MU1471
  31. "foregroundColor": "#FF317AF7"
  32. }
  33. ],
  34. "clickAction": {
  35. "actionType": 0
  36. },
  37. "firstTextBlock": {
  38. "firstLine": "12:00",
  39. "secondLine": "上海虹桥"
  40. },
  41. "lastTextBlock": {
  42. "firstLine": "14:20",
  43. "secondLine": "成都天府"
  44. },
  45. "displayHorizontalLine": true,
  46. "spaceIcon": "space.png", // 取值为“/resources/rawfile”路径下的文件名
  47. "extend": {
  48. "type": 3,
  49. "pic": "flight.png", // 取值为“/resources/rawfile”路径下的文件名
  50. "clickAction": {
  51. "actionType": 1,
  52. "action": "xxxxxxx"
  53. }
  54. }
  55. },
  56. "capsuleData": {
  57. "type": 1,
  58. "status": 1,
  59. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  60. "bgColor": "#FF317AF7",
  61. "remind": "EXPAND",
  62. "title": "即将出发",
  63. "content": "请尽快前往机场"
  64. }
  65. }
  66. },
  67. "target": {
  68. "token": [
  69. "MAAALgE4G98BAAAAst************jq"
  70. ]
  71. }
  72. }

出行打车场景(event为TAXI)

司机正在赶来,使用进度可视化模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 2,
  15. "operation": 0,
  16. "event": "TAXI",
  17. "status": "DRIVER_ON_THE_WAY", // 司机正在赶来
  18. "activityData": {
  19. "notificationData": {
  20. "type": 3,
  21. "contentTitle": "{{status}}", // 司机正在赶来
  22. "contentText": [
  23. {
  24. "text": "距您"
  25. },
  26. {
  27. "text": "1.2公里",
  28. "foregroundColor": "#FF317AF7"
  29. },
  30. {
  31. "text": " | "
  32. },
  33. {
  34. "text": "5分钟",
  35. "foregroundColor": "#FF317AF7"
  36. }
  37. ],
  38. "clickAction": {
  39. "actionType": 1, // 打开应用自定义页面
  40. "action": "xxxxxx" // 应用内置页面ability对应的action
  41. },
  42. "richProgress": {
  43. "type": 0,
  44. "nodeIcons": ["icon1.png", "icon2.png", "icon3.png"], // 取值为“/resources/rawfile”路径下的文件名
  45. "indicatorIcon": "taxi.png", // 取值为“/resources/rawfile”路径下的文件名
  46. "progress": 40,
  47. "indicatorType": 1,
  48. "color": "#FF317AF7",
  49. "bgColor": "#19000000"
  50. },
  51. "extend": {
  52. "type": 3,
  53. "pic": "phone.png", // 取值为“/resources/rawfile”路径下的文件名
  54. "clickAction": {
  55. "actionType": 5, // 打开拨号界面
  56. "data": {
  57. "tel": "138xxxxxxxx" // 通过tel字段携带电话号码
  58. }
  59. }
  60. }
  61. },
  62. "capsuleData": {
  63. "type": 1,
  64. "status": 1,
  65. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  66. "bgColor": "#FF317AF7",
  67. "remind": "EXPAND",
  68. "title": "接驾中",
  69. "content": "预计5分钟"
  70. }
  71. }
  72. },
  73. "target": {
  74. "token": [
  75. "MAAALgE4G98BAAAAst************jq"
  76. ]
  77. }
  78. }

高铁/火车场景(event为TRAIN)

计划出发,使用左右文本模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 3,
  15. "operation": 0,
  16. "event": "TRAIN",
  17. "status": "DEPART", // 计划出发
  18. "title": "列车即将出发",
  19. "content": "请尽快去高铁站",
  20. "activityData": {
  21. "notificationData": {
  22. "keywords": {
  23. "trainNo": "G1406"
  24. },
  25. "type": 5,
  26. "contentTitle": "列车{{status}}", // 列车计划出发
  27. "contentText": [
  28. {
  29. "text": "车次:"
  30. },
  31. {
  32. "text": "{{trainNo}}", // G1406
  33. "foregroundColor": "#FF317AF7"
  34. }
  35. ],
  36. "clickAction": {
  37. "actionType": 0
  38. },
  39. "firstTextBlock": {
  40. "firstLine": "13:00",
  41. "secondLine": "上海虹桥"
  42. },
  43. "lastTextBlock": {
  44. "firstLine": "14:20",
  45. "secondLine": "南京南"
  46. },
  47. "displayHorizontalLine": true,
  48. "spaceIcon": "space.png", // 取值为“/resources/rawfile”路径下的文件名
  49. "extend": {
  50. "type": 3,
  51. "pic": "train.png", // 取值为“/resources/rawfile”路径下的文件名
  52. "clickAction": {
  53. "actionType": 1,
  54. "action": "xxxxxxx"
  55. }
  56. }
  57. },
  58. "capsuleData": {
  59. "type": 1,
  60. "status": 1,
  61. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  62. "bgColor": "#FF317AF7",
  63. "remind": "EXPAND",
  64. "title": "即将出发",
  65. "content": "请尽快去高铁站"
  66. }
  67. }
  68. },
  69. "target": {
  70. "token": [
  71. "MAAALgE4G98BAAAAst************jq"
  72. ]
  73. }
  74. }

更新实况窗消息

航班场景(event为FLIGHT)

已值机,使用左右文本模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 1,
  15. "operation": 1,
  16. "event": "FLIGHT",
  17. "status": "CHECKED_IN", // 已值机
  18. "version": 1,
  19. "activityData": {
  20. "notificationData": {
  21. "keywords": {
  22. "flightNo": "MU1471"
  23. },
  24. "type": 5,
  25. "contentTitle": "登机口88",
  26. "contentText": [
  27. {
  28. "text": "{{status}} | " // 已值机
  29. },
  30. {
  31. "text": "{{flightNo}}", // MU1471
  32. "foregroundColor": "#FF317AF7"
  33. }
  34. ],
  35. "clickAction": {
  36. "actionType": 0
  37. },
  38. "firstTextBlock": {
  39. "firstLine": "12:00",
  40. "secondLine": "上海虹桥"
  41. },
  42. "lastTextBlock": {
  43. "firstLine": "14:20",
  44. "secondLine": "成都天府"
  45. },
  46. "displayHorizontalLine": true,
  47. "spaceIcon": "space.png", // 取值为“/resources/rawfile”路径下的文件名
  48. "extend": {
  49. "type": 3,
  50. "pic": "flight.png", // 取值为“/resources/rawfile”路径下的文件名
  51. "clickAction": {
  52. "actionType": 1,
  53. "action": "xxxxxxx"
  54. }
  55. }
  56. },
  57. "capsuleData": {
  58. "type": 1,
  59. "status": 1,
  60. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  61. "bgColor": "#FF317AF7",
  62. "remind": "EXPAND",
  63. "title": "登机口88",
  64. "content": "请尽快完成安检"
  65. }
  66. }
  67. },
  68. "target": {
  69. "token": [
  70. "MAAALgE4G98BAAAAst************jq"
  71. ]
  72. }
  73. }

出行打车场景(event为TAXI)

正在去往目的地,使用进度可视化模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 2,
  15. "operation": 1,
  16. "event": "TAXI",
  17. "status": "HEADING_TO_DESTINATION", // 正在去往目的地
  18. "version": 1,
  19. "activityData": {
  20. "notificationData": {
  21. "type": 3,
  22. "contentTitle": "{{status}}", // 正在去往目的地
  23. "contentText": [
  24. {
  25. "text": "距目的地"
  26. },
  27. {
  28. "text": "7.2公里",
  29. "foregroundColor": "#FF317AF7"
  30. },
  31. {
  32. "text": " | 预计"
  33. },
  34. {
  35. "text": "27分钟",
  36. "foregroundColor": "#FF317AF7"
  37. }
  38. ],
  39. "clickAction": {
  40. "actionType": 1,
  41. "action": "xxxxxx"
  42. },
  43. "richProgress": {
  44. "type": 0,
  45. "nodeIcons": ["icon1.png", "icon2.png", "icon3.png"], // 取值为“/resources/rawfile”路径下的文件名
  46. "indicatorIcon": "taxi.png", // 取值为“/resources/rawfile”路径下的文件名
  47. "progress": 60,
  48. "indicatorType": 1,
  49. "color": "#FF317AF7",
  50. "bgColor": "#19000000"
  51. },
  52. "extend": {
  53. "type": 0
  54. }
  55. },
  56. "capsuleData": {
  57. "type": 1,
  58. "status": 1,
  59. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  60. "bgColor": "#FF317AF7",
  61. "title": "27分钟",
  62. "content": "距目的地7.2公里"
  63. }
  64. }
  65. },
  66. "target": {
  67. "token": [
  68. "MAAALgE4G98BAAAAst************jq"
  69. ]
  70. }
  71. }

行程结束,使用强调文本模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 2,
  15. "operation": 1,
  16. "event": "TAXI",
  17. "status": "COMPLETED", // 行程结束
  18. "version": 2,
  19. "activityData": {
  20. "notificationData": {
  21. "type": 4,
  22. "contentTitle": "{{status}},请支付", // 行程结束,请支付
  23. "contentText": [
  24. {
  25. "text": "全程"
  26. },
  27. {
  28. "text": "10公里",
  29. "foregroundColor": "#FF317AF7"
  30. },
  31. {
  32. "text": " | 耗时"
  33. },
  34. {
  35. "text": "30分钟",
  36. "foregroundColor": "#FF317AF7"
  37. }
  38. ],
  39. "clickAction": {
  40. "actionType": 1,
  41. "action": "xxxxxx"
  42. },
  43. "singleTextBlock": {
  44. "firstLine": "全程费用",
  45. "secondLine": "35.2元",
  46. "underlineColor": "#FF317AF7"
  47. },
  48. "descPic": "payment.png", // 取值为“/resources/rawfile”路径下的文件名
  49. "extend": {
  50. "type": 0
  51. }
  52. },
  53. "capsuleData": {
  54. "type": 1,
  55. "status": 1,
  56. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  57. "bgColor": "#FF317AF7",
  58. "title": "待支付",
  59. "content": "费用35.2元"
  60. }
  61. }
  62. },
  63. "target": {
  64. "token": [
  65. "MAAALgE4G98BAAAAst************jq"
  66. ]
  67. }
  68. }

高铁/火车场景(event为TRAIN)

列车运行中,使用左右文本模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 3,
  15. "operation": 1,
  16. "event": "TRAIN",
  17. "status": "HEADING_TO_DESTINATION", // 列车运行中
  18. "version": 1,
  19. "activityData": {
  20. "notificationData": {
  21. "keywords": {
  22. "trainNo": "G1406"
  23. },
  24. "type": 5,
  25. "contentTitle": "{{status}}", // 列车运行中
  26. "contentText": [
  27. {
  28. "text": "车次:"
  29. },
  30. {
  31. "text": "{{trainNo}}", // G1406
  32. "foregroundColor": "#FF317AF7"
  33. }
  34. ],
  35. "clickAction": {
  36. "actionType": 0
  37. },
  38. "firstTextBlock": {
  39. "firstLine": "13:00",
  40. "secondLine": "上海虹桥"
  41. },
  42. "lastTextBlock": {
  43. "firstLine": "14:20",
  44. "secondLine": "南京南"
  45. },
  46. "displayHorizontalLine": true,
  47. "spaceIcon": "space.png", // 取值为“/resources/rawfile”路径下的文件名
  48. "extend": {
  49. "type": 3,
  50. "pic": "train.png", // 取值为“/resources/rawfile”路径下的文件名
  51. "clickAction": {
  52. "actionType": 1,
  53. "action": "xxxxxxx"
  54. }
  55. }
  56. },
  57. "capsuleData": {
  58. "type": 1,
  59. "status": 1,
  60. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  61. "bgColor": "#FF317AF7",
  62. "title": "运行中",
  63. "content": "预计14:20到达"
  64. }
  65. }
  66. },
  67. "target": {
  68. "token": [
  69. "MAAALgE4G98BAAAAst************jq"
  70. ]
  71. }
  72. }

赛事比分场景(event为SCORE)

推送赛事最新比分,使用赛事比分模板。

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:7
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "ttl": 1000,
  11. "biTag": "biTag"
  12. },
  13. "payload": {
  14. "activityId": 4,
  15. "operation": 1,
  16. "event": "SCORE",
  17. "activityData": {
  18. "notificationData": {
  19. "type": 7,
  20. "contentTitle": "第四节比赛中",
  21. "contentText": [
  22. {
  23. "text": "XX",
  24. "foregroundColor": "#FF317AF7"
  25. },
  26. {
  27. "text": " VS "
  28. },
  29. {
  30. "text": "XX",
  31. "foregroundColor": "#FF317AF7"
  32. },
  33. {
  34. "text": " | 小组赛第五场"
  35. }
  36. ],
  37. "game": {
  38. "host": {
  39. "icon":"host.png", // 取值为“/resources/rawfile”路径下的文件名
  40. "name": "队名A",
  41. "score": "110"
  42. },
  43. "guest": {
  44. "icon":"guest.png", // 取值为“/resources/rawfile”路径下的文件名
  45. "name": "队名B",
  46. "score": "102"
  47. },
  48. "competition": {
  49. "desc": "Q4",
  50. "time":"02:16"
  51. }
  52. },
  53. "displayHorizontalLine": true,
  54. "clickAction": {
  55. "actionType": 1,
  56. "action": "xxxxxxx"
  57. }
  58. },
  59. "capsuleData": {
  60. "type": 1,
  61. "status": 1,
  62. "icon": "icon.svg", // 取值为“/resources/rawfile”路径下的文件名
  63. "bgColor": "#FF317AF7",
  64. "title": "110:102",
  65. "content": "第四节比赛中"
  66. }
  67. }
  68. },
  69. "target": {
  70. "token": ["MAAALgE4G98BAAAAst************jq"]
  71. }
  72. }

应用内通话消息

收起
自动换行
深色代码主题
复制
  1. // Request URL
  2. POST "https://push-api.cloud.huawei.com/v3/3158882***52863/messages:send"
  3. // Request Header
  4. Content-Type: application/json
  5. Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
  6. push-type:10
  7. // Request Body
  8. {
  9. "pushOptions": {
  10. "biTag": "biTag",
  11. "ttl": 30
  12. },
  13. "payload": {
  14. "extraData": "传递给应用的数据"
  15. },
  16. "target": {
  17. "token": [
  18. "MAAALgE4G98BAAAAst************jq"
  19. ]
  20. }
  21. }