DID Linked Resources (DLRs)

Create a DID-Linked Resource.

post

This endpoint creates a DID-Linked Resource. As input, it can take the DID identifier and the resource parameters via a form, or the fully-assembled resource itself.

Authorizations
Path parameters
didstringRequired

DID identifier to link the resource to.

Body

Input fields for DID-Linked Resource creation.

datastringRequired

Encoded string containing the data to be stored in the DID-Linked Resource.

encodingstring · enumRequired

Encoding format used to encode the data.

Possible values:
namestringRequired

Name of DID-Linked Resource.

typestringRequired

Type of DID-Linked Resource. This is NOT the same as the media type, which is calculated automatically ledger-side.

versionstringOptional

Optional field to assign a human-readable version in the DID-Linked Resource.

publicKeyHexsstring[]Optional

List of key references (publicKeys) which will be used for signing the message. The should be in hexadecimal format and placed in the wallet of current user.

Responses
200

The request was successful.

application/json
post
POST /resource/create/{did} HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 94

"data='SGVsbG8gV29ybGQ='&encoding='base64url'&name='ResourceName'&type='TextDocument'"
{
  "resourceURI": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b",
  "resourceCollectionId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
  "resourceId": "398cee0a-efac-4643-9f4c-74c48c72a14b",
  "resourceName": "cheqd-issuer-logo",
  "resourceType": "CredentialArtwork",
  "mediaType": "image/png",
  "resourceVersion": "1.0",
  "checksum": "a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559",
  "created": "2021-09-01T12:00:00Z",
  "nextVersionId": "d4829ac7-4566-478c-a408-b44767eddadc",
  "previousVersionId": "ad7a8442-3531-46eb-a024-53953ec6e4ff"
}

Get a DID-Linked Resource.

get

This endpoint returns the DID-Linked Resource for a given DID identifier and resource identifier.

Authorizations
Path parameters
didstringRequired

DID identifier

Example: did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
Query parameters
resourceIdstring · uuidOptional

Fetch a DID-Linked Resource by Resource ID unique identifier. Since this is a unique identifier, other Resource query parameters are not required. See DID-Linked Resources for more details.

Example: 3ccde6ba-6ba5-56f2-9f4f-8825561a9860
resourceNamestringOptional

Filter a DID-Linked Resource query by Resource Name. See DID-Linked Resources for more details.

Example: cheqd-issuer-logo
resourceTypestringOptional

Filter a DID-Linked Resource query by Resource Type. See DID-Linked Resources for more details.

Example: CredentialArtwork
resourceVersionstringOptional

Filter a DID-Linked Resource query by Resource Version, which is an optional free-text field used by issuers (e.g., "v1", "Final Version", "1st January 1970" etc). See DID-Linked Resources for more details.

Example: v1
resourceVersionTimestring · date-timeOptional

Filter a DID-Linked Resource query which returns the closest version of the Resource at or before specified time. See DID-Linked Resources for more details.

Example: 1970-01-01T00:00:00Z
checksumstringOptional

Request integrity check against a given DID-Linked Resource by providing a SHA-256 checksum hash. See DID-Linked Resources for more details.

Example: dc64474d062ed750a66bad58cb609928de55ed0d81defd231a4a4bf97358e9ed
resourceMetadatabooleanOptional

Return only metadata of DID-Linked Resource instead of actual DID-Linked Resource. Mutually exclusive with some of the other parameters.

Responses
200

The request was successful.

any
Responseobject
get
GET /resource/search/{did} HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Accept: */*
{}

Was this helpful?