diff --git a/doc/API/Devices.md b/doc/API/Devices.md index 274373b206..e6260a91c6 100644 --- a/doc/API/Devices.md +++ b/doc/API/Devices.md @@ -1151,7 +1151,15 @@ Output: ```json { "status": "ok", - "message": "Device localhost.localdomain (57) has been added successfully" + "message": "Device localhost.localdomain (57) has been added successfully", + "devices": [ + { + "device_id": "57", + "hostname": "localhost", + ... + "serial": null, + "icon": null + } } ``` diff --git a/includes/html/api_functions.inc.php b/includes/html/api_functions.inc.php index f182f2477b..47d5f44af3 100644 --- a/includes/html/api_functions.inc.php +++ b/includes/html/api_functions.inc.php @@ -419,7 +419,9 @@ function add_device(Illuminate\Http\Request $request) return api_error(500, $e->getMessage()); } - return api_success_noresult(201, "Device $hostname ($device_id) has been added successfully"); + $device = device_by_id_cache($device_id); + + return api_success([$device], 'devices', $response); } function del_device(Illuminate\Http\Request $request)