Get the 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 currently authenticated user
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”The currently authenticated user
Media type application/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 type application/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
Media type application/json
Service unavailable
Media type application/json