Retrieve current user
GET
/user
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.wpengineapi.com/v1/user"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <credentials>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.wpengineapi.com/v1/user';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.wpengineapi.com/v1/user \ --header 'Authorization: Basic <credentials>'Returns the authenticated user, identified by the credentials used for the request. API credentials have the same access levels as the user they belong to.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Returns a User object.
Media typeapplication/json
object
id
required
string
first_name
string
last_name
string
email
required
string
phone_number
string
Example
{ "id": "fd8e24a5-1f16-4b80-af5f-d748bcc9e64d", "first_name": "Joe", "last_name": "Smith", "email": "joe@gmail.com", "phone_number": "123456789"}Authentication Error
Media typeapplication/json
object
message
required
A message regarding the error that occurred on the server
string
documentation_url
(Optional) A URL where documentation regarding this specific error can be found
string
Example
{ "message": "Bad Credentials"}Too many requests
Service unavailable