user()
Return user data if there is a logged in user
- Javascript
- Go
- PHP
- API
const { user, error } = await kontenbase.auth.user()
Response
Name | Type | Description |
---|---|---|
res.user | object | Response for data user |
res.status | number | Response for status code |
res.statusText | string | Response for status message |
res.error | object | Response for error occurred |
note
- When using SDK you need to call
register()
orlogin()
first - When using API you need to set the Bearer
token
returned by register or login API in the header request - Get user with filter:
- lookup
const { user, error } = await kontenbase.auth.user({
lookup: ['categories'],
})
resp, err := client.Auth.User()
Response
Name | Type | Description |
---|---|---|
resp.User | map[string]interface{} | Response for data user |
resp.Status | int | Response for status code |
resp.StatusText | string | Response for status message |
note
- When using SDK you need to call
register()
orlogin()
first - When using API you need to set the Bearer
token
returned by register or login API in the header request - Get user with filter:
- lookup
resp, err := client.Auth.User()
.SetLookup("*")
$res = $kontenbase->auth->user();
Response
Name | Type | Description |
---|---|---|
$res['user'] | object | Response for data user |
$res['status'] | integer | Response for status code |
$res['statusText'] | string | Response for status message |
$res['error'] | object | Response for error occurred |
note
- When using SDK you need to call
register()
orlogin()
first - When using API you need to set the Bearer
token
returned by register or login API in the header request - Get user with filter:
- lookup
$res = $kontenbase->auth->user([
'lookup' => '*'
]);
[GET]
https://api.kontenbase.com/query/api/v1/API_KEY/auth/user