// Me is
func (c *Client) Me(tenant string, authHeader string) (string, int, error) {
request := goreq.Request{
Timeout: 5000 * time.Millisecond,
Method: "GET",
Uri: c.APIURL + "/" + tenant + "/api/v1/me",
Accept: "application/json",
}
request.AddHeader("Authorization", authHeader)
res, err := request.Do()
if err != nil {
return "", 500, err
}
bodyStr, _ := res.Body.ToString()
return bodyStr, res.StatusCode, nil
}
// MeWithKey is
func (c *Client) MeWithKey(tenant string, apiKey string) (string, int, error) {
request := goreq.Request{
Timeout: 5000 * time.Millisecond,
Method: "GET",
Uri: c.APIURL + "/" + tenant + "/api/v1/me",
Accept: "application/json",
}
request.AddHeader("API-Key", apiKey)
res, err := request.Do()
if err != nil {
return "", 500, err
}
bodyStr, _ := res.Body.ToString()
return bodyStr, res.StatusCode, nil
}