Claim

Claim credential

post

Claim specific credential. User has to pass authorization token in header and data in request body.authorization header has to contain Bearer and token returned from previous token endpoint. In request body user has to pass types array with type of credential being claimed, format string with format of the credential, and proof object with proof_type string and jwt string. proof_type is a string that represents the type of the proof, which is in our case jwt.jwt is a string that represents the JWT token which is generated by wallet and acts as a proof of posession JWT. If successful, the server returns an object with credential, format, c_nonce and c_nonce_expires_in properties. credential is a string that represents the JWT token which contains all the details about the claimed credential. format is a string that represents the format of the credential. c_nonce is a string that represents c-nonce and c_nonce_expires_in is a number that represents the expiration time of the c-nonce in seconds.


If the API is NOT running in DEMO MODE, note that the resources must be creating using POST /private/credential-offers otherwise it will return errors

Path parameters
correlationIdstringRequired

Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with!

Example: nchain
Header parameters
AuthorizationstringOptional

Authorization retrieved from token endpoint

Body
formatstringRequired

The format of the credential we choose when issuing.

Example: jwt_vc_json
credential_definitionall ofRequired

Credential definition metadata

proofall ofRequired

Credential proof

Responses
200Success
application/json
post
POST /products/web/$IDENTITY_ENV_ID/issuer/api/public/{correlationId}/credentials HTTP/1.1
Host: identity.nchainplatform.com
Content-Type: application/json
Accept: */*
Content-Length: 767

{
  "format": "jwt_vc_json",
  "credential_definition": {
    "type": [
      "EmailCredential"
    ],
    "credentialSubject": {
      "name-of-claim": {
        "value_type": "string",
        "mandatory": true,
        "display": []
      }
    }
  },
  "proof": {
    "proof_type": "jwt",
    "jwt": "eyJ0eXAiOiJvcGVuaWQ0dmNpLXByb29mK2p3dCIsImFsZyI6IkVTMjU2SyIsImtpZCI6ImRpZDpic3Y6ZWNhYTQwMjhlYzNjMzY3YjBlOTA3MjdmYjVlNjdlZDAxNzM2MDRlYTZmZWNjNGIyYzhjMjhlMWU2NDEyNjIxNCNzdWJqZWN0LWtleSJ9.eyJpYXQiOjE3MDcyOTUyOTEuMjEsImV4cCI6MTcwNzI5NTk1MS4yMSwiYXVkIjoiaHR0cHM6Ly84ZmNmLTIxMy0xNzItMjM0LT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wNzI3ZmI1ZTY3ZWQwMTczNjA0ZWE2ZmVjYzRiMmM4YzI4ZTFlNjQxMjYyMTQiLCJuYmYiOjE3MDc5MjA0NjIsImlzcyI6ImRpZDpic3Y6ZDdkZGNjMDBjMTRmOWJjY2UxMTM1ZmMzYjMyNjE0YTFiM2I0NzIwYmU2NDA0NTA3NDNiYTZiODUxOTgzMzI1ZCJ9.BNtaFqWdZNCmCXodN8tZ5MHOflzxQnbnFnYAJcWruQMXF-l8V4c2nsyb-3mgdGy38SowpJgHplZri6-TkcM_mA",
  "format": "jwt_vc_json",
  "c_nonce": "bea65ef2-ebd3-4006-b095-e5fbd6d96ccd",
  "c_nonce_expires_in": 300000
}

Get access token to start the credential issuance.

post

Before claiming the credential, the user has to get an access token. This endpoint facilitates the retrieval of an access token with the provided client_id, grant_type and pre-authorized_code. The client_id is a string that represents the client ID. The grant_type is a string that represents the grant type, which is in our caseurn:ietf:params:oauth:grant-type:pre-authorized_code. The pre-authorized_code is a string that represents the pre-authorized code, which is generated by the web client when creating an offer. If successful, the server returns an object with access_token, token_type,expires_in, c_nonce, c_nonce_expires_in, authorization_pending and interval properties. access_token is a string that represents the access token. token_type is a string that represents the token type (bearer in our case). expires_in is a number that represents the expiration time of the token in seconds. c_nonce is a string that represents the c-nonce. c_nonce_expires_in is a number that represents the expiration time of the c-nonce in seconds. authorization_pending is a boolean that indicates if the authorization is pending (not used in our case). interval is a number that represents the interval in milliseconds.


If the API is NOT running in DEMO MODE, note that the resources must be creating using POST /private/credential-offers otherwise it will return errors

Path parameters
correlationIdstringRequired

Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with!

Example: nchain
Body
client_idstringRequired

The client ID.

Example: nChain:vc-wallet
grant_typestringRequired

The grant type to use

Example: urn:ietf:params:oauth:grant-type:pre-authorized_code
pre-authorized_codestringRequired

Pre Authorized code that references the credential to start token fetching

Example: ab407be3-d18f-4508-837e-6286329c1da2
Responses
200Success
application/json
post
POST /products/web/$IDENTITY_ENV_ID/issuer/api/public/{correlationId}/token HTTP/1.1
Host: identity.nchainplatform.com
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "client_id": "nChain:vc-wallet",
  "grant_type": "urn:ietf:params:oauth:grant-type:pre-authorized_code",
  "pre-authorized_code": "ab407be3-d18f-4508-837e-6286329c1da2"
}
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJpYXQiOjE3MDc5MjA5OTkxMTIsImV4cCI6MzAwLCJpc3MiOiJuY2hhaW4iLCJwcmVBdXRob3JpemVkQ29kZSI6ImExNmE0ZDIzLTZlZWEtNGE3MC1iZWU5LWE3MDRjYWY0NjQ1OSJ9.yqaNyNG_oiah3cb9ELU-ukKqxk_Utt5ntNeFuzC69w4LToRqHHWrMibyupluzKFxSiqEZ7lsKFta2mUdhPIO_Q",
  "token_type": "bearer",
  "c_nonce": "bea65ef2-ebd3-4006-b095-e5fbd6d96ccd",
  "c_nonce_expires_in": 30000,
  "authorization_pending": false,
  "interval": 300000
}