MENU navbar-image

Introduction

This api documentation contains all the endpoints for the malingo project. a platform where you can effortlessly find companions for your next adventure, be it a travel buddy, a dining partner, or someone to join you for a stroll or a random conversation. Malingo is a solution that enables individuals to connect, share experiences, and foster new relationships while splitting costs or covering expenses as agreed.

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

Authenticating requests

This API is not authenticated.

Activities

Get all activities

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activity" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity"
);

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

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

Example response (200):


{
    "created_activities": [
        {
            "id": 1,
            "user_id": 1,
            "title": "Hiking Adventure",
            "ActivityPhoto": null,
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T08:19:02.000000Z",
            "updated_at": "2025-02-04T08:19:02.000000Z"
        },
        {
            "id": 2,
            "user_id": 1,
            "title": "Hiking Adventure",
            "ActivityPhoto": null,
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T08:25:56.000000Z",
            "updated_at": "2025-02-04T08:25:56.000000Z"
        },
        {
            "id": 3,
            "user_id": 1,
            "title": "Hiking Adventure",
            "ActivityPhoto": null,
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T08:36:04.000000Z",
            "updated_at": "2025-02-04T08:36:04.000000Z"
        },
        {
            "id": 4,
            "user_id": 1,
            "title": "Hiking Adventure",
            "ActivityPhoto": "activity_photos/rj6fjePPJweFYZf07s9dCtAjL84pKv12XGzWIW81.jpg",
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T09:07:10.000000Z",
            "updated_at": "2025-02-04T09:07:10.000000Z"
        },
        {
            "id": 5,
            "user_id": 1,
            "title": "Join me at Tech Chantier",
            "ActivityPhoto": "activity_photos/2bAlnxzYIELlyfUW02fyNbLIobPMGzrUj8DLtchk.jpg",
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T09:11:42.000000Z",
            "updated_at": "2025-02-04T09:11:42.000000Z"
        },
        {
            "id": 6,
            "user_id": 1,
            "title": "Join me at Tech Chantier",
            "ActivityPhoto": "activity_photos/OfdYJQsOrGOnYCKFtPDrhhv2Kp7PP5zZ40Q08Exk.jpg",
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 10,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T09:13:20.000000Z",
            "updated_at": "2025-02-04T09:13:20.000000Z"
        },
        {
            "id": 7,
            "user_id": 1,
            "title": "Join me at Tech Chantier",
            "ActivityPhoto": "activity_photos/wvnmS2UuVkm1pfcNbhqcq6ouYonmj3G5Qd2KL69x.jpg",
            "description": "A thrilling hike to the mountain peak.",
            "link": "https://example.com/hiking-event",
            "numberOfMembers": 40,
            "location": "Mount Fako, Cameroon",
            "time": "2025-02-15 08:00:00",
            "created_at": "2025-02-04T09:18:46.000000Z",
            "updated_at": "2025-02-04T09:18:46.000000Z"
        }
    ],
    "pending_activities": [],
    "accepted_activities": [],
    "declined_activities": []
}
 

Request      

GET api/activity

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a new activity

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/activity" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"Morning Run\",
    \"ActivityPhoto\": \"consequatur\",
    \"description\": \"A group run in the park.\",
    \"link\": \"https:\\/\\/zoom.com\\/meeting\",
    \"numberOfMembers\": 17,
    \"location\": \"Central Park\",
    \"time\": \"2025-01-01 10:00:00\"
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity"
);

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

let body = {
    "title": "Morning Run",
    "ActivityPhoto": "consequatur",
    "description": "A group run in the park.",
    "link": "https:\/\/zoom.com\/meeting",
    "numberOfMembers": 17,
    "location": "Central Park",
    "time": "2025-01-01 10:00:00"
};

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

Example response (201):


