Inrupt Data Wallet Postman Tutorial Resources

receipt.json

{
  "receiptNumber": "TOW-12345",
  "date": "2024-10-09",
  "towingCompany": {
    "name": "Quick Tow Services",
    "address": "123 Main St, Anytown, USA",
    "phone": "(555) 123-4567"
  },
  "customer": {
    "name": "Alice Smith",
    "phone": "(555) 987-6543"
  },
  "vehicle": {
    "make": "KI",
    "model": "KITT",
    "year": 2020,
    "color": "Blue",
    "licensePlate": "ABC-1234"
  },
  "towingDetails": {
    "pickupLocation": "456 Oak Ave, Anytown, USA",
    "dropoffLocation": "789 Elm St, Anytown, USA",
    "reason": "Vehicle breakdown",
    "distance": 15.5
  },
  "charges": {
    "hookupFee": 75.00,
    "mileageCharge": 62.00,
    "additionalServices": [
      {
        "description": "Winching",
        "amount": 50.00
      }
    ],
    "subtotal": 187.00,
    "tax": 14.96,
    "total": 201.96
  },
  "paymentMethod": "Credit Card",
  "notes": "Vehicle towed due to engine failure. Customer to contact repair shop for further assistance.",
  "signature": "Alice Smith"
}

repair_history.json

{
  "repairReport": {
    "serviceType": "Oil Change",
    "vehicle": {
      "make": "KI",
      "model": "KITT",
      "year": 2020,
      "vin": "1HGBH41JXMN109186",
      "mileage": 35000
    },
    "serviceProvider": {
      "name": "Frank's Shop",
      "address": "123 Main St, Southampton, PA 18966",
      "phone": "(215) 555-1234",
      "webid": "https://id.inrupt.com/frankshop"
    },
    "serviceDate": "2024-03-10",
    "serviceDetails": {
      "oilType": "Full Synthetic",
      "oilBrand": "Mobil 1",
      "oilWeight": "5W-30",
      "oilQuantity": 5,
      "filterBrand": "Fram",
      "filterModel": "XG7317"
    },
    "additionalServices": [
      "Tire pressure check",
      "Fluid levels check",
      "Air filter inspection"
    ],
    "cost": {
      "laborCost": 39.95,
      "partsCost": 40.00,
      "totalCost": 79.95
    },
    "nextServiceDue": {
      "mileage": 40000,
      "date": "2025-04-10"
    },
    "notes": "Vehicle in good condition. Recommended brake inspection at next service."
  }
}

repair_receipt.json

{
  "receipt": {
    "date": "2024-10-10",
    "customer": {
      "name": "Alice",
      "phone": "(555) 987-6543"
    },
    "serviceProvider": {
      "name": "Charlie's Shop",
      "address": "456 Oak St, Riverside, CA 92501",
      "phone": "(951) 555-7890",
      "webid": "https://id.inrupt.com/charlieshop"
    },
    "serviceDetails": {
      "serviceType": "Sensor Replacement",
      "vehicle": {
        "make": "KI",
        "model": "KITT",
        "year": 2020,
        "vin": "1HGBH41JXMN109186"
      },
      "sensorReplaced": "Oxygen Sensor",
      "sensorPartNumber": "234-5009"
    },
    "costBreakdown": {
      "laborCost": 195.00,
      "partsCost": 589.99,
      "totalCost": 784.99
    },
    "paymentMethod": {
      "method": "Credit Card",
      "transactionId": "TXN123456789"
    },
    "notes": [
      "Replaced faulty oxygen sensor.",
      "Fuel efficiency should improve.",
      "Monitor fuel economy and engine performance."
    ]
  }
}

repair_report.json

