1. Save Role (Add/Update) CURL Command:
curl -X POST http://yourdomain.com/api/academic/role/save \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
-d '{
    "clientId": "client1",
    "roleData": {
        "role_id": null,                # Use null for adding a new role or provide role_id for updating
        "role_name": "Teacher",
        "avail_teaching": ["Math", "Science"] # JSON array of available teaching subjects
    }
}'
Description: Endpoint: /api/academic/role/save Method: POST Headers: Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN_HERE Payload: clientId: Your client ID. roleData: Object containing the role data. role_id: Set to null to add a new role, or provide an existing role_id to update. role_name: The name of the role. avail_teaching: JSON array of subjects the role is available for teaching.

2. Delete Role

CURL Command:
curl -X POST http://yourdomain.com/api/academic/role/delete \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
-d '{
    "clientId": "client1",
    "role_id": 1    # Provide the role_id you wish to delete
}'
Description: Endpoint: /api/academic/role/delete Method: POST Headers: Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN_HERE Payload: clientId: Your client ID. role_id: The ID of the role you wish to delete.

3. List Roles

>CURL Command:
curl -X GET http://yourdomain.com/api/academic/role/list \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
-d '{
    "clientId": "client1",
    "limit": 10,       # Number of records to return
    "offset": 0        # Starting point in the list (pagination)
}'
Description: Endpoint: /api/academic/role/list Method: GET Headers: Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN_HERE Payload: clientId: Your client ID. limit: The number of records to return. offset: The starting point in the list (useful for pagination).

4. Get Role Details

CURL Command:
curl -X GET http://yourdomain.com/api/academic/role/get \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \
-d '{
    "clientId": "client1",
    "role_id": 1  # The role_id you wish to retrieve
}'
Description: Endpoint: /api/academic/role/get Method: GET Headers: Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN_HERE Payload: clientId: Your client ID. role_id: The ID of the role you want to retrieve. Note: Replace YOUR_ACCESS_TOKEN_HERE with the actual access token you use for authentication.