Shell / curl example

Shell / curl example

This shell script calculates hash code with shasum to APIHASH-environment variable and then makes the call with curl.

Some shell versions has different parameters for echo-command syntax. It is best to use bash shell, but other shells might also work.

#! bash
PRIVATEKEY="...your private key..."
PUBLICKEY="...your public key..."
APISALT=`date +%s`
APIHASH=`echo -n "$PRIVATEKEY$PUBLICKEY$APISALT" | shasum -a 256  | cut -d " " -f 1`
curl -v "https://gillie.io/api/customers?apikey=$PUBLICKEY&apisalt=$APISALT&apihash=$APIHASH"