DgVerseDgVerse
Home
Get Started
  • Auth Endpoint
  • Create Collection
  • Create Certificate
  • Create Directory
  • Transfer Certificate Via Wallet
  • Transfer Certificate Via Mail
  • Cancel Claim
  • Freeze User
  • Un-freeze User
  • Pause Collection
  • Un-Pause Collection
  • Delete Collection
  • Invalidate Certificates
  • Delete Certificates
  • Get Collection
  • Get Certificates
  • Get Directory of a Collection
Home
Get Started
  • Auth Endpoint
  • Create Collection
  • Create Certificate
  • Create Directory
  • Transfer Certificate Via Wallet
  • Transfer Certificate Via Mail
  • Cancel Claim
  • Freeze User
  • Un-freeze User
  • Pause Collection
  • Un-Pause Collection
  • Delete Collection
  • Invalidate Certificates
  • Delete Certificates
  • Get Collection
  • Get Certificates
  • Get Directory of a Collection
  • Create Collection

Create Collection

Path: v1/hts/api/integration/create-collection

How to use:

Below table represents the parameters, data type of the parameter, and whether the parameter is required or not for creating a collection using ‘Create Collection’. All the fields that are required must be provided to create a collection. Otherwise, it will lead to errors.

Parameter List

FieldTypeRequiredUsage
nameStringRequiredSet the publicly visible name of the collection. The collection name is specified as a string. The collection name is not unique.
certificateTypeString (Transferable Certificates, Non-transferable Certificates)RequiredThe type of certificate collection to create.
descriptionStringOptional (can be empty)The description field allows you to provide additional information about the collection.
displayPicImage (full path of the image file) (recommended aspect ratio is 1:1)OptionalImage is uploaded just for reference purpose in application UI.
enableFreezeUserFeatureBooleanOptionalIf enabled, the owner of the account can freeze any user from making any transaction from the collection.
defaultFreezeStatusBooleanOptionalWorks in conjunction with enableFreezeUserFeature. If true, all users are considered frozen.
enableInvalidateCertFeatureBooleanOptionalIf enabled, the collection owner can invalidate certificates. If empty, invalidating is not possible.
enablePauseFeatureBooleanOptionalThe key which has the authority to pause or unpause all transactions on a collection.
immutableBooleanOptionalThe immutable feature allows you to create a collection that cannot be updated or modified after its initial creation.
allowShareToLinkedinBooleanOptionalThis is to allow sharing the certificate on LinkedIn.
socialMediaString of the form [{"media": "<value>", "url": "<value>"}]OptionalMetadata fields for links or references to associated social media profiles. API expects it as an array of objects containing keys media and url.
additionalDetailsString of the form [{"attribute": "prop1", "value":"value1"}, {"attribute": "prop2", "value": "value 2"}]OptionalInclude any other relevant information specific to your collection. API expects it as an array of objects containing keys attribute and value.

The below table specifies the JSON string input format of “socialMedia” and “additionalDetails” fields in the above table.

FieldData TypeDescriptionExample Value
mediastringType of social media platform"instagram"
urlstringURL of the social media profile"instagram.com/JohnDoe"
attributestringName of the property or attribute"prop1"
valuestringValue associated with the property"value1"

cURL Command

curl --request POST \
  --url http://<dgverse-api-base-url>/v1/hts/api/integration/create-collection \
  --header 'Authorization: Bearer <YOUR TOKEN>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'name=<Certificate Name>' \
  --form royaltyStatus=false \
  --form defaultFreezeStatus=false \
  --form description=description \
  --form enableFreezeUserFeature=true \
  --form enableInvalidateCertFeature=true \
  --form enablePauseFeature=true \
  --form immutable=false \
  --form 'certificateType=Transferable Certificates' \
  --form allowAddToLinkedin=false \
  --form walletAddress=0.0.4485627 \
  --form 'displayPic=@/mnt/c/Users/Username/Pictures/Pic.jpg'

Screenshot

screenshot

Response:

When creating a collection is successful. The “collectionId” will be generated for the created collection.

screenshot

Error troubleshooting:

  • ENOENT(Error NO ENTity): The display picture or the directory provided does not exist.

  • 500 Internal Server Error: ‘User ID’ not correct.

  • 500 Internal Server Error: ‘Wallet Address’ not correct.

  • 400 Bad Request: ‘Name’ is not allowed to be empty.

  • 400 Bad Request: ‘Certificate Type’ must be one of these values: “Transferable Certificates”, “Non-transferable Certificates”.

Last Updated:
Contributors: John, Harish Haridas
Prev
Auth endpoint
Next
Create Directory