Update a Device
Http Method: PUT
URL Path: /v1/a/{groupPath}/d/{appId}
Request Body Type: application/json
Response Body Type: no response body
Required Permissions: ModifyDevice
Modify the settings of a device. The Device Group must belong to the account authenticated by the API key.
Request
Path Parameters
groupPath
The {groupPath}
parameter provides the path identifier of the Device Group being queried. This Device Group must be owned by the account authenticated by the calling API Key.
appId
The {appId}
parameter provides the Application Access ID of the device being updated.
Request Body
{
"RequestIdChange": String/null,
"RenewPageInfo": Boolean,
"GenerateNewAccessID": Boolean
}
All fields can be omitted if no change is required.
Field | Info |
---|---|
RequestIdChange | String or null : request the devices ID/Name be changed. This request will be queued on the service, and actioned when the device next communicates with the service. |
RenewPageInfo | Boolean: if true then the service will re-query the devices paper configuration. This can be useful if the device has been configured to use different paper since it was last queried by the service. |
GenerateNewAccessID | Boolean: if true then the service will assign a new ApplicationAccessID to this device. |
Important
Assigning a new Application Access ID to a device will usually disconnect it from any applications that are using it. Security should usually be managed by assigning API keys per application or user. But it can be useful when using a keyless printing method such as the legacy printing API or email bridge, in case of receiving unwanted print jobs.
Response
Return Codes
Code | Description |
---|---|
200 | Success, check the returned body data for the device list |
400 | BadRequest, unable to process the request, check calling path |
403 | Forbidden, the authenticated API key does not have permission to access this resource. Check that the Key is correct and has suitable permissions. |
404 | Not Found, no device within the specified device group and owned by the authenticated account can be found. |
500 | Server side error, such as inaccessible database. Please contact Star if this occurs frequently. |
Usage Example
An example, using curl to change the name (to "Kitchen Printer 1") of a device with Application Access ID e9042f5f
from a group with a path name of examplegroup
.
curl -X PUT -d'{"RequestIdChange" : "Kitchen Printer 1"}' --header "Star-Api-Key: 6800ffd6-2367-4c8d-b067-d6a28151276a" https://beta.starprinter.online/v1/a/examplegroup/d/e9042f5f