Identity Service APIs
Last updated
Last updated
The DID ID to resolve
GET /api/v1/did/resolve/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
"id": "did:rcw:71364c7e-0abe-49cf-9269-4661699f274b",
"alsoKnownAs": [
"ramesh@gmail.com"
],
"service": [
"{ \"id\": \"IdentityHub\", \"type\": \"IdentityHub\", \"serviceEndpoint\": { \"@context\": \"schema.identity.foundation/hub\", \"@type\": \"UserServiceEndpoint\", \"instance\": [ \"did:test:hub.id\" ] } }"
],
"verificationMethod": {
"id": "auth-key",
"type": "RS256",
"publicKeyJwk": {},
"controller": "did:rcw:71364c7e-0abe-49cf-9269-4661699f274b"
},
"authentication": "auth-key"
}
GET /api/v1/health HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
"status": "ok",
"info": {
"database": {
"status": "up"
}
},
"error": {},
"details": {
"database": {
"status": "up"
}
}
}
AlsoKnownAs property is a unique combination aadhaar and username.
ramesh@gmail.com
The method of DID.
POST /api/v1/did/generate HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 274
[
{
"alsoKnownAs": [
"ramesh@gmail.com"
],
"services": [
"{ \"id\": \"IdentityHub\", \"type\": \"IdentityHub\", \"serviceEndpoint\": { \"@context\": \"schema.identity.foundation/hub\", \"@type\": \"UserServiceEndpoint\", \"instance\": [ \"did:test:hub.id\" ] } }"
],
"method": "text"
}
]
[
{
"id": "did:rcw:71364c7e-0abe-49cf-9269-4661699f274b",
"alsoKnownAs": [
"ramesh@gmail.com"
],
"service": [
"{ \"id\": \"IdentityHub\", \"type\": \"IdentityHub\", \"serviceEndpoint\": { \"@context\": \"schema.identity.foundation/hub\", \"@type\": \"UserServiceEndpoint\", \"instance\": [ \"did:test:hub.id\" ] } }"
],
"verificationMethod": {
"id": "auth-key",
"type": "RS256",
"publicKeyJwk": {},
"controller": "did:rcw:71364c7e-0abe-49cf-9269-4661699f274b"
},
"authentication": "auth-key"
}
]
The unique DID id of the issuer.
JSON string of the unsigned VC.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "did:ulp:b4a191af-d86e-453c-9d0e-dd4771067235", "type": [ "VerifiableCredential", "UniversityDegreeCredential" ], "issuer": "did:rcw:6b9d7b31-bc7f-454a-be30-b6c7447b1cff", "expirationDate": "2023-02-08T11:56:27.259Z", "credentialSubject": { "id": "did:rcw:6b9d7b31-bc7f-454a-be30-b6c7447b1cff", "grade": "9.23", "programme": "B.Tech", "certifyingInstitute": "IIIT Sonepat", "evaluatingInstitute": "NIT Kurukshetra" }, "options": { "created": "2020-04-02T18:48:36Z", "credentialStatus": { "type": "RevocationList2020Status" } } }
POST /api/v1/utils/sign HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 730
{
"DID": "text",
"payload": "{ \"@context\": [ \"https://www.w3.org/2018/credentials/v1\", \"https://www.w3.org/2018/credentials/examples/v1\" ], \"id\": \"did:ulp:b4a191af-d86e-453c-9d0e-dd4771067235\", \"type\": [ \"VerifiableCredential\", \"UniversityDegreeCredential\" ], \"issuer\": \"did:rcw:6b9d7b31-bc7f-454a-be30-b6c7447b1cff\", \"expirationDate\": \"2023-02-08T11:56:27.259Z\", \"credentialSubject\": { \"id\": \"did:rcw:6b9d7b31-bc7f-454a-be30-b6c7447b1cff\", \"grade\": \"9.23\", \"programme\": \"B.Tech\", \"certifyingInstitute\": \"IIIT Sonepat\", \"evaluatingInstitute\": \"NIT Kurukshetra\" }, \"options\": { \"created\": \"2020-04-02T18:48:36Z\", \"credentialStatus\": { \"type\": \"RevocationList2020Status\" } } }"
}
{
"publicKey": "{\"kty\": \"EC\",\"crv\": \"secp256k1\",\"x\": \"1iTtnvgP141NM-4qC6BgmkeTAjV7u-gZWni71G7cAKo\",\"y\": \"VSGqq6yS0w7riXXRqFxXwKvHgIpQaUNMlFQKh-xgKMI\"}",
"signed": "text"
}