To use the Inqud API you need to get an API id and secret keys.
Below you can find the request headers which are used for the token-based authentication:
X-Token-API-Id - Identifier of the token (started with TKN- prefix)
X-Token-API-Secret - Token secret
X-Token-API-Id - Identifier of the token (started with TKN- prefix)
X-HMAC-SHA256-Signature - HMAC Signature
X-Salt - Salt (nonce)
Signature = HmacSHA256 function of (Request body + salt) hashed by token secret in HEX
Here is an example of how to get a balance with the signature of the request in python
import requests
id = 'TKN-6c1296b8-6929-443b-ac06-f732e0e27be1'
secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"
headers = {}
headers['X-Token-API-Id'] = id
headers['X-Token-API-Secret'] = secret
url = 'https://api.inqud.com/v1/user/wallet/balances'
http_response = requests.get(url=url, headers=headers)
print(str(http_response.content.decode()))
import hashlib
import hmac
import requests
import secrets
base_url = 'https://api.inqud.com'
token_id = "TKN-6c1296b8-6929-443b-ac06-f732e0e27be1"
token_secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"
salt = secrets.token_hex(32)
data = ''
data_s = data + salt
dig = hmac.new(token_secret.encode('utf-8'), msg=data_s.encode('utf-8'),
digestmod=hashlib.sha256).digest()
signature = dig.hex()
headers = {'X-Token-API-Id': token_id,
'X-HMAC-SHA256-Signature': signature,
'X-Salt': salt}
url = base_url + '/v1/user/wallet/balances'
http_response = requests.get(url=url, headers=headers)
import hashlib
import hmac
import requests
import secrets
import json
base_url = 'https://api.inqud.com'
token_id = "TKN-6c1296b8-6929-443b-ac06-f732e0e27be1"
token_secret = "dBajIp3wHnw5euxohPiZvsCEorG3Fhl9gsHl1UIBlsImHjWRdSJdp4Gh6e3y2PNs"
salt = secrets.token_hex(32)
data = {"amount": 50, "cardNumber": "5555555555554444", "firstName": "John",
"lastName": "Doe", "phoneNumber": "+111111111111",
"method": "CC_VISAMC", "currency": "USD"}
data_s = json.dumps(data) + salt
dig = hmac.new(token_secret.encode('utf-8'), msg=data_s.encode('utf-8'),
digestmod=hashlib.sha256).digest()
signature = dig.hex()
headers = {
'X-Token-API-Id': token_id,
'X-HMAC-SHA256-Signature': signature,
'X-Salt': salt
}
url = base_url + '/v1/user/payments/payout'
http_response = requests.post(url=url, headers=headers, json=data)