PlaceOrder API gives blank output
-
@admin V187845
-
HI @VIJAY-KADTAN Your entered qty is 1, Try below request and update us:
{
"variety":"NORMAL",
"tradingsymbol":"BANKNIFTY26AUG2132500PE",
"symboltoken":"50616",
"transactiontype":"BUY",
"exchange":"NFO",
"ordertype":"MARKET",
"producttype":"CARRYFORWARD",
"duration":"DAY",
"quantity":"25"
} -
@admin I made changes (quantity 1 ->25) but still response is BLANK..
Also suggest you for any any issue..never give BLANK response, response should be Failure with reason or at least ERROR ..but never give BLANK response..It is very dangerous when project goes live.. -
@VIJAY-KADTAN
request:
{
"variety":"NORMAL",
"tradingsymbol":"BANKNIFTY26AUG2132500PE",
"symboltoken":"50616",
"transactiontype":"BUY",
"exchange":"NFO",
"ordertype":"MARKET",
"producttype":"CARRYFORWARD",
"duration":"DAY",
"quantity":"25"
}res:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"script": "BANKNIFTY26AUG2132500PE",
"orderid": "210825000000026"
} -
Hi @VIJAY-KADTAN It is working fine at our end as posted above the requests and the response.
-
@admin Your request shown not looks in Python..Which language should use?
-
HI @VIJAY-KADTAN We tested it in postman.
-
@admin Please test in Python and replay. I tried today again its still not working..
-
HI @VIJAY-KADTAN ok
-
This post is deleted! -
@admin From where to download SmartConnect lib
-
HI @VIJAY-KADTAN said in PlaceOrder API gives blank output:
@admin From where to download SmartConnect lib
Kindly go through below thread.
https://github.com/angelbroking-github/smartapi-python -
@admin i am now trying SmartConnect
Give following outputException while retriving IP Address,using local host IP address HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001D846B5A130>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))
This is my feedtoken:: 0931788167
{'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'clientcode': 'V187845', 'name': 'VIJAY KADTAN', 'email': '', 'mobileno': '', 'exchanges': ['bse_cm', 'cde_fo', 'nse_cm', 'nse_fo', 'mcx_fo', 'ncx_fo'], 'products': ['BO', 'NRML', 'CO', 'CNC', 'MIS', 'MARGIN'], 'lastlogintime': '', 'broker': ''}}Here output windows first take some time 3-4 sec..then show error and then sow output..
My code is
from smartapi import SmartConnect
####generate session #####obj =SmartConnect(api_key="1GjVLyP9")
login = obj.generateSession('V187845', 'xxxxxxxx')
refreshToken = login['data']['refreshToken']
feedToken = obj.getfeedToken()
print ("This is my feedtoken::",feedToken)
userProfile= obj.getProfile(refreshToken)
print (userProfile)
-
Hi @VIJAY-KADTAN As seen through remote access(anydesk) the code form our end seems to be working fine you need to debug code from your end.
-
@admin pls at least solve this issue of Max retries
Exception while retriving IP Address,using local host IP address HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001D846B5A130>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')) -
HI @VIJAY-KADTAN Kindly follow below thread for correct codes:
https://smartapi.angelbroking.com/topic/1194/basic-smartapi-integration-using-python -
@admin Todays somes automatic entries appear in my order book.
SBIN BUY @425
I am not hitting or testing any API. Is you do some testing from your side..Pls clear.
It happens 3-4 days before also.. -
HI @VIJAY-KADTAN Please reset your password.