Identity Service APIs

get
Authorizations
Responses
200
The Health Check is successful
application/json
get
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"
    }
  }
}

Generate a new DID

post
Authorizations
Bodyobject[]
alsoKnownAsstring[]Required

AlsoKnownAs property is a unique combination aadhaar and username.

Example: [email protected]
methodstringRequired

The method of DID.

Responses
200
DID Generated
application/json
post
POST /api/v1/did/generate HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 274

[
  {
    "alsoKnownAs": [
      "[email protected]"
    ],
    "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": [
      "[email protected]"
    ],
    "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"
  }
]

Resolve a DID ID

get
Authorizations
Path parameters
idstringRequired

The DID ID to resolve

Responses
200
DID resolved
application/json
get
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": [
    "[email protected]"
  ],
  "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"
}

Sign an unsigned VC

post
Authorizations
Body
DIDstringRequired

The unique DID id of the issuer.

payloadstringRequired

JSON string of the unsigned VC.

Example: { "@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" } } }
Responses
200
VC Signed
application/json
post
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"
}

Verify a signed VC

post
Authorizations
Body
DIDstringRequired
Responses
201Success
application/json
ResponsebooleanExample: true
post
POST /api/v1/utils/verify HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "DID": "text"
}
201Success
true

Last updated