Create Verifiable Credentials
This creates a verifiable credentails using following method. The weightage for this API is 10
API Specification
Create Verifiable Credentials
POST
https://api.krypcore.com/api/v0/did/createVC
Creates a new Verifiable Credentials under the given instance.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | User Auth Key obtained from Dash |
DappId* | String | DappId |
Request Body
Name | Type | Description |
---|---|---|
subjectDid* | String | Subject DID |
issuerDid* | String | Issuer DID |
proofType* | String | Type Of proof |
statusType* | String | Type Of status |
templateId* | String | template id |
{
"Data": {
"@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/security/suites/jws-2020/v1"],
"config": {
"issuerDid": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
"proofType": "LD_PROOF",
"statusType": "StatusList2021Entry",
"subjectDid": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
},
"credentialData": {},
"credentialStatus": {
"id": "http://127.0.0.1:7001/v1/credentials/status/revocation#1",
"statusListCredential": "http://127.0.0.1:7001/v1/credentials/status/revocation",
"statusListIndex": "1",
"statusPurpose": "revocation",
"type": "StatusList2021Entry"
},
"credentialSubject": {
"additionalProp1": {},
"id": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
},
"id": "urn:uuid:3d58a9a7-cd75-4e1b-90c9-97da654daf9d",
"issuanceDate": "2023-09-21T07:11:47Z",
"issued": "2023-09-21T07:11:47Z",
"issuer": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
"proof": {
"created": "2023-09-21T07:11:47Z",
"creator": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
"jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..SZbcEn7l_UyX9PPai3RcedNuwu4xOTWnJxvuK0obSr-jeWp-8PumgeMlxhajgjPJol3XN8In3qH8aOmn2nQwBg",
"type": "JsonWebSignature2020",
"verificationMethod": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa#z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa"
},
"templateId": "PermanentResidentCard",
"type": ["VerifiableCredential"],
"validFrom": "2023-09-21T07:11:47Z"
},
"Message": "VC Created",
"Status": "SUCCESS"
}
{
"Data": null,
"Message": "Invalid Template Id",
"Status": "FAILURE"
}
{
"Data": null,
"Message": "mandatory params missing",
"Status": "FAILURE"
}
Take a look at how you might call this method using our official libraries, or via curl
:
curl --location --request POST 'https://api.krypcore.com/api/v0/did/createVC' \
--header 'Authorization: xxxxxxxxxxx' \
--header 'DappId: xxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"config": {
"issuerDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n",
"proofType": "LD_PROOF",
"statusType": "StatusList2021Entry",
"subjectDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n"
},
"credentialData": {
"credentialSubject": {
"additionalProp1": {}
}
},
"templateId": "VerifiableId"
}'
var axios = require('axios');
var data = JSON.stringify({
"config": {
"issuerDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n",
"proofType": "LD_PROOF",
"statusType": "StatusList2021Entry",
"subjectDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n"
},
"credentialData": {
"credentialSubject": {
"additionalProp1": {}
}
},
"templateId": "VerifiableId"
});
var config = {
method: 'post',
url: 'https://api.krypcore.com/api/v0/did/createVC',
headers: {
'Authorization': 'xxxxxxxxxxx',
'DappId': 'xxxxxxxxxxx',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.krypcore.com/api/v0/did/createVC"
payload = json.dumps({
"config": {
"issuerDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n",
"proofType": "LD_PROOF",
"statusType": "StatusList2021Entry",
"subjectDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n"
},
"credentialData": {
"credentialSubject": {
"additionalProp1": {}
}
},
"templateId": "VerifiableId"
})
headers = {
'Authorization': 'xxxxxxxxxxx',
'DappId': 'xxxxxxxxxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.krypcore.com/api/v0/did/createVC"
method := "POST"
payload := strings.NewReader(`{
"config": {
"issuerDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n",
"proofType": "LD_PROOF",
"statusType": "StatusList2021Entry",
"subjectDid": "did:key:z6MkqXwdB44PL2W5xHABsMR5MeXFq2Z2xhdBoT2VuvDdow3n"
},
"credentialData": {
"credentialSubject": {
"additionalProp1": {}
}
},
"templateId": "VerifiableId"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "xxxxxxxxxxx")
req.Header.Add("DappId", "xxxxxxxxxxx")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Last updated