0
{
    "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

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!

Sudheesh R
  • 1,767
  • 3
  • 23
  • 43

2 Answers2

0

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

Harish Kamboj
  • 887
  • 12
  • 32
  • Sir, i have the API key and in the documentation part of Zomato API , I've already used the key in the parameter section. And then i am using the request URL. I am not getting what you are telling me!! – abhishek adhikari Jul 14 '17 at 07:11
0

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:

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96