Issue with call API using Postman
-
I am trying to access Smart API using Postman, but stuck at generate JWT token. I made POST request with https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword but it return 400 Bad Request.
Below parameters I passed along with request:
Headers
PrivateKey: API_KEYRequest body
{
"clientcode":"clientid",
"password":"password"
}Can anyone please suggest any solution or correct way to make Smart API request from Postman?
-
Hi, I am facing the same issue can you please help me if your are able to fix this?
-
@nitish-bane
You need to pass Complete header with above api.headers : {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-UserType': 'USER',
'X-SourceID': 'WEB',
'X-ClientLocalIP': 'CLIENT_LOCAL_IP',
'X-ClientPublicIP': 'CLIENT_PUBLIC_IP',
'X-MACAddress': 'MAC_ADDRESS',
'X-PrivateKey': 'API_KEY'
} -
@Kartik-Upadhyay @admin I m not getting about below four parameters USER,WEB,LOCAL IP and API_KEY , also please let me know that would I have to input , 8 digit Api key or Secret Key which I have created through Angel smart Api while sending request through Postman Software ?
-
@sarvesh-kumar
'USER' AND 'WEB' USE AS IT IS.
LOCAL IP : 192.168.1.50 (any ip)
You don't need secret key for loginbypassword api.Use your 8 digit app key.
-
@Kartik-Upadhyay Thank You so much Kartik for faster reply. I kept USER , WEB as it is and LOCAL ip/mac id through ipconfig/all and took public ip through google by search "my ip" but still getting below error in Postman software :
Status : 200ok
{
"success": false,
"message": "Invalid Token",
"errorCode": "AG8001",
"data": ""
}For your kind information , I did not enter anywhere my client id and password.
I have used below info in postman software :
https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpDataType : POST
and body below :{
"data": {
"exchange":"NSE",
"tradingsymbol":"SBIN-EQ",
"symboltoken":"3045"
}
}Please check it if possible.