Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Obtain transaction id of user

Generate access token


With provided “client_id” and “client_secret”, make a post request to generate “access_token”.

Request

Metho http://ec2-13-233-217-249.ap-south-
d 1.compute.amazonaws.com:4500/epfo/generate-post/

POST

Type Params Values

PO client_id str
ST client_secr ing
et str
ing

Sample python code(Generate acess token)


response=requests.post(
"http://ec2-13-233-217-249.ap-south-1.compute.amazonaws.com:4500/epfo/generate-post/",
headers={
'Content-Type':'application/json'
},
json={
'client_id':'af5cc093-26d6-424d-8825-582e26ae1a10',
'client_secret':'31VegAwOG2iLr1wBeR72mTEvn'
}
)

print(response.json())
Response

>>> {'message': {'access_token': 'c343b46e-94c1-41d5-a4fd-154b16efba21',


'client_id': ' c41d1eba-6a34-453c-85e8-3571db8630b',

'expires_in': 900,

'created_time': 1562754835},

'code': 'success',

'success': True}

sucess Code message


True sucess {"access_token":
"f64c8179-ebaf-486f-94a0-
4492923bb359",
"client_id": "af5cc093-
26d6-424d-8825-
582e26ae1a10",
"client_name": "justin",
"expires_in": 900,
"created_time":
1646974494}
false Internal error client secret is not correct

false Internal error client id is not registered

false Internal error client id and client secret is


not provided

Generate transaction id
We now use the generated “access_token” in the previous step as “Authorization” header.

Other than this header, there is no other post parameter. Make a get request to
generate the transaction id.

Request

Method http://ec2-13-233-217-249.ap-south-
1.compute.amazonaws.com:4500/epfo/transaction-get/

GET
Type Header Values

POST c343b46e-94c1-41d5-a4fd-154b16efba21 string

Sample python code(Generate Transaction id)


response2=requests.post(
"http://ec2-13-233-217-249.ap-south-1.compute.amazonaws.com:4500/
/epfoemployer/transaction-get/",
headers= {
'accept':'application/json',
'Bearer': "<access-token>"
}
)

print (response2.json())

Response

{'message': 'EPFOEMPLOYER181264392702507931100529319290713666160',
'code': 'success',
'success': 'True'}

sucess Code message


True sucess 'EPFOEMPLOYER181264392702
5079311005293192907136661
60'
false Internal error Token is invalid for the client

false Internal error Token gets expired

POST login info/credentials


Using credentials and login parameters from previous request, make a post
request to trigger report fetch at the API backend.
Request

Metho http://ec2-13-233-217-249.ap-south-
d 1.compute.amazonaws.com:4500/epfo/submit-post/?
txnid=<transactionid>

Type Params Values

POST epfoemployer-user string

epfoemployer-pwd String

employee-uan string

Sample python code(Get report in json format)


response3=requests.post(
"http://ec2-13-233-217-249.ap-south-1.compute.amazonaws.com:4500/
/epfo/submit-post/? txnid=<transactionid>”,
headers={
'accept':'application/json',
'Bearer': "<access-token>",
'txnid':’<transaction-id>’
},
json={
"employee-uan":uan
}
)

print(response3.json())

Response

{'code': 'success', 'message': [{'uan': 101076072949, 'name': 'MOHANA SUNDARI S',


'company': 'SOBHA LIMITED', 'doj': '25/04/2018', 'doe': 'NOT_AVAILABLE'}, {'uan':
101076072949, 'name': 'MOHANA SUNDARI S', 'company': 'VEN CONSULTING INDIA PVT
LTD', 'doj': '27/02/2017', 'doe': '28/02/2018'}], 'success': True}
sucess Code message
True sucess

{'code': 'success',
'message': [{'uan':
101076072949, 'name':
'MOHANA SUNDARI S',
'company': 'SOBHA
LIMITED', 'doj':
'25/04/2018', 'doe':
'NOT_AVAILABLE'}, {'uan':
101076072949, 'name':
'MOHANA SUNDARI S',
'company': 'VEN
CONSULTING INDIA PVT
LTD', 'doj':
'27/02/2017', 'doe':
'28/02/2018'}],
'success': True}

false
invalid_usr_pwd invalid username or
password

false
internal_error invalid transactionid

false Internal error


service unavailable

GET report
It takes around 60 seconds to complete report generation at the backend after the 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 ‘json’ format by using
the URL. See python sample code below to obtain the report.
By default, the transactionid and json report associated with it expires in 20 minutes.

Request

Metho Get report in ‘json’ format:


d
http://ec2-13-233-217-249.ap-south-
1.compute.amazonaws.com:4500/epfoemployer
/report-get/txnid=<txnid>

GET

Sample python code(Get report in json format)


response4=requests.post(
"http://ec2-13-233-217-249.ap-south-1.compute.amazonaws.com:4500/
/epfo/report-get/? txnid=<transactionid>”,
headers={
'accept':'application/json',
'Bearer': "<access-token>",
'txnid':’<transaction-id>’
},
)

print (response4.json())

Response
{'code': 'success', 'message': [{'uan': 101076072949, 'name': 'MOHANA SUNDARI S',
'company': 'SOBHA LIMITED', 'doj': '25/04/2018', 'doe': 'NOT_AVAILABLE'}, {'uan':
101076072949, 'name': 'MOHANA SUNDARI S', 'company': 'VEN CONSULTING INDIA PVT
LTD', 'doj': '27/02/2017', 'doe': '28/02/2018'}], 'success': True}

You might also like