API WalkThrough

Below is complete API flow to execute Verra VM0033 Methodology:

1. Policy Preparing from Standard Registry (SR) side:

1.1 Login by SR

To login, the user must request a refresh token:

POSThttp://localhost:4200/api/v1/accounts/login/ with credentials in body:

Successful response looks like:

With the refreshToken from the response, you can obtain an access token, which is then used in the authorization header for each request:

POST http://localhost:4200/api/v1/accounts/access-token/

Successful response looks like:

1.2 VM0033 Policy Importing

To import a policy, send a request with the policy’s messageId in the body:

POST http://localhost:4200/api/v1/policies/import/message/

with body:

Successful response looks like:

1.3 Policy Publishing

To publish a policy, use the id field from the previous step in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/publish/

with body, field policyAvailability optional:

Successful response looks like:

1.4 Assign Policy to VVB and Project Proponent (PP) Users

To assign a policy to a user, include the username in the request body, and set the policyId field to the id value from the policy importing step:

POST http://localhost:4200/api/v1/permissions/users/{username}/policies/assign/

For example:

POST http://localhost:4200/api/v1/permissions/users/ProjectProponent/policies/assign/

POST http://localhost:4200/api/v1/permissions/users/VVB/policies/assign/

with body, where in policyId using "id" field from policy importing step:

Successful response looks like:

2. Token associate and grant KYC

2.1 Login as SR

2.1.1 Associate Token for PP

Before associating, obtain the tokenId by extracting it from the token linked to the policy:

GET http://localhost:4200/api/v1/tokens

Successful response looks like:

We need to extract tokenId from token, which linked with our policy(policyId from step 1.2 equal with policyIds in response)

Send a request with the tokenId from the previous response:

PUT http://localhost:4200/api/v1/tokens/0.0.6851817/associate

Successful response looks like:

2.3 Login by PP

2.3.1 Grant KYC Token by PP

To grant a KYC token, send a request with the tokenId and the username:

PUT http://localhost:4200/api/v1/tokens/0.0.6851817/ProjectProponent/grant-kyc

Successful response looks like:

3 Register PP in policy and create project description

3.1 Login by PP

3.2 Choose PP Role in Policy and Create Project Description

To choose a role in the policy, send a request with the role name in the body:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/Choose_Roles/blocks/

with body:

Successful response looks like:

To create a project description in the policy, send a request with the project description details. (The payload example is large and will be attached separately.):

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/add_project_bnt/blocks/

Successful response looks like:

Wait for the request to finish processing:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_pp_2/blocks

Waiting while data.option.status would be equal "Waiting to be Added":

4 Register VVB

4.1 Login by VVB

4.2 Choose VVB Role

To choose a role in the policy, send a request with the role name in the body:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/Choose_Roles/blocks/

with body:

Successful response looks like:

To create a VVB in the policy, send a request with the VVB name in the body:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/create_new_vvb/blocks

with body:

Successful response looks like:

Wait until the title is equal to β€œWaiting for approval”:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/new_VVB/blocks

Waiting while blocks.uiMetaData.title would be equal "Waiting for approval":

5 Project Flow

5.1 Login by SR

5.2 Add Project

Get the project reference by saving the response data:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_verra/blocks

Change the project status from β€œWaiting to be Added” to β€œWaiting to Validate”:

Send the updated project data in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/add_project/blocks

With body:

5.3 Login by PP

5.4 Assign Project

Get the project reference by saving the response data:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_pp_2/blocks

Create and fill the field with the VVB DID:

Send the updated project data in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/assign_vvb/blocks

With body:

5.5 Login by VVB

5.6 Approve Project

Wait until the project status changes to β€œWaiting to Validate”:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_vvb/blocks

Save the response data as a reference and update the status to β€œValidated”

Send the updated payload in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/approve_project_btn/blocks

With body:

6 Report Flow

6.1 Login by PP

6.2 Create Report

Wait until the project status changes to β€œapproved_project”:

GET "http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_pp_2/blocks"

Save the response data as a reference:

Send a request with the reference:

POST "http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/add_report_bnt/blocks"

Successful response looks like:

Wait until the project status changes to β€œWaiting for Verification”:

GET "http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/report_grid_pp/blocks"

6.3 Login by PP

6.4 Assign Report

Get the report reference by saving the response data:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/report_grid_pp/blocks

Create and fill the field with the VVB DID:

Send the updated report data in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/assign_vvb_mr/blocks

With body:

6.5 Login by VVB

6.6 Approve Report

Wait until the report status changes to β€œWaiting for Verification”:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/report_grid_vvb/blocks

Save the response data as a reference and update the status to β€œVerified”:

Send the updated payload in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/approve_report_btn/blocks

With body:

Wait until the project status is β€œVerified”:

GET "http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/report_grid_vvb/blocks"

6.7 Create Validation Report

Get the reference for creating the report:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/project_grid_vvb/blocks

Save the response data as a reference and update the status to β€œVerified”:

Send the request with the updated payload. (The payload for the validation report will be attached separately.):

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/add_new_validation_report/blocks

With body:

Successful response looks like:

6.8 Login by SR

6.9 Approve Validation Report

Wait until the validation report status changes to β€œSubmitted”:

GET "http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/validation_reports_verra/blocks"

Save the response data as a reference and update the status to β€œAPPROVED”:

Send the updated payload in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/approve_validation_report_btn/blocks

With body:

6.10 Login by VVB

6.11 Create Verification Report

Get the reference for creating the report:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/report_grid_vvb/blocks

Save the response data as a reference and update the status to β€œVerified”:

Send the request with the updated payload. (The payload for the validation report will be attached separately.):

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/add_verification_report/blocks

With body:

Successful response looks like:

6.12 Login by SR

6.13 Approve Verification Report

Wait until the verification report status changes to β€œSubmitted”:

GET http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/verification_reports_verra/blocks

Save the response data as a reference and update the status to β€œAPPROVED”:

Send the updated payload in the request:

POST http://localhost:4200/api/v1/policies/68c952870fd12e530dddadf8/tag/mint_token_verra/blocks

With body:

Last updated