{
    "title": "Join me at Tech Chantier",
    "ActivityPhoto": "activity_photos/wvnmS2UuVkm1pfcNbhqcq6ouYonmj3G5Qd2KL69x.jpg",
    "description": "A thrilling hike to the mountain peak.",
    "link": "https://example.com/hiking-event",
    "numberOfMembers": "40",
    "location": "Mount Fako, Cameroon",
    "time": "2025-02-15 08:00:00",
    "user_id": 1,
    "updated_at": "2025-02-04T09:18:46.000000Z",
    "created_at": "2025-02-04T09:18:46.000000Z",
    "id": 7
}
 

Request      

POST api/activity

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

title   string  optional  

required: The title of the activity. Example: Morning Run

ActivityPhoto   file:   

The photo of the activity. type: [png, jpeg] Example: consequatur

description   string  optional  

required: The description of the activity. Example: A group run in the park.

link   string  optional  

required: The link to the activity (if any). Example: https://zoom.com/meeting

numberOfMembers   integer  optional  

the number of member to the activity is required Example: 17

location   string  optional  

required: The location of the activity. Example: Central Park

time   datetime  optional  

required: The date and time of the activity. Format: Y-m-d H:i:s. Example: 2025-01-01 10:00:00

Get activity details

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activity/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1"
);

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

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

Example response (200):


{
    "id": 5,
    "user_id": 1,
    "title": "Join me at Tech Chantier",
    "ActivityPhoto": "activity_photos/2bAlnxzYIELlyfUW02fyNbLIobPMGzrUj8DLtchk.jpg",
    "description": "A thrilling hike to the mountain peak.",
    "link": "https://example.com/hiking-event",
    "numberOfMembers": 10,
    "location": "Mount Fako, Cameroon",
    "time": "2025-02-15 08:00:00",
    "created_at": "2025-02-04T09:11:42.000000Z",
    "updated_at": "2025-02-04T09:11:42.000000Z"
}
 

Request      

GET api/activity/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

activity   integer   

The ID of the activity. Example: 1

Update an activity

requires authentication

Example request:
curl --request PUT \
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"Morning Run\",
    \"ActivityPhoto\": \"consequatur\",
    \"description\": \"A group run in the park.\",
    \"link\": \"https:\\/\\/zoom.com\\/meeting\",
    \"numberOfMembers\": 17,
    \"location\": \"Central Park\",
    \"time\": \"2025-01-01 10:00:00\"
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1"
);

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

let body = {
    "title": "Morning Run",
    "ActivityPhoto": "consequatur",
    "description": "A group run in the park.",
    "link": "https:\/\/zoom.com\/meeting",
    "numberOfMembers": 17,
    "location": "Central Park",
    "time": "2025-01-01 10:00:00"
};

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

Example response (200):


{
    "id": 5,
    "user_id": 1,
    "title": "Hiking go and hike with me",
    "ActivityPhoto": "activity_photos/uNughpq7aXWNcUTYFOgFBFEFxqcr3DeY60PuOwNu.jpg",
    "description": "this is a good activity",
    "link": "https//wa.me/237672474539",
    "numberOfMembers": "10",
    "location": "buea",
    "time": "2025-02-15 08:00:00",
    "created_at": "2025-02-04T09:11:42.000000Z",
    "updated_at": "2025-02-04T11:35:10.000000Z"
}
 

Request      

PUT api/activity/{id}

PATCH api/activity/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

activity   integer   

The ID of the activity to update. Example: 1

Body Parameters

title   string  optional  

: The title of the activity. Example: Morning Run

ActivityPhoto   file:  optional  

The photo of the activity. type: [png, jpeg] Example: consequatur

description   string:  optional  

The description of the activity. Example: A group run in the park.

link   string:  optional  

The link to the activity (if any). Example: https://zoom.com/meeting

numberOfMembers   integer  optional  

the number of member to the activity is required Example: 17

location   string:  optional  

The location of the activity. Example: Central Park

time   datetime:  optional  

The date and time of the activity. Format: Y-m-d H:i:s. Example: 2025-01-01 10:00:00

Delete an activity

requires authentication

Example request:
curl --request DELETE \
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1"
);

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

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

Example response (200):


{
    "message": "Activity deleted successfully"
}
 

Request      

DELETE api/activity/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

activity   integer   

The ID of the activity to delete. Example: 1

Activity

Retrieve a list of users who have joined a particular activity.

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activities/1/joined-users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/1/joined-users"
);

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

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

Example response (200):


"join_requests": [
       {
           "id": 3,
           "activity_id": 6,
           "user_id": 2,
           "status": "pending",
           "created_at": "2025-04-06T10:16:03.000000Z",
           "updated_at": "2025-04-06T10:16:03.000000Z",
           "activity": {
               "id": 6,
               "title": "React and React Native Bootcamp Conference",
               "location": "buea, Cameroon",
               "time": "2025-02-15 08:00:00"
           },
           "user": {
               "id": 2,
               "name": "Ambo Njock",
               "email": "ambo@gmail.com"
           }
       }
   ]
}
 

Example response (404):


{
    "message": "Activity not found"
}
 

Request      

GET api/activities/{id}/joined-users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the activity. Example: 1

activityId   integer   

The ID of the activity. Example: 17

Activity Management

Join an activity

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/1/join" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"activity_id\": 17
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/1/join"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "activity_id": 17
};

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

Example response (201):


{
    "message": "Join request sent successfully.",
    "join_request": {
        "user_id": 2,
        "status": "pending",
        "activity_id": 5,
        "updated_at": "2025-02-04T12:16:50.000000Z",
        "created_at": "2025-02-04T12:16:50.000000Z",
        "id": 1
    }
}
 

Example response (400):


{
    "message": "You have already requested to join this activity."
}
 

Request      

POST api/activities/{activity_id}/join

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

activity_id   integer   

The ID of the activity. Example: 1

Body Parameters

activity_id   integer   

The ID of the activity to join. Example: 17

GET api/activities/user

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activities/user" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/user"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


{
"created_activities": [
   {
       "id": 1,
       "user_id": 1,
       "title": "Hiking Adventure",
       "ActivityPhoto": null,
       "description": "A thrilling hike to the mountain peak.",
       "link": "https://example.com/hiking-event",
       "numberOfMembers": 10,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T08:19:02.000000Z",
       "updated_at": "2025-02-04T08:19:02.000000Z"
*    },
   {
       "id": 2,
        "user_id": 1,
       "title": "Hiking Adventure",
        "ActivityPhoto": null,
        "description": "A thrilling hike to the mountain peak.",
     "link": "https://example.com/hiking-event",
        "numberOfMembers": 10,
        "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T08:25:56.000000Z",
       "updated_at": "2025-02-04T08:25:56.000000Z"
   },
   {
       "id": 3,
       "user_id": 1,
       "title": "Hiking Adventure",
       "ActivityPhoto": null,
       "description": "A thrilling hike to the mountain peak.",
       "link": "https://example.com/hiking-event",
       "numberOfMembers": 10,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T08:36:04.000000Z",
       "updated_at": "2025-02-04T08:36:04.000000Z"
   },
   {
       "id": 4,
       "user_id": 1,
       "title": "Hiking Adventure",
       "ActivityPhoto": "activity_photos/rj6fjePPJweFYZf07s9dCtAjL84pKv12XGzWIW81.jpg",
       "description": "A thrilling hike to the mountain peak.",
       "link": "https://example.com/hiking-event",
       "numberOfMembers": 10,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T09:07:10.000000Z",
       "updated_at": "2025-02-04T09:07:10.000000Z"
   },
   {
       "id": 5,
       "user_id": 1,
       "title": "Join me at Tech Chantier",
       "ActivityPhoto": "activity_photos/2bAlnxzYIELlyfUW02fyNbLIobPMGzrUj8DLtchk.jpg",
       "description": "A thrilling hike to the mountain peak.",
       "link": "https://example.com/hiking-event",
       "numberOfMembers": 10,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T09:11:42.000000Z",
       "updated_at": "2025-02-04T09:11:42.000000Z"
   },
   {
       "id": 6,
       "user_id": 1,
       "title": "Join me at Tech Chantier",
        "ActivityPhoto": "activity_photos/OfdYJQsOrGOnYCKFtPDrhhv2Kp7PP5zZ40Q08Exk.jpg",
        "description": "A thrilling hike to the mountain peak.",
        "link": "https://example.com/hiking-event",
       "numberOfMembers": 10,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T09:13:20.000000Z",
       "updated_at": "2025-02-04T09:13:20.000000Z"
   },
   {
       "id": 7,
       "user_id": 1,
       "title": "Join me at Tech Chantier",
       "ActivityPhoto": "activity_photos/wvnmS2UuVkm1pfcNbhqcq6ouYonmj3G5Qd2KL69x.jpg",
       "description": "A thrilling hike to the mountain peak.",
       "link": "https://example.com/hiking-event",
       "numberOfMembers": 40,
       "location": "Mount Fako, Cameroon",
       "time": "2025-02-15 08:00:00",
       "created_at": "2025-02-04T09:18:46.000000Z",
       "updated_at": "2025-02-04T09:18:46.000000Z"
   }
   ],
   "pending_activities": [],
   "accepted_activities": [],
   "declined_activities": []
}
 

