Issuer-initiated issuance invitation
When an issuer wants to offer a credential to holders they do not know in advance, the issuer can create an issuance invitation containing a credential offer.
Creating an issuance invitation
issuer1
can create an issuance invitation by using the following curl
command:
curl --location 'https://${service_url}/v1.0/diagency/invitations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${issuer1_verifiable_credentials_access_token}' \
--data '{
"attach": {
"recipient": "invitee",
"use_connection": true,
"cred_offer": {
"schema_name": "course",
"schema_version": "1.0",
"attributes": {
"class": "Math 100",
"grade": "A",
"rank": "2",
"instructor": "Dr. Math"
}
}
}
}'
The response includes details about the invitation:
{
"id": "2411c871-ba0d-435b-8941-a7a6b77aafc6",
"url": "https://${service_url}/diagency/a2a/v1/messages/605000BP6Q/invitation?oob=eyJAaWQiOiIyN...",
"short_url": "https://${service_url}/diagency/a2a/v1/messages/605000BP6Q/invitation?id=2411c871-ba0d-435b-8941-a7a6b77aafc6",
"direct_route": true,
"manual_accept": false,
"max_acceptances": -1,
"cur_acceptances": 0,
"recipient_key": "96fDZSXwVUjZCzHVSLscmLyhB2Z6Zh6yt4FmYuf1f5J5",
...
}
Accepting the issuance invitation
user1
accepts the invitation by using the short_url
provided in
the response:
curl --location --request PUT 'https://${service_url}/v1.0/diagency/invitation_processor' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${user1_verifiable_credentials_access_token}' \
--data '{
"url": "https://${service_url}/diagency/a2a/v1/messages/605000BP6Q/invitation?id=2411c871-ba0d-435b-8941-a7a6b77aafc6"
}'
After the invitation is accepted, user1 can view and accept the credential offer as described in the previous steps.