Invalid API key
-
@Moderator_3 instead of successfull connection, i am getting invalid api error when try to retrieve top gainer and loser
successfull connection
-
his code i am try last 7 day but not work can you give me advice
-
-
Hello @sunil_modi
I can see you are missing some of the key in your headers So can you please cross check your headers with the below attached link under the Header Parameters section
and please update accordingly
Kindly modify the below points too
1- Replace "X-API-KEY" with X-PrivateKey
2- The value of Autherization key should be Bearer eyJhbGciOiJIUzUxMiJ9........ not f and also both are inside the double quotes
https://smartapi.angelbroking.com/docs/ResponseStructureRegards,
SmartAPI Team -
@Moderator_1 i have this much of headers
still getting invalid API key error instead of getting 200 status code
This time i tried to get my holding and i try to retrieve top loser and gainer. In both case getting same issue.
-
@sunil_modi
Please open Command Prompt on Windows by typing cmd and then run this command:ipconfig\all
The physical address in the response is your mac address and you should pass the same for X-macaddress in the request header.
Similarly you'll see IP address in the response as well. Copy and paste this in the request headers for both X-publicIP and X-clientIP.Regards
SmartAPI Team -
@Moderator_1 would yu please tell me what to give as a value to
X-publicIP and XClientIP. as i am running this code locallly as of now -
Hi @sunil_modi,
Please pass all the Header Parameters as described in the documentation. As I can see from your request body, you have only passed content-type, x-api-key and Authorization in the headers. please pass the rest of the values as described in this documentation pageRegards
SmartAPI Team -
@Moderator_1 Yes i have checked APP is active and i am able to retrieve jwt token from data object
still getting invalid api key error
-
Hi @sunil_modi,
Have you checked on the SmartAPI Developer console that your app is active?
This error usually comes when the is app is set to inactive. Are you able to do other API calls and fetch data from them? Please let us know. then we will be able to troubleshoot your issue.Regards
SmartAPI Team