from py5paisa import FivePaisaClient
cred={
"APP_NAME":"YOUR APP_NAME",
"APP_SOURCE":"YOUR APP_SOURCE",
"USER_ID":"YOUR USER_ID",
"PASSWORD":"YOUR PASSWORD",
"USER_KEY":"YOUR USERKEY",
"ENCRYPTION_KEY":"YOUR ENCRYPTION_KEY"
}
#This function will automatically take care of generating and sending access token for all your API's
client = FivePaisaClient(cred=cred)
OAUTH Approach
VendorKey is UesrKey for individuals user
Pass the token received in the response url after successful login to get an access token (this also sets the token for all the APIs you use)-
Please note that you need to copy the request token from URL and paste in this code and start the code within 30s.
client.get_oauth_session('Your Response Token')
here i get the request token using my vendorkey and responseurl. and I put the request token in place of "your response token" and run the code but, it says invalid response token. is this the right way to login?
from py5paisa import FivePaisaClient
cred={
"APP_NAME":"YOUR APP_NAME",
"APP_SOURCE":"YOUR APP_SOURCE",
"USER_ID":"YOUR USER_ID",
"PASSWORD":"YOUR PASSWORD",
"USER_KEY":"YOUR USERKEY",
"ENCRYPTION_KEY":"YOUR ENCRYPTION_KEY"
}
#This function will automatically take care of generating and sending access token for all your API's
client = FivePaisaClient(cred=cred)
OAUTH Approach
First get a token by logging in to -> https://dev-openapi.5paisa.com/WebVendorLogin/VLogin/Index?VendorKey=&ResponseURL=
VendorKey is UesrKey for individuals user
for e.g. you can use ResponseURL as https://www.5paisa.com/technology/developer-apis
Pass the token received in the response url after successful login to get an access token (this also sets the token for all the APIs you use)-
Please note that you need to copy the request token from URL and paste in this code and start the code within 30s.
client.get_oauth_session('Your Response Token')
here i get the request token using my vendorkey and responseurl. and I put the request token in place of "your response token" and run the code but, it says invalid response token. is this the right way to login?