Session Test: Session not set Create Staff

Staff Management

manage_staff
    curl -X POST https://your-site-url.com/staff/save \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your_jwt_token_here" \
    -d '{
        "clientId": "client1",
        "tp_first_name": "John",
        "tp_last_name": "Doe",
        "tp_qualification": "MSc Computer Science",
        "tp_contact_number": "1234567890",
        "tp_address": "123 Main St, City, Country",
        "tp_hire_date": "2023-01-01",
        "tp_username": "johndoe",
        "tp_email": "john.doe@example.com",
        "tp_password": "password123",
        "tp_role_id": 1
    }'

  //for updating staff
  curl -X POST https://your-site-url.com/staff/save \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your_jwt_token_here" \
    -d '{
        "clientId": "client1",
        "staff_id": 1,  # The ID of the staff member to update
        "tp_first_name": "John",
        "tp_last_name": "Doe",
        "tp_qualification": "MSc Computer Science",
        "tp_contact_number": "1234567890",
        "tp_address": "123 Main St, City, Country",
        "tp_hire_date": "2023-01-01",
        "tp_username": "johndoe",
        "tp_email": "john.doe@example.com",
        "tp_password": "password123",
        "tp_role_id": 1
    }'


Staff App Login

    curl -X POST https://schoolapi.indexscreener.in/staff/applogin \
    -H "Content-Type: application/json" \
    -d '{"username": 0 , "username": "all", "clientId":"clientId1" }'

Staff Sync

    curl -X POST https://schoolapi.indexscreener.in/staff/sync \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"time": 0 , "mode": "all"}'

Staff Overview

is_view
    curl -X POST https://schoolapi.indexscreener.in/staff/overview \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"staff_id": 10 }'

Staff List

is_view
    curl -X POST https://schoolapi.indexscreener.in/staff/list \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"limit": 10, "offset": 0, "status": null }'

ID First Name Last Name Role
cURL Commands to Test the API

Search

    curl -X POST https://schoolapi.indexscreener.in/staff/search \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "searchTerm": "John", "roleName": "Teacher"}'

manage_attendance

Mark Attendance

    curl -X POST https://schoolapi.indexscreener.in/staff/attendance/mark \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1, "date": "2024-07-20", "status": "Present"}'

Get Attendance

    curl -X POST https://schoolapi.indexscreener.in/staff/attendance/get \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1, "start_date": "2024-07-01", "end_date": "2024-07-31"}'

is_view

List Attendance by Staff

curl -X POST \
    'https://schoolapi.indexscreener.in/staff/attendance/list' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'clientId: YOUR_CLIENT_ID' \
    -d '{
      "staff_id": "123", "from_date":"2024-07-01", "to_date":"2024-07-01", "academic_year_id":''
  }'
  

Get Config

    curl -X POST https://schoolapi.indexscreener.in/staff/getConfig \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1  }'
    curl -X POST https://schoolapi.indexscreener.in/staff/setConfig \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "key": 'pin', "value":1234  }'
    curl -X POST https://schoolapi.indexscreener.in/staff/setBulkConfig \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1 ,"configData" : {
        "search": {
          "student": true,
          "staff": true,
          "parents": true,
          "events": false
        },
        "pages": {
          "myclass": {
            "is_view": true,
            "is_attendance": true,
            "is_homework": true
          },
          "dashboard": {
            "show_stats": true
          }
        },
        "pin": 1234
        }  
    
    
    }'

Deleting Staff Attendance

curl -X POST \
    'https://schoolapi.indexscreener.in/staff/attendance/delete' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'clientId: YOUR_CLIENT_ID' \
    -d '{
      "attendance_id": "456"
  }'
  

Apply Leave

    curl -X POST https://schoolapi.indexscreener.in/staff/leave/apply \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1, "start_date": "2024-07-25", "end_date": "2024-07-30", "type": "Vacation", "info": "sick", "status": "Pending"}'

Get Leaves

    curl -X POST https://schoolapi.indexscreener.in/staff/leave/get \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "staff_id": 1 , "from_date":"2024-07-01", "to_date":"2024-07-01", "offset" : 0, "limit" : 10 }'

Update Leave Status

    curl -X POST https://schoolapi.indexscreener.in/staff/leave/update \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
    -d '{"clientId": "client1", "leave_id": 1,  "reply" : "",   "status": "Approved"  }'

Create Staff (ADMIN - First time only )





















Staff permissions

curl -X POST https://schoolapi.indexscreener.in/staff/permissions -H "Authorization: Bearer your_jwt_token_here"

    


Reset Account Password

If you have a REST API endpoint for resetting an account password, you could use curl like this: Reset Account (Send Access Code to Email):
curl -X POST -d "identifier=user@example.com" http://example.com/staff/resetAccount

Verify Access Code and Set New Password:

curl -X POST -d "identifier=user@example.com&access_code=123456&newPassword=NewPassword123" http://example.com/staff/verifyAccessCode

Save HomeWork


  curl -X POST 'https://schoolapi.example.com/staff/homework/save' \
    -F 'class_id=10' \
    -F 'staff_id=123' \
    -F 'message=Refer to the attached image for details.' \
    -F 'attachment=@/home/user/images/homework.png;type=image/png'


Response

        {
            "status": 1,
            "message": "Homework saved successfully",
            "data": {
                "id": "125",
                "file_name": "assignment.docx",
                "file_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            }
        }
        
    

Delete Homework

    curl -X POST "http://your-domain.com/staff/homework/delete" \
    -H "Content-Type: application/json" \
    -d '{
      "id": 10
    }'
    

3. List Homework by Staff

curl -X POST "http://your-domain.com/staff/homework/list" \
    -H "Content-Type: application/json" \
    -d '{
      "staff_id": 123,
      "last_homework_id": 0
    }'
    

Response
{
    "status": 1,
    "data": [
        {
            "id": "123",
            "class_id": "10",
            "message": "Complete the exercises on page 42.",
            "file_name": "exercises.pdf",
            "file_type": "application/pdf",
            "created": "2023-10-01 14:30:00",
            "class_name": "Mathematics"
        },
        {
            "id": "124",
            "class_id": "10",
            "message": "Study for the upcoming test.",
            "file_name": null,
            "file_type": null,
            "created": "2023-10-02 09:15:00",
            "class_name": "Mathematics"
        }
    ],
    "totalRecords": 2,
    "limit": 10,
    "offset": 0
}