Skip to content

Instantly share code, notes, and snippets.

@ygerasimov
Created August 1, 2018 03:15
Show Gist options
  • Save ygerasimov/aed69f5cc4bd278643b3be7f1f96ca13 to your computer and use it in GitHub Desktop.
Save ygerasimov/aed69f5cc4bd278643b3be7f1f96ca13 to your computer and use it in GitHub Desktop.
Get started with Diffy API's
#!/bin/bash
TOKEN=`curl -sS -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "_username=ENCODEDEMAIL%40gmail.com&_password=ENCODEDPASSWORD" https://diffy.website/api/login_check | grep -o "token\":.*\"}" | sed "s/token\":\"//g" | sed "s/\"}//g"`
if [ -z "$TOKEN" ]
then
echo "Problem authenticating."
exit 1
fi
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"environments":"prod-stage"}' https://diffy.website/api/projects/PROJECTID/compare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment