0

i configured apiKey in huawei console for PushKit and i want send push from web app to my android app, so i prepared following CURL:

enter image description here

enter image description here

problem is postman still return

{"error":"400 Bad Request, body is empty"}

when i'm trying to call url from any online curl console result is as following:

    {
    "msg": "Authentication Error",
    "code": "80200001"
    }

how can i authorize my request by apiKey?

Paweł
  • 205
  • 2
  • 11

1 Answers1

0

UPDATE

enter image description here


"code": "80200001"

It's recommended that you check your appid in the URL.

This error code is usually caused by the appid in your URL is different from the appid used to obtain the access_token, or the appid has no permission.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • push kit enabled, app id is valid. "or the appid has no permission "- what do you mean? – Paweł Mar 17 '21 at 10:30
  • hey@Paweł,i updated my answer.Pls kindly refer.You need to use `access_token` for authentication. For details, see the [document](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/https-send-api-0000001050986197-V5?ha_source=hms1). Note that the app ID used to apply for `access_token` must be the same as the app ID used to send messages. – zhangxaochen Mar 18 '21 at 02:27
  • so i have to get token first and i cant do it as in firebase push? just by api key? – Paweł Mar 19 '21 at 06:59
  • 1
    To use huawei Push, you need to obtain a token. You can send messages in either of the following ways: 1. Send messages through the API or 2. Send messages through the console. This [document](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/msg-sending-0000001050042119-V5?ha_source=hms1) describes how to send messages on the console.pls refer. – zhangxaochen Mar 19 '21 at 08:31
  • @Paweł Glad to hear this,and It would be great to upvote my answer if it was helpful to you. Thanks :) – zhangxaochen Mar 22 '21 at 00:44