adp logo

API Documentation

1. Enterprise Page

Manage enterprises, including creating new ones and fetching the list of existing enterprises.

API Endpoints

  • Create Enterprise — POST /enterprise
    {
      "enterpriseDisplayName": "My New Enterprise"
    }

    Create a new enterprise by sending the display name.

    export async function createEnterprise(reqBody) {
      const response = await axios.post(`${API_URL}/enterprise`, reqBody);
      return response.data;
    }
  • Get Enterprises — GET /enterprises

    Fetch the list of all enterprises.

    export async function getEnterprises() {
      const response = await axios.get(`${API_URL}/enterprises`);
      return response.data;
    }

2. Device Page

Manage devices within an enterprise, including fetching devices, creating enrollment tokens, and rebooting devices.

API Endpoints

  • Get Devices — GET /enterprise/{enterpriseId}/devices

    Fetch devices for a specific enterprise.

    export async function getDevices(enterpriseId) {
      const response = await axios.get(`${API_URL}/enterprise/${enterpriseId}/devices`);
      return response.data;
    }
  • Create Enrollment Token — POST /enterprise/{enterpriseId}/enrollment-token

    Create an enrollment token for an enterprise.

    export async function createEnrollmentToken(enterpriseId) {
      const response = await axios.post(`${API_URL}/enterprise/${enterpriseId}/enrollment-token`);
      return response.data;
    }
  • Reboot Device — POST /enterprise/{enterpriseId}/device/{deviceId}/reboot

    Reboot a specific device in the given enterprise.

    export async function rebootDevice(enterpriseId, deviceId) {
      const response = await axios.post(`${API_URL}/${enterpriseId}/device/${deviceId}/reboot`);
      return response.data;
    }

3. Policy Page

Manage policies within an enterprise, including fetching, creating, and updating policies.

API Endpoints

  • Get Policies — GET /enterprise/{enterpriseId}/policies

    Fetch policies for a specific enterprise.

    export async function getPolicies(enterpriseId) {
      const response = await axios.get(`${API_URL}/enterprise/${enterpriseId}/policies`);
      return response.data;
    }
  • Create Policy — POST /enterprise/{enterpriseId}/policy

    Create a new policy for the enterprise.

    export async function createPolicy(enterpriseId, policyData) {
      const response = await axios.post(`${API_URL}/enterprise/${enterpriseId}/policy`, policyData);
      return response.data;
    }
  • Update Policy — PATCH /enterprise/{enterpriseId}/policy/{policyName}

    Update an existing policy for the enterprise.

    export async function updatePolicy(enterpriseId, policyName, policyData) {
      const response = await axios.patch(`${API_URL}/enterprise/${enterpriseId}/policy/${policyName}`, policyData);
      return response.data;
    }