Created
September 11, 2012 00:43
Revisions
-
sud0n1m renamed this gist
Sep 11, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ echo "Caddy v 0.1 from Customer.io" ENDPOINT="https://app.customer.io/api/v1/customers/" SITEID="YOUR SITE ID" APIKEY="YOUR API KEY" INPUT=users.csv OLDIFS=$IFS -
sud0n1m created this gist
Sep 11, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash echo "Caddy v 0.1 from Customer.io" ENDPOINT="http://customerio.dev/api/v1/customers/" SITEID="49b19b01ac8c16dcc50c" APIKEY="ea680d288837bf95acdb" INPUT=users.csv OLDIFS=$IFS IFS=, [ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } while read id email created_at first last do curl -i $ENDPOINT$id \ -X PUT \ -u $SITEID:$APIKEY \ -d created_at=$created_at\ -d email=$email \ -d first=$first \ -d last=$last done < $INPUT IFS=$OLDIFS