MENU navbar-image

Introduction

This is the API documentation for the application.

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include a Authorization header with the value "{YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Endpoints

Register a new user

Example request:
curl --request POST \
    "http://beact.test/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"John Doe\",
    \"email\": \"johndoe@example.com\",
    \"password\": \"secret\",
    \"password_confirmation\": \"secret\"
}"
const url = new URL(
    "http://beact.test/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "John Doe",
    "email": "johndoe@example.com",
    "password": "secret",
    "password_confirmation": "secret"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "user": {
        "id": 1,
        "name": "John Doe",
        "email": "johndoe@example.com",
        "created_at": "2023-10-01T00:00:00.000000Z",
        "updated_at": "2023-10-01T00:00:00.000000Z"
    }
}
 

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the user. Example: John Doe

email   string   

The email of the user. Example: johndoe@example.com

password   string   

The password of the user. Example: secret

password_confirmation   string   

The password confirmation. Example: secret

Login a user

Example request:
curl --request POST \
    "http://beact.test/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"johndoe@example.com\",
    \"password\": \"secret\"
}"
const url = new URL(
    "http://beact.test/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "johndoe@example.com",
    "password": "secret"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "access_token": "token",
    "token_type": "Bearer"
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: johndoe@example.com

password   string   

The password of the user. Example: secret

Logout a user

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request POST \
    "http://beact.test/api/logout" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/logout"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Successfully logged out"
}
 

Request      

POST api/logout

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Send a password reset link

Example request:
curl --request POST \
    "http://beact.test/api/forgot-password" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"johndoe@example.com\"
}"
const url = new URL(
    "http://beact.test/api/forgot-password"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "johndoe@example.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "We have emailed your password reset link!"
}
 

Request      

POST api/forgot-password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: johndoe@example.com

Reset the password

Example request:
curl --request POST \
    "http://beact.test/api/reset-password" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"esse\",
    \"email\": \"johndoe@example.com\",
    \"password\": \"newpassword\",
    \"password_confirmation\": \"newpassword\"
}"
const url = new URL(
    "http://beact.test/api/reset-password"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "token": "esse",
    "email": "johndoe@example.com",
    "password": "newpassword",
    "password_confirmation": "newpassword"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Your password has been reset!"
}
 

Request      

POST api/reset-password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

token   string   

The password reset token. Example: esse

email   string   

The email of the user. Example: johndoe@example.com

password   string   

The new password of the user. Example: newpassword

password_confirmation   string   

The password confirmation. Example: newpassword

Get the authenticated user

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request GET \
    --get "http://beact.test/api/user" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "John Doe",
    "email": "johndoe@example.com",
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Request      

GET api/user

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Display a listing of the activities.

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request GET \
    --get "http://beact.test/api/activities" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/activities"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Activity 1",
    "category_id": 1,
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Request      

GET api/activities

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created activity in storage.

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request POST \
    "http://beact.test/api/activities" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Running\",
    \"category_id\": 1
}"
const url = new URL(
    "http://beact.test/api/activities"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Running",
    "category_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Running",
    "category_id": 1,
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Request      

POST api/activities

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the activity. Example: Running

category_id   integer   

The ID of the category. Example: 1

Display the specified activity.

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request GET \
    --get "http://beact.test/api/activities/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/activities/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Running",
    "category_id": 1,
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Activity not found"
}
 

Request      

GET api/activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

Update the specified activity in storage.

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request PUT \
    "http://beact.test/api/activities/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Running\",
    \"category_id\": 1
}"
const url = new URL(
    "http://beact.test/api/activities/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Running",
    "category_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Running",
    "category_id": 1,
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Activity not found"
}
 

Request      

PUT api/activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

Body Parameters

name   string   

The name of the activity. Example: Running

category_id   integer   

The ID of the category. Example: 1

Remove the specified activity from storage.

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request DELETE \
    "http://beact.test/api/activities/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/activities/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Example response (404):


{
    "message": "Activity not found"
}
 

Request      

DELETE api/activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

Display a listing of the categories

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request GET \
    --get "http://beact.test/api/categories" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/categories"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Category 1",
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Request      

GET api/categories

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created category in storage

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request POST \
    "http://beact.test/api/categories" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Electronics\"
}"
const url = new URL(
    "http://beact.test/api/categories"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Electronics"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Electronics",
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Request      

POST api/categories

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the category. Example: Electronics

Display the specified category

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request GET \
    --get "http://beact.test/api/categories/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/categories/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Electronics",
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Category not found"
}
 

Request      

GET api/categories/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the category. Example: 1

Update the specified category in storage

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request PUT \
    "http://beact.test/api/categories/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Electronics\"
}"
const url = new URL(
    "http://beact.test/api/categories/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Electronics"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Electronics",
    "created_at": "2023-10-01T00:00:00.000000Z",
    "updated_at": "2023-10-01T00:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Category not found"
}
 

Request      

PUT api/categories/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the category. Example: 1

Body Parameters

name   string   

The name of the category. Example: Electronics

Remove the specified category from storage

requires authentication

Requires a valid Sanctum token.

