Credential Schema APIs
Authorizations
Query parameters
tagsstringOptionalExample:
tag1,tag2
Responses
201
Credential Schemas
application/json
400
Invalid Input
500
error
get
GET /api/v1/credential-schema HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
[
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
"proof": {}
},
"tags": [
"text"
],
"status": "DRAFT",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
]
Authorizations
Body
tagsstring[]Optional
statusstring · enumOptionalPossible values:
Responses
201
Credential Schema successfully created!
application/json
400
Invalid Input
500
error
post
POST /api/v1/credential-schema HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 479
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}"
},
"tags": [
"text"
],
"status": "DRAFT"
}
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
"proof": {}
},
"tags": [
"text"
],
"status": "DRAFT",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
Authorizations
Path parameters
idstringRequired
Responses
200
Response
application/json
400
Invalid Input
500
error
get
GET /api/v1/credential-schema/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
"proof": {}
},
"tags": [
"text"
],
"status": "DRAFT",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
If the schema is updated, a new semver will be generated and the old one will be deprecated. If only metadata (like tags/status) is updated, the semver will not be generated
Authorizations
Path parameters
idstringRequired
Body
tagsstring[]Optional
statusstring · enumOptionalPossible values:
Responses
200
Credential Schema successfully updated!
application/json
Responseall of
400
Invalid Input
500
error
put
PUT /api/v1/credential-schema/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 479
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}"
},
"tags": [
"text"
],
"status": "DRAFT"
}
{
"schema": {
"type": "text",
"id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"version": "text",
"name": "text",
"author": "text",
"authored": "text",
"schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
"proof": {}
},
"tags": [
"text"
],
"status": "DRAFT",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text",
"deprecatedId": "text"
}
Authorizations
Query parameters
schemaIdstringRequired
Responses
200
Response
application/json
Responseall of
400
Invalid Input
500
error
get
GET /api/v1/template HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
Authorizations
Body
templatestringOptional
It should be valid string in handlebar format
schemaIdstringOptionalExample:
did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1
Responses
201
Rendering template successfully created!
application/json
Responseall of
400
Invalid Input
500
error
post
POST /api/v1/template HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 120
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
}
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
Authorizations
Path parameters
idstringRequired
Responses
200
Response
application/json
Responseall of
400
Invalid Input
500
error
get
GET /api/v1/template/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
Create a new version of template
Authorizations
Path parameters
idstringRequired
Body
templatestringOptional
It should be valid string in handlebar format
schemaIdstringOptionalExample:
did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1
Responses
200
Rendering template successfully updated!
application/json
Responseall of
400
Invalid Input
500
error
put
PUT /api/v1/template/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 120
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
}
{
"template": "text",
"schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
"templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
"createdAt": "text",
"updatedAt": "text",
"createdBy": "text",
"updatedBy": "text"
}
Last updated