Who am I?¶
GET/
Who-am-I API · whoami
Returns information about the caller.
Request samples¶
curl -X GET "https://api.central.sophos.com/whoami/v1/" -H "Authorization: Bearer <access-token>"
import requests
response = requests.get(
"https://api.central.sophos.com/whoami/v1/",
headers={
"Authorization": "Bearer <access-token>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/whoami/v1/" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.central.sophos.com/whoami/v1/", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api.central.sophos.com/whoami/v1/", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Information about the caller.¶
Response fields
idstring (uuid)requiredID of the caller.
idTypestringThe type of the ID of the caller.
Must be one of:
Must be one of:
partner, organization, distributor, tenant.apiHostsobjectAPI hosts that are available to the caller.
Show child attributesHide child attributes
globalstring (uri)dataRegionstring (uri)