encode token before giving it to curl