Quick Start
Good to know: A quick start guide can be good to help folks get up and running with your API in a few steps. Some people prefer diving in with the basics rather than meticulously reading every page of documentation!
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
In order to use our APIs, you have to request an access and a refresh token through HTTPs request. The life time of these tokens are 6 hours and 2 days respectively.
post
https://api.lenmo.app/api/v3
/api/token/
Python
cURL
import requests
import json
password = 'XvMoPkQ2345'
url = 'https://api.lenmo.app/api/token/'
body = {'email': '[email protected]','password':'{}'.format(password)}
headers = {
'Accept': 'application/json',
}
r = requests.post(url, json = body, headers = headers)
#Fetch the 'access' token from the resultant request
access_token = json.loads(r.text)['access']
refresh_token = json.loads(r.text)['refresh']
curl -X POST "https://api.lenmo.app/api/token/"
-H "accept: application/json"
-d "{ \"email\": \"[email protected]\", \"password\": \"XvMoPkQ2345\"}"
...
Whenever the access token expires, the user can request a new access token. As long as the refresh token is valid, .i.e. within two days of token pair generation, a new token can be generated. If the refresh token expires, please request a new token pair, access and refresh.
post
https://api.lenmo.app/api/v3
/api/token/refresh/
Python
cURL
import requests
import json
refresh_token = # Valid Refresh token, within 2 days of creation.
url = 'https://staging.lenmo.app/api/token/refresh/'
body = {'refresh': '{}'.format(refresh_token)}
headers = {
'Accept': 'application/json'
}
r = requests.post(url, headers=headers, json=body)
access_token = json.loads(r.text)['access']
curl -X POST "https://api.lenmo.app/api/token/refresh/"
-H "accept: application/json"
-d "{ \"refresh\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\""
...
Once you have a valid token, you can start using our APIs. Please, refer to API reference for an example that shows you steps to fund loans.
Last modified 6mo ago