Python example

Python

Python example.

import hmac
import hashlib
import base64
import requests
import json
import time

public_key =  "... your public key here..."
private_key = "... your private key here..."
url = "https://gillie.io/api/customers?"
api_salt = str(round(time.time()))
m = hashlib.sha256()
m.update( str.encode( private_key + public_key  + api_salt))
m.digest()
api_hash = m.hexdigest()

url = url + "apihash=" + api_hash + "&apisalt=" + api_salt + "&apikey=" + public_key
myResponse = requests.get(url)
# For successful API call, response code will be 200 (OK)
if(myResponse.ok):
    jData = json.loads(myResponse.content)
    print(jData)
else:
  # If response code is not ok (200), print the resulting http error code with description
    myResponse.raise_for_status()