API-of-Me
Search…
Verifier Flow Setup
NOTE: All calls to Exchange APIs will need the header Meeco-Subscription-Key, this should have already been provided, please reach out to Meeco if there are any issues. EXCHANGE_BASE_URL = https://sandbox.meeco.me/exchange

Overview

For the initial implementation, Meeco recommends calling its Exchange API endpoints in your application's back end to verify presentations provided by the wallet. In order for the Exchange to be able to verify a presentation though it must first be aware of the required structure of the presentation or "Presentation Definition". Steps 1 & 2 detail these interactions that need to take place before you start adding your application endpoints.
Your application must then have two endpoints for the Meeco Wallet to interact with based on the concept of a "Request". The request should have an associated "Presentation Definition" which your application should return, different requests may have the same or different presentation definitions, see Step 3 for more information on this. The second endpoint your application must have is an endpoint for the wallet to send the presentation (which meets the presentation definition), think of this as the "fulfillment" of the request. This second endpoint must accept the presentation, confirm its validity by checking it with the exchange API's "verify" endpoint then carry on with whatever business logic your application requires, see Step 4.
Two URLs pointing to these endpoints are packaged into an application deep-link to be provided to the wallet, see Step 5.

Detailed instructions

STEP 1: Create a definition using the Meeco exchange API

Request
POST​ {EXCHANGE_BASE_URL}/presentations​/definitions
Body
1
{
2
"name": "ABC ORG on employee boarding Application",
3
"purpose": "Requirements for Employee Compliance",
4
"input_descriptors": [
5
{
6
"id": "LearningRecordCredential",
7
"name": "WorkSafe Basic Training Module",
8
"purpose": "We can only allow compliant employees into the ABC ORG sites",
9
"schema": [
10
{
11
"uri": "https://vc-schemas.meeco.me/credentials/learningRecord/1.0/schema.json"
12
}
13
],
14
"group": ["A"]
15
}
16
],
17
"format": {
18
"jwt": {
19
"alg": ["ES256", "RS256"]
20
}
21
},
22
"submission_requirements": [
23
{
24
"name": "satisfy all inputs",
25
"rule": "all",
26
"from": "A"
27
}
28
]
29
}
Copied!
expect 201 response
1
{
2
"presentation_definition": {
3
"id": "dbe5a9bc-add8-4bf6-86ed-98eaf0f6e180",
4
"name": "ABC ORG on employee boarding Application",
5
"purpose": "Requirements for Employee Compliance",
6
"input_descriptors": [
7
{
8
"id": "LearningRecordCredential",
9
"name": "WorkSafe Basic Training Module",
10
"purpose": "We can only allow compliant employees into the ABC ORG sites",
11
"schema": [
12
{
13
"uri": "https://vc-schemas.meeco.me/credentials/learningRecord/1.0/schema.json"
14
}
15
],
16
"group": ["A"]
17
}
18
],
19
"format": {
20
"jwt": {
21
"alg": ["ES256", "RS256"]
22
}
23
},
24
"submission_requirements": [
25
{
26
"name": "satisfy all inputs",
27
"rule": "all",
28
"from": "A"
29
}
30
]
31
}
32
}
Copied!

STEP 2: Retrieve created definition by id & make sure its present in the Meeco exchange

GET request
GET {EXCHANGE_BASE_URL}/presentations/definitions/dbe5a9bc-add8-4bf6-86ed-98eaf0f6e180
expect 200 responses with the above-created definition.

STEP 3: create the definition endpoint in your verifier application - to serve the definition from, it should return the definition from step 2

This endpoint will be used to server Verifiable Presentation Definitions to Wallet later.
GET Request
RequestId must be unique for each request
https://{{yourAppBaseurl}}/requests/{{requestId}}/definition
NOTE: this above URL is just a suggested URL structure, your actual URL can be different
This endpoint should return the definition from step 2.

STEP 4: Create the destination endpoint in your verifier application - to receive the verifiable presentation in JSON-LD format - when the presentation is received verify with Meeco exchange API POST /presentations/verify endpoint

This endpoint will be used to receive Verifiable Presentation in JSON-LD format from Wallet later.
POST Request
https://{{yourAppBaseurl}}/requests/{{requestId}}/presentations NOTE: this above URL is just a suggested URL structure, your actual URL can be different
Accepts JSON in body
1
{
2
"proof": {
3
"type": "Ed25519Signature2018",
4
"proofPurpose": "assertionMethod",
5
"created": "2021-07-23T00:17:33.000Z",
6
"verificationMethod": "did:hedera:testnet:4G5VDMU2BuWC2EdAWHWuFnFxUHeypSSqqi3C9UpPfHu4;hedera:testnet:fid=0.0.78464",
7
"jws": "UHoShDKrqLClpsbdMe3Dj6Mxt7u0_MqrI7b1m-qdaAQ3Nbe876ou0t6_a782i6qEMElveUoEYBTMWoNnJ9McAg"
8
},
9
"verifiableCredential": [
10
{
11
"proof": {
12
"type": "Ed25519Signature2018",
13
"proofPurpose": "assertionMethod",
14
"created": "2021-07-23T00:13:45.000Z",
15
"verificationMethod": "did:hedera:testnet:8XMRRQUsABNEFfNnS8FBo1fHARo2tBB9HYQxBRkGVk8y;hedera:testnet:fid=0.0.78464#did-root-key",
16
"jws": "h7g383DMjEFtio9ILpFsF2F9bKcg010HruS61IFQ78YBcjm-eFj17N_6XYIiSqQhb1tHYLEMsefwmw7qdY4OBQ"
17
},
18
"@context": [
19
"https://vc-schemas.meeco.me/credentials/learningRecord/1.0/context.json",
20
"https://www.w3.org/2018/credentials/v1"
21
],
22
"type": ["VerifiableCredential"],
23
"issuer": {
24
"id": "did:hedera:testnet:8XMRRQUsABNEFfNnS8FBo1fHARo2tBB9HYQxBRkGVk8y;hedera:testnet:fid=0.0.78464"
25
},
26
"credentialSubject": {
27
"completionDate": "2021-01-02",
28
"course": {
29
"courseCode": "ws101",
30
"id": "122345",
31
"name": "WorkSafe Basic Training Module",
32
"provider": "WorkPro Training",
33
"version": "1.1"
34
},
35
"grade": "95",
36
"status": "compliant",
37
"type": "LearningRecordCredential",
38
"id": "did:hedera:testnet:4G5VDMU2BuWC2EdAWHWuFnFxUHeypSSqqi3C9UpPfHu4;hedera:testnet:fid=0.0.78464"
39
},
40
"issuanceDate": "2021-07-23T00:13:45.000Z",
41
"id": "urn:uuid:7b28fdde-9bab-4400-8a95-e5b49b1f9c24",
42
"expirationDate": "2025-01-01T00:00:00.000Z",
43
"credentialSchema": {
44
"id": "https://vc-schemas.meeco.me/credentials/learningRecord/1.0/schema.json",
45
"type": "JsonSchemaValidator2018"
46
}
47
}
48
],
49
"holder": "did:hedera:testnet:4G5VDMU2BuWC2EdAWHWuFnFxUHeypSSqqi3C9UpPfHu4;hedera:testnet:fid=0.0.78464",
50
"type": ["VerifiablePresentation"],
51
"@context": ["https://www.w3.org/2018/credentials/v1"],
52
"issuanceDate": "2021-07-23T00:17:33.000Z",
53
"presentation_submission": {
54
"id": "ffdc8dd1-69f9-46df-a731-d475eac1e9b4",
55
"definition_id": "45a1425c-ec0f-484d-b0fc-eaf8d38e81fb",
56
"descriptor_map": [
57
{
58
"id": "LearningRecordCredential",
59
"path": "$.verifiableCredential[0]",
60
"format": "ldp_vc"
61
}
62
]
63
}
64
}
Copied!
Verify the above presentation using exchange API POST /presentations/verify by submitting the above JSON Body.
meecowallet://request?destination=http%3A%2F%2Flocalhost%3A3002%2Frequests%2F012ba582-e5a1-4245-b16b-5664e44911c8%2Fpresentations&definition=http%3A%2F%2Flocalhost%3A3002%2Frequests%2F012ba582-e5a1-4245-b16b-5664e44911c8%2Fdefinition
QueryParams detail
definition = A URL for the wallet to request the Verifiable Presentation Definitions
destination = A URL for the wallet to post its Verifiable Presentation
Wallet creates a request once the above deep link URL is clicked on the mobile phone or QR code is scanned. e.g.
if the wallet has all the required credentials then it lets the user submit the request to the verify
Note: Importing Credential flow Is not available for now. So make sure LearningCredentials are already issued for Wallet or Push new LearningCredentials to the wallet before starting the presentation request flow.
Last modified 13d ago