Giter VIP home page Giter VIP logo

Comments (4)

coder-amogh avatar coder-amogh commented on June 8, 2024

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.

shalabhgoel13 avatar shalabhgoel13 commented on June 8, 2024

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.

coder-amogh avatar coder-amogh commented on June 8, 2024

@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.

coder-amogh avatar coder-amogh commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.