# Accessing Resources

Monitor device resources collected by Soracom Inventory agents.

Once you have installed an agent on your device and it has successfully connected with the Inventory Device Management server, you will be able to view device resources directly from the User Console.

1. Sign in to the **[User Console](https://console.soracom.io/?coverage_type=g)**. From the **☰ Menu**, open the **Device Management** screen. Ensure that you have selected the **Global** coverage type.

2. From the list of Inventory devices, click the **☑** for the device you want to access.

   ![View device details](https://docs.soracom.io/_astro/view-device-details._sQuOK30_Z25OfJJ.webp)

3. Click the **Details** button. Under the **Basic Settings** tab, you will see all device resources reported by the device agent.

   ![Device details](https://docs.soracom.io/_astro/device-details.BCxnLUnO_Z13oE0U.webp)

For each resource, one or more of the following buttons will be available depending on the resource type:

- ↻ - Send a `read` request to the resource. The server will request the value from the agent.
- ✏ - Send a `write` request to the resource. A dialog will appear allowing you to enter a new value for the resource.
- - Send a `observe` request to the resource. The server will request the agent to send change notifications. When the value changes, the agent will send the new value to the server. Click again to send an `unobserve` request.
- ▶ - Send a `execute` request to the resource. The agent will execute a command on the device according to the resource configuration.

## Programmatic Usage

Because Soracom provides a power API, you can interact with object resources programmatically in a logical way.

### Soracom API

Interacting with a device requires its device ID.

To `read` an object, simply use the **readDeviceResource** API method, providing the object, object instance, and resource numbers as URL paths:

**Global**

```bash
curl -X GET \
  -H 'Accept: application/json' \
  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/<OBJECT>/<INSTANCE>/<RESOURCE>
```

**Japan**

```bash
curl -X GET \
  -H 'Accept: application/json' \
  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/<OBJECT>/<INSTANCE>/<RESOURCE>
```

For example, when calling the API on `/v1/devices/<DEVICE-ID>/3/0/0` (to read the manufacturer resource), Inventory will return something similar to this:

```json
{
  "id": 0,
  "type": "STRING",
  "value": "Open Mobile Alliance"
}
```

You can also perform `write`, `observe`, `unobserve`, and `execute` actions from these APIs:

- **readDeviceResources** - Read all resources within an object instance.
- **writeDeviceResource** - Write a value to an object resource.
- **observeDeviceResource** - Receive a notification when a resource value changes.
- **observeDeviceResources** - Receive a notification when any values in an object instance change.
- **unobserveDeviceResource** - Stop receiving notifications when a resource value changes.
- **unobserveDeviceResources** - Stop receiving notifications when any values in an object instance change.
- **executeDeviceResource** - Execute a command defined by an object resource.

### Soracom CLI

You can interact similarly using the Soracom CLI:

**Global**

```bash
soracom devices get-resource --device-id "<DEVICE-ID"> --object "<OBJECT>" --instance "<INSTANCE>" --resource "<RESOURCE>" --coverage-type g
```

**Japan**

```bash
soracom devices get-resource --device-id "<DEVICE-ID"> --object "<OBJECT>" --instance "<INSTANCE>" --resource "<RESOURCE>" --coverage-type jp
```

Other actions are available with the following commands:

- `soracom devices put-resource`
- `soracom devices observe-resource`
- `soracom devices observe-resources`
- `soracom devices unobserve-resource`
- `soracom devices unobserve-resources`
- `soracom devices execute-resource`
