Getting Started

API Documentation

Resources APIs

API documentation for resources management

1. Create Employee Resource

  • URL: /employee-resources
  • Method: POST
  • Description: Creates a new employee resource.
  • Request Body:
    {
      "resourceId": "string",
      "resourceName": "string",
      "timezone": "string",
      "createdAt": "DateTime",
      "displayPictureUri": "string (optional)",
      "notificationsEnabled": "boolean (optional)",
      "isActive": "boolean",
      "note": "string (optional)",
      "userId": "string",
      "email": "string",
      "phone": "string (optional)",
      "onboardingPreference": "SEND_EMAIL_INVITE | SET_USERNAME_PASSWORD (optional)",
      "calendarSync": "GCal | Apple | Outlook | None (optional)",
      "role": "string (optional)"
    }
    
  • Response:
    • Success: 201 Created
      {
        "orgId": "org123",
        "resourceId": "res456",
        "resourceName": "John Doe",
        "timezone": "America/New_York",
        "createdAt": "2023-10-01T12:00:00Z",
        "displayPictureUri": "https://example.com/picture.jpg",
        "notificationsEnabled": true,
        "isActive": true,
        "note": "This is a sample note.",
        "userId": "user789",
        "email": "johndoe@example.com",
        "phone": "+1234567890",
        "onboardingPreference": "SEND_EMAIL_INVITE",
        "calendarSync": "GCal",
        "role": "Manager"
      }
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while creating the employee resource",
        "error": "Detailed error message"
      }
      

2. Create Asset Resource

  • URL: /asset-resources
  • Method: POST
  • Description: Creates a new asset resource.
  • Request Body:
    {
      "resourceId": "string",
      "resourceName": "string",
      "timezone": "string",
      "createdAt": "DateTime",
      "displayPictureUri": "string (optional)",
      "notificationsEnabled": "boolean (optional)",
      "isActive": "boolean",
      "note": "string (optional)",
      "assetType": "string",
      "userIdsToNotify": ["string"]
    }
    
  • Response:
    • Success: 201 Created
      {
        "message": "Asset resource created successfully"
      }
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while creating the asset resource",
        "error": "Detailed error message"
      }
      

3. Get All Employee Resources

  • URL: /employee-resources
  • Method: GET
  • Description: Retrieves all employee resources.
  • Response:
    • Success: 200 OK
      [
        {
          "resourceId": "string",
          "resourceName": "string",
          "timezone": "string",
          "createdAt": "DateTime",
          "displayPictureUri": "string",
          "notificationsEnabled": "boolean",
          "isActive": "boolean",
          "note": "string",
          "userId": "string",
          "email": "string",
          "phone": "string",
          "onboardingPreference": "SEND_EMAIL_INVITE | SET_USERNAME_PASSWORD",
          "calendarSync": "GCal | Apple | Outlook | None",
          "role": "string"
        }
      ]
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while fetching employee resources",
        "error": "Detailed error message"
      }
      

4. Get All Asset Resources

  • URL: /asset-resources
  • Method: GET
  • Description: Retrieves all asset resources.
  • Response:
    • Success: 200 OK
      [
        {
          "orgId": "string",
          "resourceId": "string",
          "resourceName": "string",
          "timezone": "string",
          "createdAt": "DateTime",
          "displayPictureUri": "string",
          "notificationsEnabled": "boolean",
          "isActive": "boolean",
          "note": "string",
          "assetType": "string",
          "userIdsToNotify": ["string"]
        }
      ]
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while fetching asset resources",
        "error": "Detailed error message"
      }
      

5. Update Employee Resource

  • URL: /employee-resources/:resourceId
  • Method: PUT
  • Description: Updates an existing employee resource.
  • Request Body:
    {
      "resourceName": "string (optional)",
      "timezone": "string (optional)",
      "displayPictureUri": "string (optional)",
      "notificationsEnabled": "boolean (optional)",
      "isActive": "boolean (optional)",
      "note": "string (optional)",
      "email": "string (optional)",
      "phone": "string (optional)",
      "onboardingPreference": "SEND_EMAIL_INVITE | SET_USERNAME_PASSWORD (optional)",
      "calendarSync": "GCal | Apple | Outlook | None (optional)",
      "role": "string (optional)"
    }
    
  • Response:
    • Success: 200 OK
      {
        "message": "Employee resource updated successfully"
      }
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while updating the employee resource",
        "error": "Detailed error message"
      }
      

6. Update Asset Resource

  • URL: /asset-resources/:resourceId
  • Method: PUT
  • Description: Updates an existing asset resource.
  • Request Body:
    {
      "resourceName": "string (optional)",
      "timezone": "string (optional)",
      "displayPictureUri": "string (optional)",
      "notificationsEnabled": "boolean (optional)",
      "isActive": "boolean (optional)",
      "note": "string (optional)",
      "assetType": "string (optional)",
      "userIdsToNotify": ["string (optional)"]
    }
    
  • Response:
    • Success: 200 OK
      {
        "message": "Asset resource updated successfully"
      }
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while updating the asset resource",
        "error": "Detailed error message"
      }
      

7. Get All Resources

  • URL: /all-resources
  • Method: GET
  • Description: Retrieves all resources, both employee and asset resources. Optionally, you can filter by organization ID.
  • Response:
    • Success: 200 OK
      {
        "employees": [
          {
            "orgId": "string",
            "resourceId": "string",
            "resourceName": "string",
            "timezone": "string",
            "createdAt": "DateTime",
            "displayPictureUri": "string",
            "notificationsEnabled": "boolean",
            "isActive": "boolean",
            "note": "string",
            "userId": "string",
            "email": "string",
            "phone": "string",
            "onboardingPreference": "SEND_EMAIL_INVITE | SET_USERNAME_PASSWORD",
            "calendarSync": "GCal | Apple | Outlook | None",
            "role": "string"
          }
        ],
        "assets": [
          {
            "orgId": "string",
            "resourceId": "string",
            "resourceName": "string",
            "timezone": "string",
            "createdAt": "DateTime",
            "displayPictureUri": "string",
            "notificationsEnabled": "boolean",
            "isActive": "boolean",
            "note": "string",
            "assetType": "string",
            "userIdsToNotify": ["string"]
          }
        ]
      }
      
    • Error: 500 Internal Server Error
      {
        "message": "An error occurred while fetching all resources",
        "error": "Detailed error message"
      }