Example request:
curl --request DELETE \
    "http://beact.test/api/categories/1" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/categories/1"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Example response (404):


{
    "message": "Category not found"
}
 

Request      

DELETE api/categories/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the category. Example: 1

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-tap-streams" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-tap-streams"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user-tap-streams

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://beact.test/api/user-tap-streams" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"page\": \"accusamus\",
    \"duration\": 14,
    \"data\": \"[\\\"maiores\\\",\\\"labore\\\"]\"
}"
const url = new URL(
    "http://beact.test/api/user-tap-streams"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": "accusamus",
    "duration": 14,
    "data": "[\"maiores\",\"labore\"]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/user-tap-streams

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

page   string   

Example: accusamus

duration   integer   

Example: 14

data   string   

Must be a valid JSON string. Example: ["maiores","labore"]

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-tap-streams/nisi" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-tap-streams/nisi"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user-tap-streams/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user tap stream. Example: nisi

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://beact.test/api/user-tap-streams/ut" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"page\": \"magni\",
    \"duration\": 7,
    \"data\": \"[\\\"quibusdam\\\",\\\"molestiae\\\"]\"
}"
const url = new URL(
    "http://beact.test/api/user-tap-streams/ut"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": "magni",
    "duration": 7,
    "data": "[\"quibusdam\",\"molestiae\"]"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/user-tap-streams/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user tap stream. Example: ut

Body Parameters

page   string   

Example: magni

duration   integer   

Example: 7

data   string   

Must be a valid JSON string. Example: ["quibusdam","molestiae"]

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://beact.test/api/user-tap-streams/totam" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-tap-streams/totam"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/user-tap-streams/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user tap stream. Example: totam

List user activities for today for the current authenticated user.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-activities/today" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities/today"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "activity_id": 1,
      "duration": 60,
      // ...other fields...
    }
  ]
}
 

Request      

GET api/user-activities/today

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

List user activities for yesterday for the current authenticated user.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-activities/yesterday" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities/yesterday"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "activity_id": 1,
      "duration": 60,
      // ...other fields...
    }
  ]
}
 

Request      

GET api/user-activities/yesterday

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

List user activities for the last 7 days for the current authenticated user.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-activities/last7days" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities/last7days"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "activity_id": 1,
      "duration": 60,
      // ...other fields...
    }
  ]
}
 

Request      

GET api/user-activities/last7days

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

List user activities for a specific date for the current authenticated user.

requires authentication

Example request:
curl --request POST \
    "http://beact.test/api/user-activities/date" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2025-02-28T02:40:25\"
}"
const url = new URL(
    "http://beact.test/api/user-activities/date"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2025-02-28T02:40:25"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "activity_id": 1,
      "duration": 60,
      // ...other fields...
    }
  ]
}
 

Request      

POST api/user-activities/date

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

date   string   

Must be a valid date. Example: 2025-02-28T02:40:25

Display a listing of the current user's activities.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-activities" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "user_id": 1,
      "activity_id": 1,
      "duration": 60,
      // ...other fields...
    }
  ]
}
 

Request      

GET api/user-activities

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created user activity in storage.

requires authentication

Note: The user_id is taken from the authenticated user.

Example request:
curl --request POST \
    "http://beact.test/api/user-activities" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"activity_id\": \"nulla\",
    \"duration\": 1
}"
const url = new URL(
    "http://beact.test/api/user-activities"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "activity_id": "nulla",
    "duration": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
  "data": {
    "id": 1,
    "user_id": 1,
    "activity_id": 1,
    "duration": 60,
    // ...other fields...
  }
}
 

Request      

POST api/user-activities

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

activity_id   string   

The id of an existing record in the activities table. Example: nulla

duration   integer   

Example: 1

Display the specified user activity for the current user.

requires authentication

Example request:
curl --request GET \
    --get "http://beact.test/api/user-activities/nostrum" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities/nostrum"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": {
    "id": 1,
    "user_id": 1,
    "activity_id": 1,
    "duration": 60,
    "activity": {
      "id": 1,
      "name": "Running",
      "category": {
        "id": 1,
        "name": "Exercise"
      }
    }
    // ...other fields...
  }
}
 

Request      

GET api/user-activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user activity. Example: nostrum

Update the specified user activity for the current user.

requires authentication

Example request:
curl --request PUT \
    "http://beact.test/api/user-activities/odit" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"activity_id\": \"possimus\",
    \"duration\": 4
}"
const url = new URL(
    "http://beact.test/api/user-activities/odit"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "activity_id": "possimus",
    "duration": 4
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "data": {
    "id": 1,
    "user_id": 1,
    "activity_id": 1,
    "duration": 90,
    // ...other fields...
  }
}
 

Request      

PUT api/user-activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user activity. Example: odit

Body Parameters

activity_id   string   

The id of an existing record in the activities table. Example: possimus

duration   integer   

Example: 4

Remove the specified user activity from storage for the current user.

requires authentication

Example request:
curl --request DELETE \
    "http://beact.test/api/user-activities/saepe" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://beact.test/api/user-activities/saepe"
);

const headers = {
    "Authorization": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/user-activities/{id}

Headers

Authorization      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user activity. Example: saepe