Skip to content

Commit

Permalink
feat: finalize carrying over variables to the next request
Browse files Browse the repository at this point in the history
  • Loading branch information
nikschul committed Oct 1, 2024
1 parent d21bf71 commit 6357dc3
Showing 1 changed file with 71 additions and 5 deletions.
76 changes: 71 additions & 5 deletions deployment/postman/MVD.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@
"script": {
"exec": [
"// get the contact agreement id and save it as an environment variable",
"const contractAgreementId = pm.response.json()[0][\"contractAgreementId\"];",
"pm.environment.set(\"CONTRACT_AGREEMENT_ID\", contractAgreementId);",
"if(pm.response.code==200){",
" //using the first contract agreement id found",
" const contractAgreementId = pm.response.json()[0][\"contractAgreementId\"];",
" pm.environment.set(\"CONTRACT_AGREEMENT_ID\", contractAgreementId);",
"}",
"",
""
],
Expand Down Expand Up @@ -617,6 +620,25 @@
},
{
"name": "Get cached EDRs",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// get the transfer process id of \"asset-1\" and save it as an environment variable",
"if(pm.response.code==200){",
" //using the first transfer process id found",
" const transferProcessId = pm.response.json()[0][\"transferProcessId\"];",
" pm.environment.set(\"TRANSFER_PROCESS_ID\", transferProcessId);",
"}",
"",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
Expand All @@ -642,11 +664,41 @@
},
{
"name": "Get EDR DataAddress for TransferId",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"if(!pm.environment.has(\"TRANSFER_PROCESS_ID\")){",
" throw new Error('Transfer Process ID is not yet available, please execute request \"Get Transfer Processes\" first!');",
"}"
]
}
},
{
"listen": "test",
"script": {
"exec": [
"// get the authorization token and save it as an environment variable",
"if(pm.response.code==200){",
" //using the first authorization token found",
" const authorization = pm.response.json()[\"authorization\"];",
" pm.environment.set(\"AUTHORIZATION\", authorization);",
"}",
"",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{HOST}}/api/management/v3/edrs/713dfab7-c70a-4c7b-9756-d372647276b5/dataaddress",
"raw": "{{HOST}}/api/management/v3/edrs/{{TRANSFER_PROCESS_ID}}/dataaddress",
"host": [
"{{HOST}}"
],
Expand All @@ -655,7 +707,7 @@
"management",
"v3",
"edrs",
"713dfab7-c70a-4c7b-9756-d372647276b5",
"{{TRANSFER_PROCESS_ID}}",
"dataaddress"
]
}
Expand All @@ -664,6 +716,20 @@
},
{
"name": "Download Data from Public API",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"if(!pm.environment.has(\"AUTHORIZATION\")){",
" throw new Error(' The authorization token is not yet available, please execute request \"Get EDR DataAddress for TransferId\" first!');",
"}"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "noauth"
Expand All @@ -672,7 +738,7 @@
"header": [
{
"key": "Authorization",
"value": "eyJraWQiOiJkaWQ6d2ViOmxvY2FsaG9zdCUzQTcwOTMja2V5LTEiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJkaWQ6d2ViOmxvY2FsaG9zdCUzQTcwOTMiLCJhdWQiOiJkaWQ6d2ViOmxvY2FsaG9zdCUzQTcwODMiLCJzdWIiOiJkaWQ6d2ViOmxvY2FsaG9zdCUzQTcwOTMiLCJpYXQiOjE3MjEzOTMxNjU5ODgsImp0aSI6ImFmOWI2YWIyLTMwNjYtNDNlNi1hNjg1LWIyMDVjNTFkZmJhMyJ9.ute0sLuMgc0bzG_ZUGG9G3pliFfANf9pWDxReiRrWjGudgUa4YmR9ftB5LeZTOvKCBJshRpbZX-hnQxR8fXMWA",
"value": "{{AUTHORIZATION}}",
"type": "text"
}
],
Expand Down

0 comments on commit 6357dc3

Please sign in to comment.