{
  "repairReport": {
    "serviceType": "Sensor Replacement",
    "vehicle": {
      "make": "KI",
      "model": "KITT",
      "year": 2020,
      "vin": "1HGBH41JXMN109186",
      "mileage": 37500
    },
    "serviceProvider": {
      "name": "Charlie's Shop",
      "address": "456 Oak St, Riverside, CA 92501",
      "phone": "(951) 555-7890",
      "webid": "https://id.inrupt.com/charlieshop"
    },
    "serviceDate": "2024-10-10",
    "serviceDetails": {
      "sensorReplaced": "Oxygen Sensor",
      "sensorLocation": "Bank 1, Sensor 2",
      "sensorBrand": "Denso",
      "sensorPartNumber": "234-5009",
      "oldSensorCondition": "Faulty, causing decreased fuel efficiency"
    },
    "additionalServices": [
      "Diagnostic scan",
      "Cleared check engine light",
      "Test drive to confirm proper operation"
    ],
    "cost": {
      "laborCost": 195.00,
      "partsCost": 589.99,
      "totalCost": 784.99
    },
    "nextServiceDue": {
      "mileage": 42500,
      "date": "2025-04-10"
    },
    "notes": "Replaced faulty oxygen sensor. Fuel efficiency should improve. Recommend monitoring fuel economy and engine performance over the next few weeks."
  }
}

Solid Wallet Collection.postman_collection.json

