# Get User Devices

## Get User's Devices

<mark style="color:blue;">`GET`</mark> `https://api.parqex.com/oauth/v1/endpoints/sync`

Retrieve all account data (profile, marketplace transactions, guest, and access) for a given user

#### Headers

| Name            | Type   | Description                      |
| --------------- | ------ | -------------------------------- |
| Accept          | string | Always set to `application/json` |
| Accept-Encoding | string | Always set to `gzip`             |
| Accept-Charset  | string | Always set to `utf-8`            |
| Authorization   | string | Set to `Bearer <ACCESS_TOKEN>`   |
| Content-Type    | string | `application/json`               |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
  "devices" : [
    {
      "active" : true,
      "number_of_entities_controlled" : 3,
      "owner_last_name" : "Production",
      "registered" : true,
      "bluetooth_onboard" : false,
      "last_contact" : "2020-12-18 18:47:25",
      "bluetooth_mac_address" : "000000000000",
      "owner_first_name" : "ParqEx",
      "time_before_door_open_alert" : 900,
      "blackbox_code" : "20000c2a6908848d",
      "doors" : [
        {
          "entity_number" : 1,
          "door_auto_close_delay" : 0,
          "bluetooth_sensor_mac_address" : "000000000000",
          "name" : "Kitty",
          "active" : true,
          "bluetooth_sensor_battery_level" : 0,
          "sensor" : false,
          "door_auto_close_enabled" : false,
          "last_toggled" : "2020-12-18 18:32:25",
          "user_relationship" : "Has Access",
          "image" : "",
          "light" : false,
          "bluetooth_sensor" : false,
          "state" : "OPEN",
          "id" : "70fc7ebd63d841d9a9f06ff815be1e7c"
        }
      ],
      "id" : "9d9e5e0e093a06d5f16e1116d108d0c7",
      "software_version" : "0"
    },
    {
      "active" : true,
      "number_of_entities_controlled" : 3,
      "owner_last_name" : "Test",
      "registered" : true,
      "bluetooth_onboard" : false,
      "last_contact" : "2020-08-21 02:33:37",
      "bluetooth_mac_address" : "000000000000",
      "owner_first_name" : "ParqEx",
      "time_before_door_open_alert" : 900,
      "blackbox_code" : "30000c2a691dd625",
      "doors" : [
        {
          "bluetooth_sensor_mac_address" : "4011759015b7",
          "light" : false,
          "image" : "",
          "state" : "OPEN",
          "door_auto_close_enabled" : true,
          "entity_number" : 1,
          "sensor" : false,
          "bluetooth_sensor_battery_level" : 98,
          "last_toggled" : "2020-08-21 02:33:37",
          "bluetooth_sensor" : true,
          "active" : true,
          "name" : "Last Door! ",
          "id" : "a42308f43dbfaa8b1960a20ac4317b05",
          "user_relationship" : "Owner",
          "door_auto_close_delay" : 3600
        }
      ],
      "id" : "35ff0e08ac8eb84ca097a894541ba049",
      "software_version" : "0"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

The **/sync** endpoint is used to retrieve comprehensive data of the specified user’s Controller and/or any Controllers to which the user does not own, but has been granted access. This response always contains the current state of all doors, as well, the user’s relationship (see [Permissions](/-MUyxAVrX9S4wky8UoX6/overview/roles-and-permissions.md)) to said doors.

In the above example response, this user has access to a single Controller and is the *Admin* of this Controller (see [Permissions](/-MUyxAVrX9S4wky8UoX6/overview/roles-and-permissions.md)). The Controller controls a single door which the user has named “Home”. This door is currently OPEN.

{% hint style="warning" %}
**Accounts can have more than one `Device`**. A user may have one or more devices to which they have access.
{% endhint %}

### Common Error Messages

**Invalid Access Token** - Make sure that you are settings all of the appropriate headers in your request:

```
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
Accept-Charset: utf-8
Accept-Encoding: gzip
```

Also, read the [Using RESTful Tools](/-MUyxAVrX9S4wky8UoX6/getting-started/using-restful-tools.md) section if you are using a program to test your requests. A required header might be overridden or removed by the program.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parqex.com/-MUyxAVrX9S4wky8UoX6/api-endpoints/get-user-devices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
