---
title: "Retrieve device's resources"
method: GET
path: "/api/v1/devices/{deviceId}/resources/"
tags: ["Resources"]
---

# Retrieve device's resources

`GET /api/v1/devices/{deviceId}/resources/`

The plgd hub builds an up to date [Twin](https%3A%2F%2Fplgd.dev%2Ffeatures%2Fdevice-shadow%2F) for each published resource. This API allows you to retrieve shadow contents of all resources published by this device. Response is sent in form of a stream, chunk by chunk. Error response might be returned immediately, but also anytime during the stream reading.

## Path parameters

- `deviceId` string, uuid, required

## Query parameters

- `type` string[]

## Response `200`

Stream of resource shadow contents or errors.

- object
  - `result` object
    - `types` string[]
    - `data` Resource
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `content` union
        - ResourceContent
        - ResourceCreatedContent
          - `href` string, uri
          - `rt` string[]
          - `if` string[]
          - `rep` object — Resource content provided as JSON object or base64 encoded CBOR.
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
  - `error` Error
    - `code` integer
    - `message` string
    - `details` object[]
      - `typeUrl` string
      - `value` string, byte

## Other responses

- `400` — Bad Request
- `401` — Not authorized

## Changes

> 42 revisions in range; 3 not diffed.

- **2023-10-03** `43d5d4e000ad` — 1 warning
  - added the new `NOT_MODIFIED` enum value to the `result/data/status` response property for the response status `200`
- **2022-01-05** `afc9b9af73b5` — 6 info
  - added the optional property `error/details/items/typeUrl` to the response with the `200` status
  - added the optional property `error/details/items/typeUrl` to the response with the `400` status
  - added the optional property `error/details/items/typeUrl` to the response with the `401` status
  - added the optional property `error/details/items/value` to the response with the `200` status
  - …2 more
- **2021-07-27** `4d121732b593` — 1 info
  - endpoint added
- **2020-04-11** `562192db9767` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/devices/:deviceId/resources/get.md)

---

[API](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway.md) · [All operations](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/plgd-dev/plgd-http-gateway/revisions/bbfd9fa43407/schema)
