Skip to content

Instantly share code, notes, and snippets.

@fatmatto
Last active February 29, 2016 14:07
Show Gist options
  • Save fatmatto/4d50ee51c73c7883a4f9 to your computer and use it in GitHub Desktop.
Save fatmatto/4d50ee51c73c7883a4f9 to your computer and use it in GitHub Desktop.
Generate a marketcloud token with curl
#!/bin/bash
timestamp=$(date +%s)
hashedSecret=$(echo -n "YOUR_SECRET_KEY$timestamp" | openssl sha256 -binary | base64)
curl -XPOST -H "Content-Type: application/json" -d "{\"publicKey\" : \"YOUR_PUBLIC_KEY\",\"secretKey\" : \"${hashedSecret}\",\"timestamp\" : ${timestamp}}" http://api.marketcloud.it/v0/tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment