General Endpoints

Authentication

Employee Signup

  • Endpoint: POST /signupEmployee

  • Description: Register a new employee account. Supports all profile fields and file uploads in a single step. Uses multipart/form-data.

  • Request (multipart/form-data):

    • full_name (string, required)

    • email (string, required)

    • password (string, required)

    • address (string, optional)

    • phone_number (string, optional)

    • short_bio (string, optional)

    • disability (string, optional)

    • skills (string, optional, comma-separated or JSON array)

    • resume (file, optional, PDF only, max 5MB)

    • profile_pic (file, optional, JPG/JPEG/PNG/GIF, max 5MB)

    • pwd_id_front (file, optional, image)

    • pwd_id_back (file, optional, image)

  • Sample Request (curl):

curl -X POST "http://your-api-url/signupEmployee" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "full_name=Richard Gomex" \
  -F "email=rarara12@gmail.com" \
  -F "password=12345678" \
  -F "address=Quezon City" \
  -F "phone_number=09123456789" \
  -F "short_bio=asfdassfasfassf" \
  -F "disability=Pilay" \
  -F "skills=AWS,Figma,SEO,Python,Java" \
  -F "resume=@/path/to/resume.pdf" \
  -F "profile_pic=@/path/to/profile.jpg" \
  -F "pwd_id_front=@/path/to/pwd-front.jpg" \
  -F "pwd_id_back=@/path/to/pwd-back.jpg"
  • Sample Response:

{
  "Status": "Successfull",
  "Message": "Richard Gomex has been successfully signed up",
  "Details": [
    {
      "id": 24,
      "user_id": "932ffa37-61d3-41a4-b621-94d9d834e032",
      "full_name": "Richard Gomex",
      "disability": "Pilay",
      "skills": "AWS,Figma,SEO,Python,Java",
      "created_at": "2025-06-13T15:53:47.207587+00:00",
      "role": "employee",
      "resume_url": "https://.../resume_sample.pdf?",
      "profile_pic_url": "https://.../77.jpg?",
      "address": "Quezon City",
      "phone_number": "09123456789",
      "short_bio": "asfdassfasfassf",
      "pwd_id_front_url": "https://.../pwdidfront/...",
      "pwd_id_back_url": "https://.../pwdidback/...",
      "email": "rarara12@gmail.com"
    }
  ]
}
  • Tips for React Native (Employee Frontend):

    • Use FormData to build the request.

    • Use expo-image-picker for images and expo-document-picker for PDFs.

    • Example:

      const formData = new FormData();
      formData.append('full_name', 'Richard Gomex');
      // ...other fields
      formData.append('resume', { uri: resume.uri, type: 'application/pdf', name: resume.name });
      formData.append('profile_pic', { uri: profilePic.uri, type: 'image/jpeg', name: 'profile.jpg' });
      await fetch('http://your-api-url/signupEmployee', { method: 'POST', body: formData });
    • Always check file size and type before upload.

    • Omit fields you don't want to set.


Employer Signup

  • Endpoint: POST /signupEmployer

  • Description: Register a new employer account. Supports company logo upload. Uses multipart/form-data.

  • Request (multipart/form-data):

    • email (string, required)

    • password (string, required)

    • company_name (string, required)

    • company_level (string, required)

    • website_url (string, required)

    • company_type (string, required)

    • industry (string, required)

    • admin_name (string, required)

    • description (string, required)

    • location (string, required)

    • tags (string, required)

    • file (file, required, JPG/JPEG/PNG/GIF, max 5MB)

  • Sample Request (curl):

curl -X POST "http://your-api-url/signupEmployer" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "email=test12@gmail.com" \
  -F "password=your_secure_password" \
  -F "company_name=BlaBla Inc." \
  -F "company_level=Medium" \
  -F "website_url=blbla.com" \
  -F "company_type=LLC" \
  -F "industry=Technology" \
  -F "admin_name=John Stuart" \
  -F "description=agsdfhgashjkfghjas" \
  -F "location=London" \
  -F "tags=hiring" \
  -F "file=@/path/to/your/logo.jpg"
  • Sample Response:

{
  "Status": "Successfull",
  "Message": "BlaBla Inc. has been successfully signed up",
  "Details": "data=[{...employer fields..., 'logo_url': 'https://.../companylogo/...'}] count=None"
}
  • Tips for Web Frontend (Employer):

    • Use a standard HTML <form> with enctype="multipart/form-data" or use FormData in JavaScript.

    • Example with Axios:

      const formData = new FormData();
      formData.append('email', 'test12@gmail.com');
      // ...other fields
      formData.append('file', logoFile);
      await axios.post('http://your-api-url/signupEmployer', formData, { headers: { 'Content-Type': 'multipart/form-data' } });
    • Validate file type and size before upload.

    • Omit fields you don't want to set.


Employee Login

  • Endpoint: POST /login-employee

  • Description: Authenticate an employee and create a session. Returns an access token for subsequent requests.

  • Request (JSON):

    {
      "email": "test12@gmail.com",
      "password": "your_secure_password"
    }
  • Sample Request (curl):

    curl -X POST "http://your-api-url/login-employee" \
      -H "Content-Type: application/json" \
      -d '{
        "email": "test12@gmail.com",
        "password": "your_secure_password"
      }'
  • Sample Response:

    {
      "Status": "Success",
      "Message": "Login successful. Session stored in Redis.",
      "App User ID": "f9b86db6-93dc-4e29-a1be-6dfcb114b8f7",
      "Debug Session Key": "session:f9b86db6-93dc-4e29-a1be-6dfcb114b8f7",
      "Stored User ID": "f9b86db6-93dc-4e29-a1be-6dfcb114b8f7"
    }
  • Error Response:

    {
      "Status": "Error",
      "Message": "Invalid credentials"
    }
  • React Native Implementation:

    const loginEmployee = async (email, password) => {
      try {
        const response = await fetch('http://your-api-url/login-employee', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({
            email: email,
            password: password
          })
        });
        
        const data = await response.json();
        
        if (data.Status === 'Success') {
          // Store the session key for future requests
          await AsyncStorage.setItem('sessionKey', data['Debug Session Key']);
          await AsyncStorage.setItem('userId', data['App User ID']);
          return data;
        } else {
          throw new Error(data.Message);
        }
      } catch (error) {
        console.error('Login error:', error);
        throw error;
      }
    };

Employer Login

  • Endpoint: POST /login-employer

  • Description: Authenticate an employer and create a session. Returns an access token for subsequent requests.

  • Request (JSON):

    {
      "email": "rarara12@gmail.com",
      "password": "your_secure_password"
    }
  • Sample Request (curl):

    curl -X POST "http://your-api-url/login-employer" \
      -H "Content-Type: application/json" \
      -d '{
        "email": "rarara12@gmail.com",
        "password": "your_secure_password"
      }'
  • Sample Response:

    {
      "Status": "Success",
      "Message": "Login successful. Session stored in Redis.",
      "App User ID": "148cc1c6-2e81-4037-913c-7617564baa33",
      "Debug Session Key": "session:148cc1c6-2e81-4037-913c-7617564baa33",
      "Stored User ID": "148cc1c6-2e81-4037-913c-7617564baa33"
    }
  • Web Implementation (JavaScript):

    const loginEmployer = async (email, password) => {
      try {
        const response = await fetch('http://your-api-url/login-employer', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({
            email: email,
            password: password
          })
        });
        
        const data = await response.json();
        
        if (data.Status === 'Success') {
          // Store the session key for future requests
          localStorage.setItem('sessionKey', data['Debug Session Key']);
          localStorage.setItem('userId', data['App User ID']);
          return data;
        } else {
          throw new Error(data.Message);
        }
      } catch (error) {
        console.error('Login error:', error);
        throw error;
      }
    };

Logout

  • Endpoint: POST /logout

  • Description: Logout user and invalidate session token.

  • Headers Required:

    • Authorization: Bearer <access_token>

  • Request: No body required

  • Sample Request (curl):

    curl -X POST "http://your-api-url/logout" \
      -H "Authorization: Bearer <access_token>"
  • Sample Response:

    {
      "Status": "Success",
      "Message": "Successfully logged out"
    }
  • Implementation Example:

    const logout = async () => {
      try {
        const token = localStorage.getItem('sessionKey'); // or AsyncStorage for React Native
        
        const response = await fetch('http://your-api-url/logout', {
          method: 'POST',
          headers: {
            'Authorization': `Bearer ${token}`
          }
        });
        
        const data = await response.json();
        
        if (data.Status === 'Success') {
          // Clear stored session data
          localStorage.removeItem('sessionKey');
          localStorage.removeItem('userId');
          return data;
        }
      } catch (error) {
        console.error('Logout error:', error);
      }
    };

Profile Management

View Profile

  • Endpoint: GET /view-profile

  • Description: Get the current user's profile information. Works for both employees and employers.

  • Headers Required:

    • Authorization: Bearer <access_token>

  • Request: No body required

  • Sample Request (curl):

    curl -X GET "http://your-api-url/view-profile" \
      -H "Authorization: Bearer <access_token>"
  • Sample Response (Employee):

    {
      "Profile": {
        "id": 24,
        "user_id": "932ffa37-61d3-41a4-b621-94d9d834e032",
        "full_name": "Richard Gomez",
        "email": "rarara12@gmail.com",
        "role": "employee",
        "disability": "Pilay",
        "skills": "AWS,Figma,SEO,Python,Java",
        "address": "Quezon City",
        "phone_number": "09123456789",
        "short_bio": "Experienced developer with PWD",
        "resume_url": "https://.../resume_sample.pdf",
        "profile_pic_url": "https://.../profile.jpg",
        "pwd_id_front_url": "https://.../pwd_front.jpg",
        "pwd_id_back_url": "https://.../pwd_back.jpg",
        "created_at": "2025-06-13T15:53:47.207587+00:00"
      }
    }
  • Sample Response (Employer):

    {
      "Profile": {
        "id": 3,
        "user_id": "148cc1c6-2e81-4037-913c-7617564baa33",
        "email": "rarara12@gmail.com",
        "role": "employer",
        "company_name": "BlaBla Inc.",
        "company_level": "Medium",
        "website_url": "blbla.com",
        "company_type": "LLC",
        "industry": "Technology",
        "admin_name": "John Stuart",
        "description": "Leading tech company",
        "location": "London",
        "tags": "hiring",
        "logo_url": "https://.../logo.jpg",
        "created_at": "2025-06-03T08:16:25.221844+00:00"
      }
    }
  • Implementation Example:

    const viewProfile = async () => {
      try {
        const token = localStorage.getItem('sessionKey'); // or AsyncStorage for React Native
        
        const response = await fetch('http://your-api-url/view-profile', {
          method: 'GET',
          headers: {
            'Authorization': `Bearer ${token}`,
            'Content-Type': 'application/json'
          }
        });
        
        const data = await response.json();
        
        if (data.Profile) {
          return data.Profile;
        } else {
          throw new Error(data.Message || 'Failed to fetch profile');
        }
      } catch (error) {
        console.error('Profile fetch error:', error);
        throw error;
      }
    };

Profile Management

Update Employee Profile

  • Endpoint: POST /update-profile/employee

  • Description: Update an employee's profile information. All fields except PWD ID Front and PWD ID Back can be updated. Resume and profile picture can be uploaded. Only non-empty fields are updated; omitted or empty fields are ignored and not overwritten.

  • Headers Required:

    • Authorization: Bearer <access_token>

  • Request (multipart/form-data):

    • full_name (string, optional)

    • address (string, optional)

    • phone_number (string, optional)

    • short_bio (string, optional)

    • disability (string, optional)

    • skills (string, optional, comma-separated or JSON array)

    • resume (file, optional, PDF only, max 5MB)

    • profile_pic (file, optional, JPG/JPEG/PNG/GIF, max 5MB)

  • Sample Request (curl):

curl -X POST "http://your-api-url/update-profile/employee" \
  -H "Authorization: Bearer <access_token>" \
  -F "full_name=Richard Gomex" \
  -F "address=Quezon City" \
  -F "phone_number=09123456789" \
  -F "short_bio=asfdassfasfassf" \
  -F "disability=Pilay" \
  -F "skills=AWS,Figma,SEO,Python,Java" \
  -F "resume=@/path/to/resume.pdf" \
  -F "profile_pic=@/path/to/profile.jpg"
  • Sample Response:

{
  "Status": "Successfull",
  "Message": "Update successfull"
}
  • Error Responses:

{
  "Status": "Error",
  "Message": "Resume must be a PDF file"
}
{
  "Status": "Error",
  "Message": "Profile picture must be an image file (JPG, JPEG, PNG, or GIF)"
}
{
  "Status": "Error",
  "Message": "No valid fields provided for update."
}
{
  "Status": "Error",
  "Message": "A unique field value you are trying to update already exists for another employee."
}
  • Notes:

    • pwd_id_front and pwd_id_back cannot be updated via this endpoint.

    • If a file is provided but is empty, it will be ignored.

    • If a field is omitted or left empty, it will not overwrite the existing value in the database.

    • Only changed fields are updated.

    • Resume must be a PDF and profile picture must be an image (JPG, JPEG, PNG, or GIF).

    • File size for uploads is limited to 5MB each.

    • React Native Tip: Use the same FormData approach as signup. Omit fields you don't want to update.

Update Employer Profile

  • Endpoint: POST /update-profile/employer

  • Description: Update an employer's profile information. All fields from signup can be updated, including company logo. Only non-empty fields are updated; omitted or empty fields are ignored and not overwritten.

  • Headers Required:

    • Authorization: Bearer <access_token>

  • Request (multipart/form-data):

    • company_name (string, optional)

    • company_level (string, optional)

    • website_url (string, optional)

    • company_type (string, optional)

    • industry (string, optional)

    • admin_name (string, optional)

    • description (string, optional)

    • location (string, optional)

    • tags (string, optional)

    • logo (file, optional, JPG/JPEG/PNG/GIF, max 5MB)

  • Sample Request (curl):

curl -X POST "http://your-api-url/update-profile/employer" \
  -H "Authorization: Bearer <access_token>" \
  -F "company_name=BlaBla Inc." \
  -F "company_level=Medium" \
  -F "website_url=blbla.com" \
  -F "company_type=LLC" \
  -F "industry=Technology" \
  -F "admin_name=John Stuart" \
  -F "description=agsdfhgashjkfghjas" \
  -F "location=London" \
  -F "tags=hiring" \
  -F "logo=@/path/to/logo.jpg"
  • Sample Response:

{
  "Status": "Successfull",
  "Message": "Update successfull"
}
  • Error Responses:

{
  "Status": "Error",
  "Message": "Invalid logo file type. Allowed: JPG, JPEG, PNG, GIF"
}
{
  "Status": "Error",
  "Message": "Logo file size must be less than 5MB"
}
{
  "Status": "Error",
  "Message": "No valid fields provided for update."
}
{
  "Status": "Error",
  "Message": "A unique field value you are trying to update already exists for another employer."
}

Preload Check

  • Endpoint: GET /preload

  • Description: Check if a user is logged in and determine their role (employee or employer). Used for initial app loading and role-based routing.

  • Headers Required:

    • Authorization: Bearer <access_token>

  • Request: No body required

  • Sample Request (curl):

curl -X GET "http://your-api-url/preload" \
  -H "Authorization: Bearer <access_token>"
  • Sample Response (Employee):

{
  "Status": "Success",
  "isAuthenticated": true,
  "role": "employee",
  "userData": {
    "id": 32,
    "user_id": "f5cf5a60-f6d7-4754-b7cc-31ed083b0dd3",
    "full_name": "Kraken Slayer",
    "disability": "Ysywuwjj",
    "skills": "Bricklaying,Bug Reporting,Basic Veterinary Knowledge,Branding,Cash Handling",
    "created_at": "2025-06-26T07:24:44.275143+00:00",
    "role": "employee",
    "resume_url": "https://...",
    "profile_pic_url": "https://...",
    "address": "Tehwhwj",
    "phone_number": "919276362819",
    "short_bio": "Hshsjsjskmsn",
    "pwd_id_front_url": "https://...",
    "pwd_id_back_url": "https://...",
    "email": "kraken1234@gmail.com"
  }
}
  • Sample Response (Employer):

{
  "Status": "Success",
  "isAuthenticated": true,
  "role": "employer",
  "userData": {
    // Employer data fields
  }
}
  • Error Response:

{
  "Status": "Error",
  "isAuthenticated": false,
  "Message": "Not authenticated"
}
  • React Native Implementation (Employee):

const checkAuth = async () => {
  try {
    const token = await AsyncStorage.getItem('Token');
    
    const response = await fetch('http://your-api-url/preload', {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      }
    });
    
    const data = await response.json();
    
    if (data.isAuthenticated) {
      if (data.role === 'employee') {
        // Navigate to employee dashboard
        navigation.replace('EmployeeDashboard');
      } else {
        // Wrong platform, show error
        Alert.alert('Error', 'Please use the web platform for employer access');
      }
    } else {
      // Navigate to login
      navigation.replace('Login');
    }
  } catch (error) {
    console.error('Auth check error:', error);
    // Navigate to login on error
    navigation.replace('Login');
  }
};
  • Web Implementation (Employer):

const checkAuth = async () => {
  try {
    const token = localStorage.getItem('Token');
    
    const response = await fetch('http://your-api-url/preload', {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      }
    });
    
    const data = await response.json();
    
    if (data.isAuthenticated) {
      if (data.role === 'employer') {
        // Navigate to employer dashboard
        window.location.href = '/dashboard';
      } else {
        // Wrong platform, show error
        alert('Please use the mobile app for employee access');
      }
    } else {
      // Navigate to login
      window.location.href = '/login';
    }
  } catch (error) {
    console.error('Auth check error:', error);
    // Navigate to login on error
    window.location.href = '/login';
  }
};
  • Notes:

    • If a file is provided but is empty, it will be ignored.

    • If a field is omitted or left empty, it will not overwrite the existing value in the database.

    • Only changed fields are updated.

    • Logo must be an image (JPG, JPEG, PNG, or GIF), max 5MB.

    • Web Tip: Use FormData in JavaScript or a proper HTML form. Omit fields you don't want to update.


Last updated