{
  "info": {
    "_postman_id": "30c6fad0-3892-4123-8b30-fde297c90e83",
    "name": "Solid Wallet Collection",
    "description": "This collection is intended to show how the Solid Wallet API works. It also demonstrates the multiple scenarios in which the wallet could interact with another agent (a possible companion application) to obtain the right level of consent for the wallet data.\n\nThis Postman collection requires a specific order of execution due to dependencies between requests. Variables set in earlier requests may be used as inputs for subsequent requests, creating a chain of dependencies.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "20774119"
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Home Copy",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  ""
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{openid}}",
              "host": ["{{openid}}"]
            }
          },
          "response": []
        },
        {
          "name": "Discovery Copy",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "pm.test(\"Check discovery of JWK uri\", function() {",
                  "    pm.expect(jsonData.jwks_uri).not.empty.string;",
                  "})",
                  "",
                  "pm.test(\"Check discovery of registration endpoint\", function() {",
                  "    pm.expect(jsonData.registration_endpoint).not.empty.string;",
                  "    pm.environment.set(\"openid.registration.endpoint\", jsonData.registration_endpoint);",
                  "})",
                  "",
                  "pm.test(\"Check discovery of authorization endpoint\", function() {",
                  "    pm.expect(jsonData.authorization_endpoint).not.empty.string;",
                  "    pm.environment.set(\"openid.authorization.endpoint\", jsonData.authorization_endpoint);",
                  "})",
                  "",
                  "pm.test(\"Check discovery of token endpoint\", function() {",
                  "    pm.expect(jsonData.token_endpoint).not.empty.string;",
                  "    pm.environment.set(\"openid.token.endpoint\", jsonData.token_endpoint);",
                  "})",
                  "",
                  "pm.test(\"Check discovery of logout endpoint\", function() {",
                  "    pm.expect(jsonData.end_session_endpoint).not.empty.string;",
                  "    pm.environment.set(\"openid.logout.endpoint\", jsonData.end_session_endpoint);",
                  "})",
                  "",
                  ""
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{openid}}/.well-known/openid-configuration",
              "host": ["{{openid}}"],
              "path": [".well-known", "openid-configuration"]
            }
          },
          "response": []
        },
        {
          "name": "Create access token from client credential for agent1",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = JSON.parse(responseBody);",
                  "pm.collectionVariables.set(\"walletAccessToken\", jsonData.access_token);",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "username",
                  "value": "{{agent1.client_id}}",
                  "type": "string"
                },
                {
                  "key": "password",
                  "value": "{{agent1.client_secret}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "User-Agent",
                "value": "{{user.agent}}"
              },
              {
                "key": "traceparent",
                "value": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
              },
              {
                "key": "x-request-id",
                "value": "%22%2C%22somekey%22%3A%20%22somevalue%22%2C",
                "disabled": true
              },
              {
                "key": "baggage",
                "value": "x-request-id=abc",
                "disabled": true
              },
              {
                "key": "x-correlation-id",
                "value": "123\\t\\texample.com"
              }
            ],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials",
                  "type": "text"
                },
                {
                  "key": "scope",
                  "value": "openid webid",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{openid.token.endpoint}}",
              "host": ["{{openid.token.endpoint}}"]
            }
          },
          "response": []
        },
        {
          "name": "Create access token from client credential for demoApp",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = JSON.parse(responseBody);",
                  "pm.collectionVariables.set(\"companionAppAccessToken\", jsonData.access_token);",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "password",
                  "value": "{{agent2.client_secret}}",
                  "type": "string"
                },
                {
                  "key": "username",
                  "value": "{{agent2.client_id}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "User-Agent",
                "value": "{{user.agent}}"
              },
              {
                "key": "traceparent",
                "value": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
              },
              {
                "key": "x-request-id",
                "value": "%22%2C%22somekey%22%3A%20%22somevalue%22%2C",
                "disabled": true
              },
              {
                "key": "baggage",
                "value": "x-request-id=abc",
                "disabled": true
              },
              {
                "key": "x-correlation-id",
                "value": "123\\t\\texample.com"
              }
            ],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials",
                  "type": "text"
                },
                {
                  "key": "scope",
                  "value": "openid webid",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{openid.token.endpoint}}",
              "host": ["{{openid.token.endpoint}}"]
            }
          },
          "response": []
        },
        {
          "name": "Check login info",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/login/userInfo",
              "host": ["{{wallet_api}}"],
              "path": ["login", "userInfo"]
            }
          },
          "response": []
        },
        {
          "name": "Check login",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/login/success",
              "host": ["{{wallet_api}}"],
              "path": ["login", "success"]
            }
          },
          "response": []
        }
      ],
      "description": "This collection is used to discover the broker endpoint. It makes two POST to be able to authenticate with a wallet and a possible companion app for consent interactions."
    },
    {
      "name": "Wallet CRUD Collection",
      "item": [
        {
          "name": "List Wallet Items",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true,
            "disabledSystemHeaders": {}
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "urlencoded",
              "urlencoded": []
            },
            "url": {
              "raw": "{{wallet_api}}/wallet",
              "host": ["{{wallet_api}}"],
              "path": ["wallet"]
            }
          },
          "response": []
        },
        {
          "name": "Upload a json file",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.collectionVariables.set(\"wallet.resource.file.name\",  \"filename.json\");"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": "postman-cloud:///1ef7b473-e069-4d10-a877-4c915f0086dc"
                },
                {
                  "key": "fileName",
                  "value": "filename.json",
                  "type": "text"
                },
                {
                  "key": "contentType",
                  "value": "application/json",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{wallet_api}}/wallet",
              "host": ["{{wallet_api}}"],
              "path": ["wallet"]
            }
          },
          "response": []
        },
        {
          "name": "Get wallet resource",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/wallet/{{wallet.resource.file.name}}",
              "host": ["{{wallet_api}}"],
              "path": ["wallet", "{{wallet.resource.file.name}}"]
            }
          },
          "response": []
        },
        {
          "name": "Delete wallet resource",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/wallet/{{wallet.resource.file.name}}",
              "host": ["{{wallet_api}}"],
              "path": ["wallet", "{{wallet.resource.file.name}}"]
            }
          },
          "response": []
        }
      ],
      "description": "This collection uses the wallet API to GET, PUT, and DELETE resources from a user's Wallet. PUT requests can be used to upload both JSON files and other file types by utilizing multipart/form-data encoding.\n\nFeatures are listed here: [https://docs.inrupt.com/data-wallet/features/#](https://docs.inrupt.com/data-wallet/features/#)",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [""]
          }
        },
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [""]
          }
        }
      ]
    },
    {
      "name": "Flow: Save a Credential to your Wallet",
      "item": [
        {
          "name": "Get Credential",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.environment.set(\"pm.variable.public_credential\", jsonData);",
                  "",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{public_credential}}",
              "host": ["{{public_credential}}"]
            }
          },
          "response": []
        },
        {
          "name": "Save a Credential to the Wallet",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "filename",
                  "value": "Public Credential",
                  "type": "text"
                },
                {
                  "key": "file",
                  "value": "publicCredential.json",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{wallet_api}}/wallet",
              "host": ["{{wallet_api}}"],
              "path": ["wallet"]
            }
          },
          "response": []
        }
      ],
      "description": "Documentation can be found in the following link:\n\n[https://docs.inrupt.com/data-wallet/patterns-and-flows/#download-a-resource-into-the-wallet](https://docs.inrupt.com/data-wallet/patterns-and-flows/#download-a-resource-into-the-wallet)"
    },
    {
      "name": "Flow: Share a Resource with Companion Demo App",
      "item": [
        {
          "name": "CompanionAppRequestAccess",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [""],
                "type": "text/javascript",
                "packages": {}
              }
            },
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 201\", function() {",
                  "    pm.response.to.have.status(201)",
                  "})",
                  "",
                  "pm.test(\"Discover created VC URI\", function() {",
                  "    var vcUrl = pm.response.headers.get(\"Location\")",
                  "    pm.expect(vcUrl).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.uri\", vcUrl);",
                  "})",
                  "",
                  "",
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.test(\"Discover proof endpoint\", function() {",
                  "    pm.expect(jsonData.proof.verificationMethod).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.proof.uri\", jsonData.proof.verificationMethod);",
                  "})",
                  "",
                  "",
                  "pm.test(\"Discover status URI\", function() {",
                  "    pm.expect(jsonData.credentialStatus.id).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.status.uri\", jsonData.credentialStatus.id);",
                  "})",
                  "",
                  "pm.collectionVariables.set(\"vc.body\", responseBody);",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{companionAppAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"credential\": {\n        \"@context\": [\"https://www.w3.org/2018/credentials/v1\", \"https://schema.inrupt.com/credentials/v1.jsonld\" ],\n        \"type\": [\"VerifiableCredential\"],\n        \"credentialSubject\": {\n            \"hasConsent\": [{\n                \"mode\":[\"http://www.w3.org/ns/auth/acl#Read\"],\n                \"forPersonalData\": [\n                    \"{{resource_to_share}}\"\n                ],\n                \"isConsentForDataSubject\": \"{{webid_wallet}}\",\n                \"hasStatus\":\"https://w3id.org/GConsent#ConsentStatusRequested\",\n                \"forPurpose\":\"https://example.com/SpecificPurpose\"\n            }]\n        }\n    }\n}"
            },
            "url": {
              "raw": "{{vc}}/issue",
              "host": ["{{vc}}"],
              "path": ["issue"]
            }
          },
          "response": []
        },
        {
          "name": "Send AR to inbox",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "var vp = \"{\\\"@context\\\": [ \\\"https://www.w3.org/2018/credentials/v1\\\" ], \\\"type\\\": \\\"VerifiablePresentation\\\", \\\"verifiableCredential\\\": [\" + pm.collectionVariables.get(\"vc.body\") + \" ]}\"",
                  "",
                  "pm.collectionVariables.set(\"vp\", vp);",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{companionAppAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{{vp}}\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{pod}}/inbox/",
              "host": ["{{pod}}"],
              "path": ["inbox", ""]
            }
          },
          "response": []
        },
        {
          "name": "Get List ARs from Inbox",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.request.id\",  jsonData[0].uuid);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox",
              "host": ["{{wallet_api}}"],
              "path": ["inbox"]
            }
          },
          "response": []
        },
        {
          "name": "Accept Access Request",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox/{{wallet.access.request.id}}/grantAccess",
              "host": ["{{wallet_api}}"],
              "path": ["inbox", "{{wallet.access.request.id}}", "grantAccess"]
            }
          },
          "response": []
        },
        {
          "name": "List Access Grants",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.grant.id\",  jsonData[0].uuid);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants"]
            }
          },
          "response": []
        },
        {
          "name": "Get Access Grant",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.test(\"Discover status URI\", function() {",
                  "    pm.expect(jsonData.credentialStatus.id).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.status.uri\", jsonData.credentialStatus.id);",
                  "})",
                  "pm.test(\"Discover created VC URI\", function() {",
                  "    pm.collectionVariables.set(\"vp\", responseBody);",
                  "})",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants/{{wallet.access.grant.id}}",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "{{wallet.access.grant.id}}"]
            }
          },
          "response": []
        }
      ],
      "description": "Documentation can be found in the following link:\n\n[https://docs.inrupt.com/data-wallet/patterns-and-flows/#share-a-resource-with-a-third-party-application](https://docs.inrupt.com/data-wallet/patterns-and-flows/#share-a-resource-with-a-third-party-application)\n\nThe companion app (agent_2) will request data from the wallet. The companion app will send that request to the wallet inbox.\n\nWallet will get information on their request inbox.\n\nWallet user to accept or denied request."
    },
    {
      "name": "Flow: Share Identity to Write into Wallet",
      "item": [
        {
          "name": "Dereference Webid",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "let jsonData = pm.response.json();",
                  "let storageUrl = jsonData[\"http://www.w3.org/ns/pim/space#storage\"][\"@id\"];",
                  "pm.collectionVariables.set(\"wallet.storage\", storageUrl.concat(\"wallet\"));",
                  "",
                  "console.log(\"Storage URL:\", pm.collectionVariables.get(\"wallet.storage\"));",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disabledSystemHeaders": {
              "accept": true
            }
          },
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/ld+json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{agent1.webid}}",
              "host": ["{{agent1.webid}}"]
            }
          },
          "response": []
        },
        {
          "name": "AR to Write in Wallet",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 201\", function() {",
                  "    pm.response.to.have.status(201)",
                  "})",
                  "",
                  "pm.test(\"Discover created VC URI\", function() {",
                  "    var vcUrl = pm.response.headers.get(\"Location\")",
                  "    pm.expect(vcUrl).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.uri\", vcUrl);",
                  "})",
                  "",
                  "",
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.test(\"Discover proof endpoint\", function() {",
                  "    pm.expect(jsonData.proof.verificationMethod).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.proof.uri\", jsonData.proof.verificationMethod);",
                  "})",
                  "",
                  "",
                  "pm.test(\"Discover status URI\", function() {",
                  "    pm.expect(jsonData.credentialStatus.id).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.status.uri\", jsonData.credentialStatus.id);",
                  "})",
                  "",
                  "pm.collectionVariables.set(\"vc.body\", responseBody);"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{companionAppAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"credential\": {\n        \"@context\": [\"https://www.w3.org/2018/credentials/v1\", \"https://schema.inrupt.com/credentials/v1.jsonld\"],\n        \"type\": [\"VerifiableCredential\"],\n        \"credentialSubject\": {\n            \"hasConsent\": [{\n                \"mode\":[\"http://www.w3.org/ns/auth/acl#Write\"],\n                \"forPersonalData\": [\n                    \"{{wallet.storage}}\"\n                ],\n                \"isConsentForDataSubject\": \"{{agent1.webid}}\",\n                \"hasStatus\":\"https://w3id.org/GConsent#ConsentStatusRequested\",\n                \"forPurpose\":\"https://example.com/SpecificPurpose\"\n            }]\n        }\n    }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{vc}}/issue",
              "host": ["{{vc}}"],
              "path": ["issue"]
            }
          },
          "response": []
        },
        {
          "name": "Send AR to inbox",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "var vp = \"{\\\"@context\\\": [ \\\"https://www.w3.org/2018/credentials/v1\\\" ], \\\"type\\\": \\\"VerifiablePresentation\\\", \\\"verifiableCredential\\\": [\" + pm.collectionVariables.get(\"vc.body\") + \" ]}\"",
                  "",
                  "pm.collectionVariables.set(\"vp\", vp);"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{companionAppAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{{vp}}\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{pod}}inbox/",
              "host": ["{{pod}}inbox"],
              "path": [""]
            }
          },
          "response": []
        },
        {
          "name": "Get List ARs from Inbox",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.request.id\",  jsonData[0].uuid);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox",
              "host": ["{{wallet_api}}"],
              "path": ["inbox"]
            }
          },
          "response": []
        },
        {
          "name": "Accept Access Request",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox/{{wallet.access.request.id}}/grantAccess",
              "host": ["{{wallet_api}}"],
              "path": ["inbox", "{{wallet.access.request.id}}", "grantAccess"]
            }
          },
          "response": []
        },
        {
          "name": "List Access Grants",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.grant.id\",  jsonData[0].uuid);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants"]
            }
          },
          "response": []
        },
        {
          "name": "Get Access Grant",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "",
                  "pm.test(\"Discover status URI\", function() {",
                  "    pm.expect(jsonData.credentialStatus.id).not.empty.string;",
                  "    pm.collectionVariables.set(\"vc.status.uri\", jsonData.credentialStatus.id);",
                  "})",
                  "pm.test(\"Discover created VC URI\", function() {",
                  "    pm.collectionVariables.set(\"vp\", responseBody);",
                  "})",
                  ""
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants/{{wallet.access.grant.id}}",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "{{wallet.access.grant.id}}"]
            }
          },
          "response": []
        }
      ],
      "description": "Documentation can be found in the following link:\n\n[https://docs.inrupt.com/data-wallet/patterns-and-flows/#sharing-wallet-digital-identity](https://docs.inrupt.com/data-wallet/patterns-and-flows/#sharing-wallet-digital-identity)"
    },
    {
      "name": "Flow:Access Prompt",
      "item": [
        {
          "name": "Access Prompt to Companion App",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{companionAppToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{ \"resource\": \"{{resource_accessprompt}}\",\n \"client\": \"{{appClientID}}\",\n \"webid\":\"{{webid_wallet}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{companionapp_api}}/accessprompt",
              "host": ["{{companionapp_api}}"],
              "path": ["accessprompt"]
            }
          },
          "response": []
        },
        {
          "name": "Get List ARs from Inbox",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.request.id\",  jsonData[0].uuid);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox",
              "host": ["{{wallet_api}}"],
              "path": ["inbox"]
            }
          },
          "response": []
        },
        {
          "name": "Grant Access Request",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox/{{wallet.access.request.id}}/grantAccess",
              "host": ["{{wallet_api}}"],
              "path": ["inbox", "{{wallet.access.request.id}}", "grantAccess"]
            }
          },
          "response": []
        },
        {
          "name": "List Access Grants",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "",
                  "pm.test(\"Status code is 200\", function() {",
                  "    pm.response.to.have.status(200)",
                  "})",
                  "",
                  "var jsonData = pm.response.json();",
                  "if (jsonData.length > 0) {",
                  "    pm.collectionVariables.set(\"wallet.access.grant.id\",  jsonData[0].uuid);",
                  "}",
                  "",
                  "console.log(pm.collectionVariables.get(\"wallet.access.grant.id\"));"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants"]
            }
          },
          "response": []
        },
        {
          "name": "Get Access Grant",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants/{{wallet.access.grant.id}}",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "{{wallet.access.grant.id}}"]
            }
          },
          "response": []
        }
      ],
      "description": "Documentation can be found in the following link:\n\n[https://docs.inrupt.com/data-wallet/patterns-and-flows/#scan-a-qr-code-to-share-a-resource](https://docs.inrupt.com/data-wallet/patterns-and-flows/#scan-a-qr-code-to-share-a-resource)\n\nThe companion app needs an endpoint to trigger an Access Request and send it to the Wallet inbox."
    },
    {
      "name": "Other Consent Behavior",
      "item": [
        {
          "name": "Delete Access Grant",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants/{{wallet.access.grant.id}}",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "{{wallet.access.grant.id}}"]
            }
          },
          "response": []
        },
        {
          "name": "Revoke Access Grant",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/accessgrants/{{wallet.access.grant.id}}/revoke",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "{{wallet.access.grant.id}}", "revoke"]
            }
          },
          "response": []
        },
        {
          "name": "Bulk Revoke Access Grant",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"uuids\": [\"{{wallet.access.grant.id}}\"]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{wallet_api}}/accessgrants/revoke",
              "host": ["{{wallet_api}}"],
              "path": ["accessgrants", "revoke"]
            }
          },
          "response": []
        },
        {
          "name": "Deny Access Request",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{walletAccessToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{wallet_api}}/inbox/{{wallet.access.request.id}}/denyAccess",
              "host": ["{{wallet_api}}"],
              "path": ["inbox", "{{wallet.access.request.id}}", "denyAccess"]
            }
          },
          "response": []
        }
      ],
      "description": "These requests deal with another consent cases such as revoke access to a resource or deny an access requests.\n\nMore information can be found here: [https://docs.inrupt.com/data-wallet/features/#requests](https://docs.inrupt.com/data-wallet/features/#requests)"
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "exec": [""]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "exec": [""]
      }
    }
  ],
  "variable": [
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "wallet.resource.file.name",
      "value": ""
    },
    {
      "key": "accessTokenDemo",
      "value": ""
    },
    {
      "key": "vc.uri",
      "value": ""
    },
    {
      "key": "vc.proof.uri",
      "value": ""
    },
    {
      "key": "vc.status.uri",
      "value": ""
    },
    {
      "key": "vc.body",
      "value": ""
    },
    {
      "key": "vp",
      "value": ""
    },
    {
      "key": "vc",
      "value": ""
    },
    {
      "key": "wallet.access.request.id",
      "value": ""
    },
    {
      "key": "wallet.access.grant.id",
      "value": ""
    },
    {
      "key": "wallet.storage",
      "value": ""
    },
    {
      "key": "accessTokenTest",
      "value": ""
    },
    {
      "key": "uma.ticket",
      "value": ""
    },
    {
      "key": "uma.access_token",
      "value": ""
    },
    {
      "key": "vp.encoded",
      "value": ""
    },
    {
      "key": "walletAccessToken",
      "value": ""
    },
    {
      "key": "businessAppAccessToken",
      "value": ""
    },
    {
      "key": "companionAppAccessToken",
      "value": ""
    }
  ]
}