Request      

GET api/activities/user

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

Activity Request

Accept a join request

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/join-request/1/accept" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"joinRequest_id\": 1
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/join-request/1/accept"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "joinRequest_id": 1
};

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

Example response (200):


{
    "message": "Join request accepted",
    "whatsapp_link": "https://wa.me/1234567890"
}
 

Example response (403):


{
    "message": "Unauthorized"
}
 

Request      

POST api/join-request/{joinRequest_id}/accept

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

joinRequest_id   integer   

The ID of the joinRequest. Example: 1

Body Parameters

joinRequest_id   integer   

The ID of the join request to accept. Example: 1

Decline a join request

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/join-request/1/decline" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"joinRequest_id\": 1
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/join-request/1/decline"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "joinRequest_id": 1
};

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

Example response (200):


{
    "message": "Your request to join this activity has been declined"
}
 

Example response (403):


{
    "message": "Unauthorized"
}
 

Request      

POST api/join-request/{joinRequest_id}/decline

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

joinRequest_id   integer   

The ID of the joinRequest. Example: 1

Body Parameters

joinRequest_id   integer   

The ID of the join request to decline. Example: 1

Get join requests for user's activities

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activities/join-requests" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/join-requests"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


{
    "join_requests": [
        {
            "id": 1,
            "activity_id": 5,
            "user_id": 2,
            "status": "pending",
            "created_at": "2025-02-04T12:16:50.000000Z",
            "updated_at": "2025-02-04T12:16:50.000000Z",
            "activity": {
                "id": 5,
                "title": "Join me at Tech Chantier",
                "location": "Mount Fako, Cameroon",
                "time": "2025-02-15 08:00:00"
            },
            "user": {
                "id": 2,
                "name": "Nkwi Cyril",
                "email": "nkwicyril@gmail.com"
            }
        }
    ]
}
 

Request      

GET api/activities/join-requests

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

Request leave from an activity

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1/leave" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"activity_id\": 17
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activity/1/leave"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "activity_id": 17
};

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

Example response (201):


{
    "message": "Leave request sent successfully",
    "leaveRequest": {
        "user_id": 2,
        "activity_id": 9,
        "status": "pending",
        "updated_at": "2025-02-04T13:16:58.000000Z",
        "created_at": "2025-02-04T13:16:58.000000Z",
        "id": 1
    }
}
 

Example response (403):


{
    "message": "You are not a participant in this activity"
}
 

Request      

POST api/activity/{activity_id}/leave

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

activity_id   integer   

The ID of the activity. Example: 1

Body Parameters

activity_id   integer   

The ID of the activity. Example: 17

Approve a leave request

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/leave-requests/17/approve" \
    --header "Authorization: string required The authentication token. Example: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"leaveRequest_id\": 1
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/leave-requests/17/approve"
);

const headers = {
    "Authorization": "string required The authentication token. Example: Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "leaveRequest_id": 1
};

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

Example response (200):


