简体   繁体   中英

Zomato API integration with in android app

{
    "code":403,
    "status":"Forbidden",
    "message":"Invalid API Key"
}

this is what i am getting as request URL

I am trying to use the request URL for Zomato API using my Generated API key. But every time i try to use the URL on fiddler and any browser it is showing this error of INVALID API KEY .

Why i am getting this invalid API key and how can i solve it?

EDITED: this image might clear how i am using the key

此图像可能会清除我如何使用密钥

xxxxx is just an example . This is how i am using the api key and then using the URL!

According to Zomato API https://developers.zomato.com/documentation#!/common/categories you shoud pass your API key in header

you can get an API key from here: https://developers.zomato.com/api#headline2

passing api key in parameters makes it difficult for clients to keep their APIkeys secret, they tend to leak keys on a regular basis. A better approach is to pass it in header of request url. You can set user-key header in your code equals to your api key. For testing your request Url you can use Postman app in google chrome.

send a get request to your endpoint by setting user-key header to your api-key. You can refer to this postman screenshot to see it is working:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM