Get device (deprecated)
Deprecated
client.ZeroTrust.Devices.Get(ctx, deviceID, query) (*DeviceGetResponse, error)
GET/accounts/{account_id}/devices/{device_id}
Fetches a single WARP device. Not supported when multi-user mode is enabled for the account.
Deprecated: please use one of the following endpoints instead:
- GET /accounts/{account_id}/devices/physical-devices/{device_id}
- GET /accounts/{account_id}/devices/registrations/{registration_id}
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Parameters
deviceID string
Registration ID. Equal to Device ID except for accounts which enabled multi-user mode.
maxLength36
Get device (deprecated)
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/zero_trust"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
device, err := client.ZeroTrust.Devices.Get(
context.TODO(),
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
zero_trust.DeviceGetParams{
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", device.ID)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"account": {
"id": "id",
"account_type": "account_type",
"name": "Company"
},
"created": "2017-06-14T00:00:00Z",
"deleted": true,
"device_type": "windows",
"gateway_device_id": "PD33E90AXfafe14643cbbbc-4a0ed4fc8415Q",
"ip": "1.1.1.1",
"key": "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
"key_type": "curve25519",
"last_seen": "2017-06-14T00:00:00Z",
"mac_address": "00-00-5E-00-53-00",
"model": "MyPhone(pro-X)",
"name": "My mobile device",
"os_version": "10.0.0",
"serial_number": "EXAMPLEHMD6R",
"tunnel_type": "masque",
"updated": "2017-06-14T00:00:00Z",
"user": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"email": "user@example.com",
"name": "John Appleseed"
},
"version": "1.0.0"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"account": {
"id": "id",
"account_type": "account_type",
"name": "Company"
},
"created": "2017-06-14T00:00:00Z",
"deleted": true,
"device_type": "windows",
"gateway_device_id": "PD33E90AXfafe14643cbbbc-4a0ed4fc8415Q",
"ip": "1.1.1.1",
"key": "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
"key_type": "curve25519",
"last_seen": "2017-06-14T00:00:00Z",
"mac_address": "00-00-5E-00-53-00",
"model": "MyPhone(pro-X)",
"name": "My mobile device",
"os_version": "10.0.0",
"serial_number": "EXAMPLEHMD6R",
"tunnel_type": "masque",
"updated": "2017-06-14T00:00:00Z",
"user": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"email": "user@example.com",
"name": "John Appleseed"
},
"version": "1.0.0"
},
"success": true
}