Solid-Wallet.postman_environment.json

{
	"id": "5f0f7cdd-d522-45cd-998e-367d0fcf5771",
	"name": "Solid-Wallet",
	"values": [
		{
			"key": "domain",
			"value": "inrupt.com",
			"enabled": true
		},
		{
			"key": "openid",
			"value": "https://login.{{domain}}",
			"enabled": true
		},
		{
			"key": "webid",
			"value": "https://id.{{domain}}",
			"enabled": true
		},
		{
			"key": "uma",
			"value": "https://uma.{{domain}}",
			"enabled": true
		},
		{
			"key": "storage",
			"value": "https://storage.{{domain}}",
			"enabled": true
		},
		{
			"key": "user.agent",
			"value": "Solid Wallet Collection",
			"type": "default",
			"enabled": true
		},
		{
			"key": "pod",
			"value": "",
			"enabled": true
		},
		{
			"key": "agent1.webid",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "agent1.client_id",
			"value": "",
			"enabled": true
		},
		{
			"key": "agent1.client_secret",
			"value": "",
			"enabled": true
		},
		{
			"key": "openid.registration.endpoint",
			"value": "",
			"type": "any",
			"enabled": true
		},
		{
			"key": "openid.authorization.endpoint",
			"value": "",
			"type": "any",
			"enabled": true
		},
		{
			"key": "openid.token.endpoint",
			"value": "",
			"type": "any",
			"enabled": true
		},
		{
			"key": "openid.logout.endpoint",
			"value": "",
			"type": "any",
			"enabled": true
		},
		{
			"key": "agent2.webid",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "agent2.client_id",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "agent2.client_secret",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "wallet_api",
			"value": "https://datawallet.{{domain}}",
			"type": "default",
			"enabled": true
		},
		{
			"key": "vc",
			"value": "https://vc.{{domain}}",
			"type": "default",
			"enabled": true
		},
		{
			"key": "resource_to_share",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "webid_wallet",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "resource_accessprompt",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "companionapp_api",
			"value": "",
			"enabled": true
		},
		{
			"key": "public_credential",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "companionAppToken",
			"value": "",
			"type": "default",
			"enabled": true
		},
		{
			"key": "appClientID",
			"value": "",
			"type": "default",
			"enabled": true
		}
	],
	"_postman_variable_scope": "environment",
	"_postman_exported_at": "2024-10-11T17:56:36.633Z",
	"_postman_exported_using": "Postman/11.15.0"
}