### Get Device Account Configuration Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves SIP account configuration details. ```APIDOC ## Get Device Account Configuration ### Description Retrieves the SIP account configuration details for a device including server settings and credentials. ### Parameters #### Request Body - **mac** (string) - Required ### Response #### Success Response (200) - **accounts** (array) - List of account configurations ``` -------------------------------- ### Get Device Account Configuration Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves the SIP account configuration details for a device including server settings and credentials. ```php deviceAccountConfig($mac); print_r($resp); // Example output: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [accounts] => Array ( // [0] => Array ( // [accountIndex] => 1 // [sipServer] => sip.provider.com // [sipUserId] => 5551234 // [authId] => 5551234 // ) // ) // ) // ) ?> ``` -------------------------------- ### Get Device Account Status Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves SIP account registration statuses. ```APIDOC ## Get Device Account Status ### Description Retrieves the SIP account registration statuses for a device's configured accounts. ### Parameters #### Request Body - **mac** (string) - Required ### Response #### Success Response (200) - **accountStatus** (array) - List of account registration statuses ``` -------------------------------- ### Get Device Details (Online Only) Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves detailed device information. Note: This only works for devices that are currently online. Use getDevice() for offline devices. ```php deviceDetails($mac, true); print_r($resp); // Second request within 1 minute: isFirst=false to retrieve the info $resp = $gdms->deviceDetails($mac, false); print_r($resp); // Note: Prefer using getDevice() instead as it works for offline devices ?> ``` -------------------------------- ### Get Single Device Details Source: https://context7.com/interlinked1/gdms/llms.txt Retrieve detailed information for a specific device using its MAC address. This method is effective even if the device is currently offline. ```php getDevice($mac); print_r($resp); // Example output: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [result] => Array ( // [0] => Array ( // [mac] => 00AABBCCDDFF // [sn] => 207GHQXG70CCDDFF // [deviceName] => Front Desk ATA // [model] => HT812 // [firmware] => 1.0.31.4 // [online] => 0 // ) // ) // ) // ) ?> ``` -------------------------------- ### Get Device Account Status Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves the SIP account registration statuses for a device's configured accounts. ```php deviceAccountStatus($mac); print_r($resp); // Example output showing account registration status: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [accountStatus] => Array ( // [0] => Array ( // [accountIndex] => 1 // [status] => Registered // ) // [1] => Array ( // [accountIndex] => 2 // [status] => Unregistered // ) // ) // ) // ) ?> ``` -------------------------------- ### Get Device Details (Online Only) Source: https://context7.com/interlinked1/gdms/llms.txt Retrieves detailed device information for online devices. ```APIDOC ## Get Device Details (Online Only) ### Description Retrieves detailed device information. Only works for devices that are currently online. ### Parameters #### Request Body - **mac** (string) - Required - **isFirst** (boolean) - Required - Set true to submit request, false to retrieve info ``` -------------------------------- ### Initialize GDMS SDK and Authenticate Source: https://context7.com/interlinked1/gdms/llms.txt Instantiate the GDMS class with your API credentials and authenticate to obtain an access token. Ensure your password is double-hashed (SHA256 of MD5). Debug output can be enabled for troubleshooting. ```php setDebug(true); // Authenticate and obtain access token $result = $gdms->login(); if ($result === 0) { echo "Login successful\n"; } else { echo "Login failed\n"; exit(1); } ?> ``` -------------------------------- ### Perform GDMS Workflow Operations Source: https://context7.com/interlinked1/gdms/llms.txt Demonstrates the complete lifecycle of initializing the GDMS client, authenticating, and performing common device management tasks like listing organizations, sites, and adding devices. ```php setDebug(false); if ($gdms->login() !== 0) { die("Authentication failed\n"); } // Get organization list $orgs = $gdms->organizationList(); $defaultOrgId = $orgs['data']['result'][0]['orgId']; echo "Default Organization ID: $defaultOrgId\n"; // Get sites in the organization $sites = $gdms->siteList($defaultOrgId); $defaultSiteId = $sites['data']['result'][0]['siteId']; echo "Default Site ID: $defaultSiteId\n"; // List all devices $devices = $gdms->deviceList(); echo "Total devices: " . count($devices['data']['result']) . "\n"; // Add a new device $newMac = '00:11:22:33:44:55'; $newSn = 'ABC123XYZ789'; $addResult = $gdms->addDevice($newMac, $newSn, $defaultSiteId, 'New ATA', $defaultOrgId); if ($addResult['code'] === 0) { echo "Device added successfully\n"; // Retrieve the device info $deviceInfo = $gdms->getDevice($newMac); print_r($deviceInfo['data']['result'][0]); // Check account status $status = $gdms->deviceAccountStatus($newMac); print_r($status['data']); } ?> ``` -------------------------------- ### List Sites Source: https://context7.com/interlinked1/gdms/llms.txt Retrieve a list of sites within a specified organization or the default organization if none is provided. Sites are used to group devices. ```php siteList(); print_r($resp['data']['result']); // Get sites in a specific organization $orgID = 45789; $resp = $gdms->siteList($orgID); print_r($resp['data']['result']); // Example output: // Array ( // [0] => Array ( // [siteId] => 12345 // [siteName] => Headquarters // [orgId] => 45789 // ) // ) ?> ``` -------------------------------- ### Register a New Device Source: https://context7.com/interlinked1/gdms/llms.txt Registers a new device to GDMS. Requires MAC address, serial number, and site ID. Device name and organization ID are optional. ```php addDevice($mac, $serialNumber, $siteID, $deviceName, $orgID); print_r($resp); // Example successful response: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [successNum] => 1 // [failNum] => 0 // ) // ) ?> ``` -------------------------------- ### Add Device Source: https://context7.com/interlinked1/gdms/llms.txt Registers a new device to the GDMS platform. ```APIDOC ## Add Device ### Description Registers a new device to GDMS. Requires MAC address, serial number, and site ID. ### Parameters #### Request Body - **mac** (string) - Required - MAC address (with or without colons) - **serialNumber** (string) - Required - Device serial number - **siteID** (integer) - Required - Site ID - **deviceName** (string) - Optional - Device name - **orgID** (integer) - Optional - Organization ID ### Response #### Success Response (200) - **code** (integer) - Status code - **msg** (string) - Status message - **data** (object) - Contains successNum and failNum ``` -------------------------------- ### Include GDMS SDK Source: https://github.com/interlinked1/gdms/blob/master/README.md Include the GDMS.php file in your project to access the SDK functionality. ```php require('GDMS.php'); ``` -------------------------------- ### List All Devices Source: https://context7.com/interlinked1/gdms/llms.txt Retrieve a comprehensive list of all devices registered under the GDMS account, including their MAC addresses, serial numbers, and online status. ```php deviceList(); // Count total devices echo "You have " . count($resp['data']['result']) . " devices\n"; // Print all device details print_r($resp['data']['result']); // Example output: // Array ( // [0] => Array ( // [mac] => 00AABBCCDDFF // [sn] => 207GHQXG70CCDDFF // [deviceName] => Front Desk ATA // [siteId] => 12345 // [online] => 1 // ) // ) ?> ``` -------------------------------- ### Edit Device Source: https://context7.com/interlinked1/gdms/llms.txt Updates device information or retrieves current device details. ```APIDOC ## Edit Device ### Description Updates device information or retrieves current device details. Recommended method for viewing details of both online and offline devices. ### Parameters #### Request Body - **mac** (string) - Required - **serialNumber** (string) - Required - **siteID** (integer) - Required - **deviceName** (string) - Optional - **orgID** (integer) - Optional ### Response #### Success Response (200) - **code** (integer) - Status code - **msg** (string) - Status message ``` -------------------------------- ### Factory Reset Device Source: https://context7.com/interlinked1/gdms/llms.txt Remotely factory resets a device. ```APIDOC ## Factory Reset Device ### Description Remotely factory resets a device, clearing all configuration. ### Parameters #### Request Body - **mac** (string) - Required - **orgID** (integer) - Optional ### Response #### Success Response (200) - **taskId** (integer) - ID of the created task - **taskName** (string) - Name of the task ``` -------------------------------- ### Update Device Information Source: https://context7.com/interlinked1/gdms/llms.txt Updates device information or retrieves current device details. This is also the recommended method for viewing device details, including for offline devices. ```php editDevice($mac, $serialNumber, $siteID, $deviceName, $orgID); print_r($resp); // Example response: // Array ( // [code] => 0 // [msg] => success // ) ?> ``` -------------------------------- ### Reboot Device Source: https://context7.com/interlinked1/gdms/llms.txt Remotely reboots a device. Creates a task in GDMS that executes when the device checks in. ```php deviceReboot($mac, $orgID); print_r($resp); // Example response: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [taskId] => 98765 // [taskName] => 1672531200000_00AABBCCDDFF_Reboot // ) // ) ?> ``` -------------------------------- ### Factory Reset Device Source: https://context7.com/interlinked1/gdms/llms.txt Remotely factory resets a device. This will clear all device configuration and restore factory defaults. ```php deviceFactoryReset($mac, $orgID); print_r($resp); // Example response: // Array ( // [code] => 0 // [msg] => success // [data] => Array ( // [taskId] => 98766 // [taskName] => 1672531200000_00AABBCCDDFF_Reset // ) // ) ?> ``` -------------------------------- ### Reboot Device Source: https://context7.com/interlinked1/gdms/llms.txt Remotely reboots a device. ```APIDOC ## Reboot Device ### Description Remotely reboots a device by creating a task in GDMS. ### Parameters #### Request Body - **mac** (string) - Required - **orgID** (integer) - Optional ### Response #### Success Response (200) - **taskId** (integer) - ID of the created task - **taskName** (string) - Name of the task ``` -------------------------------- ### List Organizations Source: https://context7.com/interlinked1/gdms/llms.txt Retrieve a list of all organizations associated with the authenticated GDMS account. The response contains organization IDs necessary for subsequent API calls. ```php organizationList(); // Response structure: $resp['data']['result'] contains array of organizations print_r($resp['data']['result']); // Example output: // Array ( // [0] => Array ( // [orgId] => 45789 // [orgName] => Main Office // [description] => Primary organization // ) // ) ?> ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.