---
title: "Retrieve a resource"
method: GET
path: "/api/v1/devices/{deviceId}/resources/{resourceHref}"
tags: ["Resources"]
---

# Retrieve a resource

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

The plgd cloud builds an up to date [Shadow](https%3A%2F%2Fplgd.dev%2Ffeatures%2Fdevice-shadow%2F) for each published resource. Retrieving it's content using this API returnes an eventually consistent shadow content of the resource. There is a possibility bypass the shadow by setting the query parameter `shadow` to `false.`

## Query parameters

- `interface` string
- `shadow` boolean

## Response `200`

Resource content.

- object
  - `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'

## Other responses

- `400` — Bad Request
- `401` — Not authorized
- `404` — Entity was not found.

## Changes

- **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/:resourceHref/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/daf228bd321e/schema)
