Comments (4)
I just saw that client.margin()
should work according to the docs. But, it's not really working. When I try in Python I get NoneType object is not subscriptable. And I didn't have any luck proceeding with normal HTTP request. Any idea why it's not working?
Here's the code
import requests
url = "https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V3/Margin"
data = {
"head": {
"appName": "5P52xxxxxx",
"appVer": "1.0",
"key": "xxxxxxx",
"osName": "Android",
"requestCode": "5PMarginV3",
"userId": "xxxxxx",
"password": "xxxxxxx"
},
"body": {
"ClientCode": "52xxxxxx"
}
}
headers = {
"Content-Type": "application/json"
}
r = requests.post(url, json = data)
print(r.status_code)
print(r.json())
I get this:
200
{'body': {'ClientCode': '52xxxxxx', 'EquityMargin': [], 'Message': 'Invalid Session', 'Status': 9, 'TimeStamp': '/Date(1607779798712+0530)/'}, 'head': {'responseCode': '5PMarginV3', 'status': '0', 'statusDescription': 'Success'}}
Anybody can help me, please?
from py5paisa.
yes the 5paisa support for api is really pathetic. The request seems to be going properly. I do not know how to make it work. I had also tried it and then gave up. you may try to escalate your issue in 5paisa support
from py5paisa.
@shalabhgoel13 This guy also had the same issue, but somehow he's successful with it... Check this: #30
Let's see, I'm mailing support. At least proper tests should have been written, so they understand it that it's not working...
from py5paisa.
Cool!
Somehow it looks like it's working now. (Or maybe because it's not market hours?) But anyway, I think it would also work during market hours, I'm closing the issue. client.margin()
works perfectly.
from py5paisa.
Related Issues (20)
- TOTP login is not working HOT 1
- Close websocket connection HOT 1
- issue with the same script price HOT 2
- How to get Response Token using code for Login? HOT 2
- getting wrong status for mcx in Market status API
- order updated through websocket HOT 1
- How to reuse the session? HOT 2
- Live feed is not working
- Unable to establish web socket connection for market feed HOT 2
- Automatic authentication HOT 5
- Couldn't read data anymore from the API's
- not able to install liberary on google collab
- not able to install the py5paisa on google collab and AWS sagemaker
- Error while installing latest version using pip HOT 1
- Invalid syntax and deprecated readme
- RemoteOrderID is not being used while placing order on MCX
- Inconsistent behaviour between Tradestation website and API - Cash Orders on NSE generate errors like 'Scrip Not Available for Trading" - but can place order for same scrip on Tradestation website
- Incorrect response for Futures data
- Major Bug: self.payload not being reset
- Lack of Clear API Responses for User Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py5paisa.