Created
March 10, 2015 17:18
-
-
Save nl5887/0f70d642f6c91f33535e to your computer and use it in GitHub Desktop.
Slack invite by email
This file contains 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 characters
v := url.Values{} | |
v.Set("email", "email") | |
v.Set("channels", "channel") | |
v.Set("first_name", "firstname") | |
v.Set("token", "xox-") | |
v.Set("set_active", "true") | |
v.Set("_attempts", "1") | |
url := fmt.Sprintf("https://%s.slack.com/api/users.admin.invite?t=%d", "team", time.Now().Unix()) | |
var err error | |
var resp http.Response | |
if resp, err = http.PostForm(url, v); err != nil { | |
panic(err) | |
} | |
var msg map[string]interface | |
if err = json.NewDecoder(resp.Body).Decode(&msg); err !=nil { | |
panic(err) | |
} | |
fmt.Printf("%#v", msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment