{ "info": { "_postman_id": "730ecb09-a163-441a-9a08-fc37591ea7b3", "name": "Azure Blockchain Workbench REST API (v1)", "description": "The Azure Blockchain Workbench REST API is a Workbench extensibility point, which allows developers to create and manage blockchain applications, manage users and organizations within a consortium, integrate blockchain applications into services and platforms, perform transactions on a blockchain, and retrieve transactional and contract data from a blockchain.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Applications", "item": [ { "name": "api/v1/applications", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications?", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications" ], "query": [ { "key": "top", "value": "{{top}}", "disabled": true }, { "key": "skip", "value": "{{skip}}", "disabled": true }, { "key": "enabled", "value": "{{enabled}}", "disabled": true }, { "key": "sortBy", "value": "{{sortBy}}", "disabled": true } ] }, "description": "Lists all blockchain applications to which a user has access in Workbench. Users who are Workbench administrators get\n all blockchain applications. Non-Workbench administrators get all blockchain applications for which they have at least one\n associated application role or an associated smart contract instance role." }, "response": [] }, { "name": "api/v1/applications", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data" } ], "body": { "mode": "formdata", "formdata": [ { "key": "appFile", "value": "{{appFile}}", "type": "text", "disabled": true } ] }, "url": { "raw": "https://{{baseURL}}/api/v1/applications", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications" ] }, "description": "Creates a new blockchain application. This method can only be performed by users who are\n Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "Gets the blockchain application matching a specific application ID. Users who are Workbench administrators get\n the blockchain application. Non-Workbench administrators get the blockchain application if they have at least one associated\n application role or is associated with a smart contract instance role." }, "response": [] }, { "name": "api/v1/applications/{appID}", "request": { "method": "DELETE", "header": [], "body": {}, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "Deletes the specified blockchain application. This method can only be performed by users who are\n Workbench administrators. NOTE: Currently not implemented." }, "response": [] }, { "name": "api/v1/applications/{appID}/enable", "request": { "method": "PATCH", "header": [], "body": {}, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/enable", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "enable" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "Enables the specified blockchain application. This method can only be performed by users who are\n Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}/disable", "request": { "method": "PATCH", "header": [], "body": {}, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/disable", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "disable" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "Disables the specified blockchain application. This method can only be performed by users who are\n Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}/roleAssignments", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/roleAssignments?", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "roleAssignments" ], "query": [ { "key": "applicationRoleId", "value": "{{applicationRoleId}}", "disabled": true }, { "key": "top", "value": "{{top}}", "disabled": true }, { "key": "skip", "value": "{{skip}}", "disabled": true }, { "key": "sortBy", "value": "{{sortBy}}", "disabled": true } ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "List all role assignments of the specified blockchain application. Users who are Workbench administrators\n get all role assignments. Non-Workbench administrators get all their role assignments. Roles are specified\n in the Workbench application configuration and can be retrieved from GET /applications/{applicationID}.\n Also, user information can be retrieved from GET /users/{userID}." }, "response": [] }, { "name": "api/v1/applications/{appID}/roleAssignments", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json-patch+json" } ], "body": { "mode": "raw", "raw": "{\n \"userId\": 0,\n \"applicationRoleId\": 0\n}" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/roleAssignments", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "roleAssignments" ], "variable": [ { "key": "applicationId", "value": "" } ] }, "description": "Creates a user-to-role mapping in the specified blockchain application. This method can only be performed by\n users who are Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}/roleAssignments/{roleID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/roleAssignments/:roleAssignmentId", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "roleAssignments", ":roleAssignmentId" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" }, { "key": "roleAssignmentId", "value": "{{roleAssignmentId}}" } ] }, "description": "Get a role assignment of the specified blockchain application matching a specific user role assignment ID.\n Users who are Workbench administrators get the role assignment. Non-Workbench administrators get the role assignment\n if they are associated in the application." }, "response": [] }, { "name": "api/v1/applications/{appID}/roleAssignments{roleID}", "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json-patch+json" } ], "body": { "mode": "raw", "raw": "New user-to-role mapping parameters" }, "url": { "raw": "http:///api/v1/applications/:applicationId/roleAssignments/:roleAssignmentId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", ":applicationId", "roleAssignments", ":roleAssignmentId" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" }, { "key": "roleAssignmentId", "value": "{{roleAssignmentId}}" } ] }, "description": "Updates the specified role assignment. This method can only be performed by users who are Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}/roleAssignments{roleID}", "request": { "method": "DELETE", "header": [], "body": {}, "url": { "raw": "http:///api/v1/applications/:applicationId/roleAssignments/:roleAssignmentId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", ":applicationId", "roleAssignments", ":roleAssignmentId" ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" }, { "key": "roleAssignmentId", "value": "{{roleAssignmentId}}" } ] }, "description": "Deletes the specified role assignment. This method can only be performed by users who are\n Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{appID}/workflows", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{baseURL}}/api/v1/applications/:applicationId/workflows?top={{top}}&skip={{skip}}", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "applications", ":applicationId", "workflows" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "List all workflows of the specified blockchain application. Users who are Workbench administrators get all\n workflows. Non-Workbench administrators get all workflows for which they have at least one associated application role\n or are associated with a smart contract instance role." }, "response": [] }, { "name": "api/v1/applications/{appID}/workflows/{workflowID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/applications/workflows/:workflowId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", "workflows", ":workflowId" ], "variable": [ { "key": "workflowId", "value": "{{workflowId}}" } ] }, "description": "Get a workflow matching a specific workflow ID.\n Users who are Workbench administrators get the workflow. Non-Workbench administrators get the workflow if they\n have at least one associated application role or is associated with a smart contract instance role." }, "response": [] }, { "name": "api/v1/applications/{appID}/contractCode", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/applications/:applicationId/contractCode?ledgerId={{ledgerId}}&top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", ":applicationId", "contractCode" ], "query": [ { "key": "ledgerId", "value": "{{ledgerId}}" }, { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "List all blockchain smart contract implementations of the specified blockchain application.\n Users who are Workbench administrators get all smart contract implementations. Non-Workbench administrators get all\n smart contract implementations for which they have at least one associated application role or is associated with a\n smart contract instance role." }, "response": [] }, { "name": "api/v1/applications/{appID}/contractCode", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data" } ], "body": { "mode": "formdata", "formdata": [ { "key": "contractFile", "value": "{{contractFile}}", "type": "text" } ] }, "url": { "raw": "http:///api/v1/applications/:applicationId/contractCode?ledgerId={{ledgerId}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", ":applicationId", "contractCode" ], "query": [ { "key": "ledgerId", "value": "{{ledgerId}}" } ], "variable": [ { "key": "applicationId", "value": "{{applicationId}}" } ] }, "description": "Uploads one or more smart contracts (ex. .sol or .zip), representing the implementation of the specified blockchain\n application. This method can only be performed by users who are Workbench administrators." }, "response": [] }, { "name": "api/v1/applications/{contractCodeID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/applications/contractCode/:contractCodeId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", "contractCode", ":contractCodeId" ], "variable": [ { "key": "contractCodeId", "value": "{{contractCodeId}}" } ] }, "description": "Get the blockchain smart contract implementation matching a specific\n contract code id. Users who are Workbench administrators get the specified smart contract implementation.\n Non-Workbench administrators get the smart contract implementation if they have at least one associated application\n role or is associated with a smart contract instance role." }, "response": [] }, { "name": "api/v1/applications/{contractCodeID}", "request": { "method": "DELETE", "header": [], "body": {}, "url": { "raw": "http:///api/v1/applications/contractCode/:contractCodeId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "applications", "contractCode", ":contractCodeId" ], "variable": [ { "key": "contractCodeId", "value": "{{contractCodeId}}" } ] }, "description": "Deletes the specified blockchain smart contract implementation of a specific blockchain application.\n This method can only be performed by users who are Workbench administrators.\n NOTE: not currently implemented" }, "response": [] } ], "description": "Folder for api", "event": [ { "listen": "prerequest", "script": { "id": "d6183460-375e-457f-aab2-cd18b1fdbbe0", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "8a865743-970c-4b3b-a3a2-f0441613f1c0", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Capabilities", "item": [ { "name": "api/v1/capabilities", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/capabilities", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "capabilities" ] }, "description": "List all capabilities the user can perform within Workbench.\n Checked capabilities include ability to add blockchain applications, add smart contract implementations,\n add or edit user role assignments, and add new users." }, "response": [] }, { "name": "api/v1/capabilities/canCreateContract/{workflowID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/capabilities/canCreateContract/:workflowId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "capabilities", "canCreateContract", ":workflowId" ], "variable": [ { "key": "workflowId", "value": "{{workflowId}}" } ] }, "description": "Checks if user has capability to create new smart contract instance for a specific workflow ID." }, "response": [] } ] }, { "name": "Checkers", "item": [ { "name": "api/v1/checkers/checkApplication", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data" } ], "body": { "mode": "formdata", "formdata": [ { "key": "appFile", "value": "{{appFile}}", "type": "text" } ] }, "url": { "raw": "http:///api/v1/checkers/checkApplication", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "checkers", "checkApplication" ] }, "description": "Checks if the supplied application configuration file is valid for Workbench." }, "response": [] }, { "name": "api/v1/checkers/checkContractCode", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data" } ], "body": { "mode": "formdata", "formdata": [ { "key": "contractFile", "value": "{{contractFile}}", "type": "text" }, { "key": "appFile", "value": "{{appFile}}", "type": "text" } ] }, "url": { "raw": "http:///api/v1/checkers/checkContractCode?ledgerId={{ledgerId}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "checkers", "checkContractCode" ], "query": [ { "key": "ledgerId", "value": "{{ledgerId}}" } ] }, "description": "Check if the application smart contract implementation file is valid for Workbench." }, "response": [] } ] }, { "name": "Connections", "item": [ { "name": "api/v1/ledgers/connections", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections?top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ] }, "description": "Lists the connected blockchain networks." }, "response": [] }, { "name": "api/v1/ledgers/connections/{connectionID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections/:connectionId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections", ":connectionId" ], "variable": [ { "key": "connectionId", "value": "{{connectionId}}" } ] }, "description": "Gets the connected blockchain network matching a specific connection ID." }, "response": [] }, { "name": "api/v1/ledgers/connections/{connectionID}/blocks", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections/:connectionId/blocks?top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections", ":connectionId", "blocks" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ], "variable": [ { "key": "connectionId", "value": "{{connectionId}}" } ] }, "description": "Lists the blocks for a connected blockchain network." }, "response": [] }, { "name": "api/v1/ledgers/connections/{connectionID}/blocks/{blockID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections/:connectionId/blocks/:blockId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections", ":connectionId", "blocks", ":blockId" ], "variable": [ { "key": "connectionId", "value": "{{connectionId}}" }, { "key": "blockId", "value": "{{blockId}}" } ] }, "description": "Gets the block matching a specific block ID." }, "response": [] }, { "name": "api/v1/ledgers/connections/{connectionID}/transactions", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections/:connectionId/transactions?top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections", ":connectionId", "transactions" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ], "variable": [ { "key": "connectionId", "value": "{{connectionId}}" } ] }, "description": "Lists the transactions for a connected blockchain network." }, "response": [] }, { "name": "api/v1/ledgers/connections/{connectionID}/transactions/{transactionID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers/connections/:connectionId/transactions/:transactionId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers", "connections", ":connectionId", "transactions", ":transactionId" ], "variable": [ { "key": "connectionId", "value": "{{connectionId}}" }, { "key": "transactionId", "value": "{{transactionId}}" } ] }, "description": "Gets the transaction matching a specific transaction ID." }, "response": [] } ] }, { "name": "Contracts", "item": [ { "name": "api/v1/contracts?worlfowId={workflowId}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/contracts?top={{top}}&skip={{skip}}&workflowId={{workflowId}}&sortBy={{sortBy}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "contracts" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" }, { "key": "workflowId", "value": "{{workflowId}}" }, { "key": "sortBy", "value": "{{sortBy}}" } ] }, "description": "Lists the smart contract instances of the specified workflow. Users who are Workbench administrators get all\n smart contract instances. Non-Workbench administrators get all smart contract instances for which they have at least\n one associated application role or is associated with a smart contract instance role." }, "response": [] }, { "name": "api/v1/contracts?worlfowId={workflowId}&contractCodeId={contractCodeId}&connectionId={connectionId}", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"workflowFunctionID\": 0,\n \"workflowActionParameters\": [\n {\n \"name\": \"string\",\n \"value\": \"string\",\n \"workflowFunctionParameterId\": 0\n }\n ]\n}" }, "url": { "raw": "https://{{baseURL}}/api/v1/contracts?workflowId=&contractCodeId=&connectionId=", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "contracts" ], "query": [ { "key": "workflowId", "value": "" }, { "key": "contractCodeId", "value": "" }, { "key": "connectionId", "value": "" } ] }, "description": "Creates a new smart contract instance for the specified workflow ID.\n Users are only able to create a new smart contract instance if the user is associated with an application role,\n which can initiate a smart contract instance for the workflow." }, "response": [] }, { "name": "api/v1/contracts/{contractId}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/contracts/:contractId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "contracts", ":contractId" ], "variable": [ { "key": "contractId", "value": "{{contractId}}" } ] }, "description": "Gets the smart contract instance matching a specific contract ID. Users who are Workbench\n administrators get the smart contract instance. Non-Workbench administrators get the smart contract instance\n if they have at least one associated application role or is associated with the smart contract instance." }, "response": [] }, { "name": "api/v1/contracts/{contractId}/actions", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/contracts/:contractId/actions?top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "contracts", ":contractId", "actions" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ], "variable": [ { "key": "contractId", "value": "{{contractId}}" } ] }, "description": "Lists all actions, which can be taken by the given user and current state of the specified smart contract\n instance. Users get all applicable actions if the user has an associated application role or is associated with a smart\n contract instance role for the current state of the specified smart contract instance." }, "response": [] }, { "name": "api/v1/contracts/{contractId}/actions", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"workflowFunctionID\": 0,\n \"workflowActionParameters\": [\n {\n \"name\": \"string\",\n \"value\": \"string\",\n \"workflowFunctionParameterId\": 0\n }\n ]\n}" }, "url": { "raw": "https://{{baseURL}}/api/v1/contracts/:contractId/actions", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "contracts", ":contractId", "actions" ], "variable": [ { "key": "contractId", "value": "" } ] }, "description": "Executes an action for the specified smart contract instance and action ID. Users are only able to execute\n the action given the current state of the specified smart contract instance and the user's associated application role\n or smart contract instance role." }, "response": [] }, { "name": "api/v1/contracts/{contractId}/actions/{actionId}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/contracts/:contractId/actions/:actionId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "contracts", ":contractId", "actions", ":actionId" ], "variable": [ { "key": "contractId", "value": "{{contractId}}" }, { "key": "actionId", "value": "{{actionId}}" } ] }, "description": "Gets the action matching the specified action ID. Users get the action if the user can take the action\n given the current state of the specified smart contract instance and the user's associated application role or smart\n contract instance role." }, "response": [] } ] }, { "name": "Ledgers", "item": [ { "name": "api/v1/ledgers", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/ledgers?top={{top}}&skip={{skip}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "ledgers" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" } ] }, "description": "Lists the supported blockchain types, such as Ethereum or Hyperledger Fabric." }, "response": [] } ] }, { "name": "Users", "item": [ { "name": "api/v1/users", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/users?top={{top}}&skip={{skip}}&externalId={{externalId}}&userChainIdentifier={{userChainIdentifier}}&sortBy={{sortBy}}", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "users" ], "query": [ { "key": "top", "value": "{{top}}" }, { "key": "skip", "value": "{{skip}}" }, { "key": "externalId", "value": "{{externalId}}" }, { "key": "userChainIdentifier", "value": "{{userChainIdentifier}}" }, { "key": "sortBy", "value": "{{sortBy}}" } ] }, "description": "Lists all users within the connected blockchain consortium." }, "response": [] }, { "name": "api/v1/users", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json-patch+json" } ], "body": { "mode": "raw", "raw": "{\n \"externalID\": \"string\",\n \"firstName\": \"string\",\n \"lastName\": \"string\",\n \"emailAddress\": \"string\"\n}" }, "url": { "raw": "https://{{baseURL}}/api/v1/users", "protocol": "https", "host": [ "{{baseURL}}" ], "path": [ "api", "v1", "users" ] }, "description": "Adds a user to the blockchain consortium. This method can only be performed by users who are\n Workbench administrators." }, "response": [] }, { "name": "api/v1/users/{userID}", "request": { "method": "DELETE", "header": [], "body": {}, "url": { "raw": "http:///api/v1/users/:userId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "users", ":userId" ], "variable": [ { "key": "userId", "value": "{{userId}}" } ] }, "description": "Deletes the specified user. This method can only be performed by users who are Workbench administrators.\n NOTE: Not currently implemented." }, "response": [] }, { "name": "api/v1/users/{userID}", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/users/:userId", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "users", ":userId" ], "variable": [ { "key": "userId", "value": "{{userId}}" } ] }, "description": "Gets the user matching a specific user ID." }, "response": [] }, { "name": "api/v1/users/me", "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "http:///api/v1/users/me", "host": [ "http:" ], "port": "", "path": [ "", "", "api", "v1", "users", "me" ] }, "description": "Returns the current user." }, "response": [] } ] } ], "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{currentAccessToken}}", "type": "string" } ] }, "event": [ { "listen": "prerequest", "script": { "id": "f47a10a9-eff1-437f-981b-157f8e0e046a", "type": "text/javascript", "exec": [ "const echoPostRequest = { ", " method: 'POST',", " url: 'https://login.microsoftonline.com/{YOUR_TENANT_DOMAIN_NAME}/oauth2/token',", " headers: ", " { ", " 'cache-control': 'no-cache',", " 'Content-Type': 'application/x-www-form-urlencoded' ", " },", " body: ", " {", " mode: 'urlencoded',", " urlencoded: ", " [", " {key: \"resource\", value: \"{YOUR_WORKBENCH_APP_ID}\", disabled: false},", " {key: \"client_id\", value: \"{YOUR_API_APP_ID}\", disabled: false},", " {key: \"client_secret\", value: \"{YOUR_API_APPSECRET}\", disabled :false},", " {key: \"grant_type\", value: \"client_credentials\", disabled: false}", " ]", " }", "};", "", "pm.sendRequest(echoPostRequest, function (err, res) {", " console.log(err ? err : res.json());", " if (err === null) {", " console.log('Saving the token and expiry date')", " var responseJson = res.json();", " pm.environment.set('currentAccessToken', responseJson.access_token)", " }", " });" ] } }, { "listen": "test", "script": { "id": "a7161240-8070-4563-8496-4ee59753c80c", "type": "text/javascript", "exec": [ "" ] } } ], "variable": [ { "id": "3c990a17-63c3-4f72-9c37-75b71f4fc7c1", "key": "baseURL", "value": "", "type": "string" }, { "id": "eebf2b84-45be-415f-8b22-8e26a4a35da9", "key": "currentAccessToken", "value": "", "type": "string" } ] }