For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a DID-Linked Resource

Create a DID-Linked Resource (DLR) associated with a cheqd Decentralized Identifier (DID) over REST API, using cheqd Studio.

Using the /resource/create API, users are able to create custom DID-Linked Resources, including:

  1. Schemas

  2. Credential Definitions

  3. Trust Registries

  4. Status Lists

  5. Logos associated with DIDs

  6. Governance files

Step 1: Set up your account

Make sure you have set up your account with cheqd Studio and are logged in, using our guide below:

Step 2: Create a DID

Before you can create a DID-Linked Resource, you need to create a "parent" DID which is used to link the Resource on-ledger. Use the API in the page below to create a DID:

Step 3. Create your Resource content and save the file locally

DID-Linked Resources can be any type of file or content that is below ~45kb in size.

For the purpose of an example, lets use an AnonCreds schema (JSON file) as the resource:

Save this file locally and call it something like resource.json.

Step 4: Encode the file

Prepare a file with resource and encode it into base64, base64url or hex. On Unix systems, you can use the following command input:

Expected output:

Step 5: Set a consistent name and type

Resources are grouped by having identical names and types. This means if you want to create a new version of the same Resource, you will need to specify the same name and type in the following request.

Step 6: Populate the request inputs and hit the API

Create a DID-Linked Resource.

post
/resource/create/{did}

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
x-api-keystringRequired
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
resourceURIstringOptionalExample: did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b
resourceCollectionIdstringOptionalExample: 55dbc8bf-fba3-4117-855c-1e0dc1d3bb47
resourceIdstringOptionalExample: 398cee0a-efac-4643-9f4c-74c48c72a14b
resourceNamestringOptionalExample: cheqd-issuer-logo
resourceTypestringOptionalExample: CredentialArtwork
mediaTypestringOptionalExample: image/png
resourceVersionstringOptionalExample: 1.0
checksumstringOptionalExample: a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559
createdstringOptionalExample: 2021-09-01T12:00:00Z
nextVersionIdstringOptionalExample: d4829ac7-4566-478c-a408-b44767eddadc
previousVersionIdstringOptionalExample: ad7a8442-3531-46eb-a024-53953ec6e4ff
post/resource/create/{did}

Last updated

Was this helpful?