1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
timestamp = str(round(datetime.now().timestamp()))
secret_key = "YOUR_SECRET_KEY"
path = "/api/v1/api/ping"
url = "https://app.pallapay.com" + path
prepared_str = "GET" + path + timestamp
signature_str = hmac.new(
bytes(secret_key, 'latin-1'),
msg=bytes(prepared_str, 'latin-1'),
digestmod=hashlib.sha256
).hexdigest().lower()
headers = {
"Accept": "application/json",
'X-Palla-Api-Key': "YOUR_API_KEY",
'X-Palla-Sign': signature_str,
'X-Palla-Timestamp': timestamp
}
response = requests.get(url=url, headers=headers)
result = json.loads(response.text)
print(result)
# {'data': {'result': 'pong'}, 'message': 'Operation was successful', 'is_successful': True}