Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

 

ITR API
Specification
Doc 
(Confidential) 
(ITRAPI:NoGUI) 
 
 
Version  Date  Author  Description 
1.0  29-Oct-2019  Justin(digiverifier.com)  Initialdraft 

2.0  04-08-2021  Sri ram eswar  Version2-ITR 


 with no captcha 
       

       

       

       

       

       

       

 
 
 
 

CONTENTS:
1. Obtain transactionid of user 
 
1. Generate(POST)accesstoken 
 
2. Generate(POST)transactionid 
 
2. POST logininfo/credentials 
 
3. GET report

METHODS:
Obtain transaction id of user 
 
1.Generate accesstoken:
With provided “client_id” and“ client_secret”make a post request to generate
“access_token”. 
 
Request :
 

Method  https://api-oauth2.digiverifier.com/itr/generate-
post/ 
POST   

 
 
 

Type  Params  Values 


POS client_id s
T client_se t
POS cret  r
T  i
n
g
s
t
r
i
n
g
 
 Curlcode(Linux command line):
Curlcode (Linux command line):
Curl-XPOST”https://api-oauth2.digiverifier.com/itr/generate-post/”\
Curl-XPOST”https://api-oauth2.digiverifier.com/itr/generate-post/”\
-H”Content-Type:application/json”\
-H”Content-Type:application/json”\
-d ’{client_id”: “be43605-8358-4917-b34d-3880aadd1b9a”,
-d ’{client_id”: “be43605-8358-4917-b34d-3880a”, “client_secret”:”tvJSDzyodgyDcfb7sq7”
“client_secret”:”tvJSDzyodgyDcfb7sq76kE2K”

Below is the response that generates the accesstoken.

SAMPLE PYTHON CODE (GENERATES ACCESSTOKEN)


import pandas as pd
 
import requests
 

import response

response=requests.post("https://api-oauth2.digiverifier.com/itr/generate-post/",headers={'Content-
Type':'application/json'}, json={'client_id':'af5cc093-26d6-424d-8825-
582e26e1a10','client_secret':'31VegAwO2iLr1wBeR72mTEvn'})

token=pd.read_json(response.text)

print('Access token is generated:',token['message'][0])

print(response.json())
>>>>>Access token is generated: c343b46e-94c1-41da4fd-154b16efba21  
{'message': {'access_token': ' c343b46e-94c1-41da4fd-154b16efba21’,
'client_id': 'af5cc093-26d6-424d-8825-582e26ae1a10', 'client_name':
'justin', 'expires_in': 900, 'created_time': 1676871583}, 'code':
'success', 'success': True}

 
Success   Code    message  
true   Sucess   {  
'access_token': access_token ,
‘'client_id': client_id, 'expires_in':
SECONDS,  
'created_time': TIME  
}  
false   Internal_error   Client id is not correct  
false   Internal_error   Client id is not reqistered  
false   Internal_error     
client id and client secret is not
provided  
  

 
1.2) Generate transaction id:
We now use the generated“access_token”in the previou step as “Authorization”header. 
Other than this header, there is no other post parameter. Make a get request
to generate thetransactionid. 

Method  https://api-oauth2.digiverifier.com/itr/transaction-get/  
GET   

 
Type  Header  Values 
       
       
POST  c343b46e-94c1-41d5-a4fd-154b16efba21  string 
 
 
 
 
 

Statu Response 

200  { 
'message':
string,‘success
’:
Boolean,‘code’:
string 

 

S
SAMPLE PYTHON CODE (GENERATE TRANSACTION ID):
 
 
 
response = requests.get("https://api-oauth2.digiverifier.com/itr/transaction-get/",

headers={'accept':'application/json','bearer':token['message'][0]})

tid=response.json()

print("Transaction id is generated:" ,tid['message'],'\n')

>>>>>Transaction id is generated:
ITR173445462486011373287969304688869622404
{'message': 'ITR173445462486011373287969304688869622404', 'code':
'success', 'success': 'True'}
Response 
 

 
 

2.POSTlogininfo/credentials :
Using credentials and login parameters from previous request,make a post
request to trigger report fetch a the API backend. 
 

Method  https://api-oauth2.digiverifier.com/itr/submit-  
post/?txnid=<transactionid>   
 
POST  <transactionid>   

Type  Params  Values 


POST  itr-user  string 
  itr-pwd  string 
     
     
     

 
 

SAMPLE PYTHON CODE (TRIGGER REPORT FETCH)


response=requests.post("https://api-oauth2.digiverifier.com/itr/submit-post/?
txnid="+str(tid['message']),headers={'accept':'application/json',
'Bearer':token['message'][0],'txnid':tid['message']},
json={'itr-user':'username','username':'user_pwd'})
print('')
print(response.json())
 

3.GET report 
 
It takes around 60 seconds to complete report generation at the backend after
previous step of submitting credentials. A simple get request along with access
token and transactionid information can be used to obtain the report. We can
obtain the report in either ‘json’ or ‘xml’ format by using two possible URL’s.See
python sample code below to obtain the report. 
 
By default, the transactionid and json report associated with it expires in 20 minutes. 

 
Method  Get report in ‘json’ format: 
http:/https://api-oauth2.digiverifier.com/itr/  
report-get/?format=json&txnid=<txnid>   
   
Or,to get the report in ‘xml’ format: 
http://1http:/https://api-oauth2.digiverifier.com/itr/report-get/?
format=xml&txnid=<txnid> 

GET   
SAMPLE PYTHON CODE (GET REPORT IN JSON FORMAT):
 
  respon=requests.get('https://api-oauth2.digiverifier.com/itr/report- get/?
txnid='+str(tid['message'])+'&format=json',
headers={'accept':'application/json','Bearer':token['message'][0]})
respon.text

 
SAMPLE PYTHON CODE (GET REPORT IN XML FORMAT):
responx=requests.get('https://api-oauth2.digiverifier.com/itr/report-get/?
txnid='+str(tid['message'])+'&format=xml',

headers={'accept':'application/json','Bearer':token['message'][0]})
responx.text
 
Response 

     

"$": { 
"ay":"", 
"fy":"" 
}, 
"TDSs":[ 

"TDS":[ 

"$":{ 
"amount":"", 
"date":"", 
"deductor":"", 
"section":"", 
"tan":"", 
"tds":"" 

}, 






true  success_empty   

 
  l {"Form26ASInfo": 
(Empty report but
  Personal {"TDSDetails":[{}], 
  details  "PersonalDetails":[{“$”: 
obtained) 
  {"name":"Mr.ABC", 
  "address":"HOUSENO.1,STREEC, 
  KARNATAKA,5600XX","dob":"01/01/1990", 
  "email":"abc@gmail.com","mobile": 
  "8000000000","gender":"Female","pan": 
  "AZXXX4444J","panStatus":"Active", 
  "proxy_ip":"13.XXX.XXX.XX"} 
  } 
  ] 
  } 
  }', 
false invalid_usr_pwd  Invalid username or password 

false  invalid_captcha  Invalid captcha" 

false  internal_error  Invalid transactionid 

false  internal_error  Redis key error 

false  internal_error  Key error 

false  internal_error  Service unavailable 

false  service_unavailable  Login page unavailable 

false  internal_error  Json decodeerror 

false  internal_error  Connection error 

false  session_expire  Session expires 

false  internal_error  Checkbox not visible 

false  internal_error  Assesment page not available 

false  internal_error  Profile settings not available 

false  Internal_error  Other errors 

false  internal_error  Request timeout 

false  internal_error  Proxy request timeout 

false  internal_error  Transactionid expires 

false  internal_error  Invalid transactionid 

 
 

Glossary 
 
Conventions 
 Client-Client application. 
 Status-HTTP status code of response. 
 All response are in JSON format. 
 
Status Codes 
All status codes are standard HTTP status codes. The below ones are used in
this API. 
 
2XX-Successofsomekind 
4XX-Erroroccurredinclient’spart 
5XX-Erroroccurredinserver’spart 

SUMMARY:

Status Status  Description 


Code  (in redirecturl) 
200  success  OK 

201  success  Form26ASsuccessfullyfetchedbutempty 

401  invalid_usr_pwd  Invalid username or password 

402  invalid_captcha  Invalid captcha 

504  service_unavailable  Cannot fetch ITR login page (It maybe


down) 
507  session_expires  Session expire(Try again after few minutes) 

You might also like