Sivaraj Rajendran
Sivaraj Rajendran

Reputation: 63

Getting Error while obtaining an access token in HMS Push Kit API

When I use this api to get access token:

https://oauth-login.cloud.huawei.com/oauth2/v3/token?grant_type=client_credentials&client_id=****&client_secret=****

it always returns

{
    "sub_error": 20001,
    "error_description": "missing required parameter: client_id",
    "error": 1102
}

although I send client_id parameter

Upvotes: 0

Views: 576

Answers (1)

Sivaraj Rajendran
Sivaraj Rajendran

Reputation: 63

To solve the issue, Please make sure the below points

  1. You are doing post request to the server

  2. Make sure that the POSR URL is “https://oauth-login.cloud.huawei.com/oauth2/v3/token”.

  3. Do not include post parameters in the URL, Add below parameters in body of POST request(If you use postman tool you can find the feilds for adding parameters)

    grant_type=client_credentials

    client_id= Your Client ID

    client_secret= Your Client secret

For more details about fetching the access token, please refer the below link:

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/open-platform-oauth-0000001053629189-V5#EN-US_TOPIC_0000001053629189__section12493191334711

Upvotes: 2

Related Questions