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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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!"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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!"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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...
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.