nocmt / ewelink-api-next

CoolKit v2 API Official Library
MIT License
19 stars 4 forks source link

The path of request is not allowed with appid #20

Closed DevJaGz closed 2 months ago

DevJaGz commented 8 months ago

After make a request to https://apia.coolkit.cn/v2/utils/get-region?countryCode=34, I got the next response:

{ "error": 407, "msg": "the path of request is not allowed with appid:ZJpJmcx8xeoytJ7nbWtY4tXailh3mLTX", "data": {} }

I do not know what is wrong with my app id, could anyone help me please?

jmlat commented 6 months ago

I have the same issue, did you find a way to get past it?

DevJaGz commented 6 months ago

H, the only way is to buy a developer subscription from Ewlink. (This should be mentioned in the Library Docs) However. If you want to test the API, you can use these PUBLIC credentials, taking from here:

APP_ID: R8Oq3y0eSZSYdKccHlrQzT1ACCOUT9Gv APP_SECRET: 1ve5Qk9GXfUhKAn1svnKwpAlxXkMarru

nocmt commented 5 months ago

This represents that your APPID does not have permission to access this API. Currently, applications created through the eWeLink developer center can only use OAuth2.0 related interfaces. There is a separate chapter on this on the open platform, and the available interfaces are also listed in the application details introduction.

Secondly, users who use the OAuth2.0 scheme to log in and authorize do not actually need to obtain information about their region based on the country/region code.

Example of authorization login code: https://github.com/nocmt/eWeLinkOAuthLoginDemo

Interface document link: https://coolkit-technologies.github.io/eWeLink-API/#/en/OAuth2.0

Example of calling Postman for OAuth2.0 interface: https://raw.githubusercontent.com/CoolKit-Technologies/eWeLink-API/main/media/files/CoolKit_OAuth2.0_Postman_Demo.zip

Screenshots of the interfaces available to you:

image

majeka commented 5 months ago

I get the same error when calling the https://eu-apia.coolkit.cc/v2/device/thing/ method to query all devices. If I call for a specific device, the api returns the correct response. Is it possible to fix this?

nocmt commented 2 months ago

I get the same error when calling the https://eu-apia.coolkit.cc/v2/device/thing/ method to query all devices. If I call for a specific device, the api returns the correct response. Is it possible to fix this?

The type of APPID restricts which interfaces you can use, which cannot be lifted temporarily.