Skip to content

User API

Api endpoints for user management.

/users/{id} GET

Returns a single user by their ID from the database.

Parameters

Path Parameters

NameTypeDescriptionOptional
idStringThe ID of the user to retrieve. This is a long fiedl to test somethingNo

Query Parameters

NameTypeDescriptionOptional
selectStringThe fields to select.Yes
includeStringThe fields to include.Yes

HTTP Response Codes

Request

bash
curl -X GET "https://api.8base.com/ck0j7z5zq000001l6z1z7z5zq" \
     -H "Content-Type: application/json" \
     -H "Authorization
javascript
const axios = require('axios');

axios
  .get('https://api.8base.com/ck0j7z5zq000001l6z1z7z5zq', {
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer YOUR_API_TOKEN',
    },
  })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error);
  });

Response

json
{
  "data": {
    "user": {
      "id": "ck0j7z5zq000001l6z1z7z5zq",
      "email": "user@gmail.com",
      "firstName": "John",
      "lastName": "Doe",
      "createdAt": "2021-08-01T00:00:00.000Z",
      "updatedAt": "2021-08-01T00:00:00.000Z"
    }
  }
}
json
{
  "data": {
    "user": {
      "id": "String",
      "email": "String",
      "firstName": "String",
      "lastName": "String",
      "createdAt": "String",
      "updatedAt": "String"
    }
  }
}