{
    "message": "The leave request has been approved"
}
 

Example response (403):


{
    "message": "You are not authorized to approve this request"
}
 

Request      

POST api/leave-requests/{leaveRequest_id}/approve

Headers

Authorization      

Example: string required The authentication token. Example: Bearer {token}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

leaveRequest_id   integer   

The ID of the leaveRequest. Example: 17

Body Parameters

leaveRequest_id   integer   

The ID of the leave request to approve. Example: 1

Authentication

Endpoints for user registration, login, and logout.

Register a new user

Create a new user account and generate an authentication token.

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"John Doe\",
    \"email\": \"john@example.com\",
    \"password\": \"secretpassword\",
    \"password_confirmation\": \"secretpassword\"
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/register"
);

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

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

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

Example response (201):


{
    "user": {
        "name": "Nkuma Confident",
        "email": "nsem@gmail.com",
        "updated_at": "2025-02-04T08:18:33.000000Z",
        "created_at": "2025-02-04T08:18:33.000000Z",
        "id": 1
    },
    "token": "1|zoNArNwtRQijtSUA8qLUAFctGhOI1W1OUnVRm0GZcc1b2217"
}
 

Example response (422):


{
    "message": "The email has already been taken. (and 1 more error)",
    "errors": {
        "email": [
            "The email has already been taken."
        ],
        "password": [
            "The password field confirmation does not match."
        ]
    }
}
 

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The user's full name. Example: John Doe

email   string   

The user's email address. Example: john@example.com

password   string   

The user's password (minimum 6 characters). Example: secretpassword

password_confirmation   string   

The confirmation of the password. Example: secretpassword

Log in an existing user

Authenticate a user using email and password, and generate an authentication token.

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"john@example.com\",
    \"password\": \"secretpassword\"
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/login"
);

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

let body = {
    "email": "john@example.com",
    "password": "secretpassword"
};

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

Example response (200):


{
    "user": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com",
        "created_at": "2025-01-21T10:00:00",
        "updated_at": "2025-01-21T10:00:00"
    },
    "token": "1|laravel_sanctum_token_string_here"
}
 

Example response (401):


{
    "message": "Invalid credentials"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The selected email is invalid."
        ]
    }
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The user's email address. Example: john@example.com

password   string   

The user's password. Example: secretpassword

Log out the current user Revoke all of the user's tokens to log them out.

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/logout"
);

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

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

Example response (200):


{
    "message": "Successfully logged out"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Request      

POST api/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Endpoints

Get a single user's public profile

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/users/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/users/consequatur"
);

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

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

Example response (404):

Show headers
cache-control: no-cache, private
content-type: application/json
 

{
    "message": "The route malingo/public/api//api/users/consequatur could not be found."
}
 

Request      

GET api/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the user. Example: consequatur

General User Enpoints

GET api/user

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/user" \
    --header "reguires: a toke" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/user"
);

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

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

Example response (200):


{
    "id": 2,
    "name": "Nkwi Cyril",
    "email": "nkwicyril@gmail.com",
    "email_verified_at": null,
    "created_at": "2025-02-04T09:37:07.000000Z",
    "updated_at": "2025-02-04T09:37:07.000000Z"
}
 

Request      

GET api/user

Headers

reguires      

Example: a toke

Content-Type      

Example: application/json

Accept      

Example: application/json

Profile Management

Edit User Profile

requires authentication

Example request:
curl --request POST \
    "https://rrn24.techchantier.com/malingo/public/api/api/user/edit-profile" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "age=17"\
    --form "mobile_number=consequatur"\
    --form "profile_picture=@C:\Users\NSEM CONFIDENT NJOCK\AppData\Local\Temp\php1F0B.tmp" 
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/user/edit-profile"
);

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

const body = new FormData();
body.append('age', '17');
body.append('mobile_number', 'consequatur');
body.append('profile_picture', document.querySelector('input[name="profile_picture"]').files[0]);

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

Example response (200):


{
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "age": 30,
    "mobile_number": "+1234567890",
    "profile_picture": "path/to/profile/picture.jpg"
}
 

