User info retrieval in our API

We'll assume you've already got the API authentication settled and you have our API key with you (this is the Authorization header in all the examples used below).

Retrieve your team & user info #

Make a GET request to the /api/me endpoint.

$ curl https://ohdear.app/api/me \
    -H 'Authorization: Bearer bgUKSWYL30iHg5w0WTDGHfubt5L1HBTr0atAehCeSqwNTqkU9rOmsNEmWf6Y' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

If the API call succeeded, you'll be presented with your team & user info.

Return properties #

Here's an example payload of the API call.

{
  "id": 1,
  "name": "Firstname Lastname",
  "email": "you@domain.tld",
  "photo_url": "https://www.gravatar.com/avatar/...jpg",
  "teams": [
    {
      "id": 1,
      "name": "Your Team Name"
    }
  ]
}

Let's look at all the properties that are returned.

  • id: the identifier of the user this API key belongs to.
  • name, email and photo_url: personal information about your account.
  • teams: an array of teams this user belongs to. A user can be a member of several teams.

The teams property has an id (team ID) and a human readable name. The team id will be used throughout all API calls to determine what team you want to add sites to.

Was this page helpful to you? Feel free to reach out via support@ohdear.app or on Twitter via @OhDearApp if you have any other questions. We'd love to help!