Example response (422):


{
    "message": "Validation failed",
    "errors": {
        "mobile_number": [
            "The mobile number format is invalid"
        ]
    }
}
 

Request      

POST api/user/edit-profile

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

age   integer  optional  

optional User's age Example: 17

mobile_number   string  optional  

optional User's mobile number Example: consequatur

profile_picture   file  optional  

optional User's profile picture Example: C:\Users\NSEM CONFIDENT NJOCK\AppData\Local\Temp\php1F0B.tmp

Get Current User Profile

requires authentication

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/user/profile" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/user/profile"
);

const headers = {
    "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": "john@example.com",
    "age": 30,
    "mobile_number": "+1234567890",
    "profile_picture": "path/to/profile/picture.jpg"
}
 

Request      

GET api/user/profile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Searching

Filter activities by title, description, date, and location Retrieve activities based on specified filters.

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/activities/filter?title=consequatur&description=Dolores+dolorum+amet+iste+laborum+eius+est+dolor.&date=consequatur&location=consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"location\": \"consequatur\"
}"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/activities/filter"
);

const params = {
    "title": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "date": "consequatur",
    "location": "consequatur",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "title": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "location": "consequatur"
};

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

Example response (200):


[
    {
        "id": 5,
        "user_id": 1,
        "title": "Hiking go and hike with me",
        "ActivityPhoto": "activity_photos/QDEBUm8GSGbdAFob56QOh4EidyLtgFR5NckhQFBQ.jpg",
        "description": "this is a good activity",
        "link": "https//wa.me/237672474539",
        "numberOfMembers": 10,
        "location": "buea",
        "time": "2025-02-15 08:00:00",
        "created_at": "2025-02-04T09:11:42.000000Z",
        "updated_at": "2025-02-04T11:43:41.000000Z"
    }
]
 

Example response (400):


{
    "message": "Invalid date format, please use a valid date"
}
 

Request      

GET api/activities/filter

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

title   string  optional  

optional Filter by title. Example: consequatur

description   string  optional  

optional Filter by description. Example: Dolores dolorum amet iste laborum eius est dolor.

date   string  optional  

optional Filter by date (format: y-m-d). Example: consequatur

location   string  optional  

optional Filter by location. Example: consequatur

Body Parameters

title   string  optional  

Example: consequatur

description   string  optional  

Example: Dolores dolorum amet iste laborum eius est dolor.

date   string  optional  
location   string  optional  

Example: consequatur

Search activities by parameter or specific fields Search for activities using a general parameter or specific field filters.

Example request:
curl --request GET \
    --get "https://rrn24.techchantier.com/malingo/public/api/api/search/consequatur?title=consequatur&description=Dolores+dolorum+amet+iste+laborum+eius+est+dolor.&location=consequatur&date=consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://rrn24.techchantier.com/malingo/public/api/api/search/consequatur"
);

const params = {
    "title": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "location": "consequatur",
    "date": "consequatur",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


[
    {
        "id": 5,
        "user_id": 1,
        "title": "Hiking go and hike with me",
        "ActivityPhoto": "activity_photos/QDEBUm8GSGbdAFob56QOh4EidyLtgFR5NckhQFBQ.jpg",
        "description": "this is a good activity",
        "link": "https//wa.me/237672474539",
        "numberOfMembers": 10,
        "location": "buea",
        "time": "2025-02-15 08:00:00",
        "created_at": "2025-02-04T09:11:42.000000Z",
        "updated_at": "2025-02-04T11:43:41.000000Z"
    }
]
 

Request      

GET api/search/{parameter?}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

parameter   string  optional  

optional General search term to find across title, description, and location. Example: consequatur

Query Parameters

title   string  optional  

optional Filter by title. Example: consequatur

description   string  optional  

optional Filter by description. Example: Dolores dolorum amet iste laborum eius est dolor.

location   string  optional  

optional Filter by location. Example: consequatur

date   string  optional  

optional Filter by date (format: y-m-d). Example: consequatur