Skip to content

Commit

Permalink
Merge pull request #6 from FIWARE/docu
Browse files Browse the repository at this point in the history
Extract ids from responses
  • Loading branch information
pulledtim authored Sep 27, 2023
2 parents 03e97fc + 6d378cb commit e5c1622
Showing 1 changed file with 73 additions and 3 deletions.
76 changes: 73 additions & 3 deletions examples/tmf/tmf.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
"item": [
{
"name": "Create Product Spec (by provider)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"PRODUCT_SPEC_ID\", jsonData.id)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
Expand Down Expand Up @@ -43,6 +55,18 @@
},
{
"name": "Create Product Offering (by provider)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"PRODUCT_OFFERING_ID\", jsonData.id)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
Expand All @@ -59,7 +83,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"description\": \"My Offering description\",\n \"isBundle\": false,\n \"isSellable\": true,\n \"lifecycleStatus\": \"Active\",\n \"name\": \"Packet Delivery Premium Service\",\n \"productSpecification\": {\n \"id\": \"<prodSpecID>\",\n \"name\": \"Packet Delivery Premium Service Spec\",\n }\n}"
"raw": "{\n \"description\": \"My Offering description\",\n \"isBundle\": false,\n \"isSellable\": true,\n \"lifecycleStatus\": \"Active\",\n \"name\": \"Packet Delivery Premium Service\",\n \"productSpecification\": {\n \"id\": \"{{PRODUCT_SPEC_ID}}\",\n \"name\": \"Packet Delivery Premium Service Spec\"\n }\n}"
},
"url": {
"raw": "{{tmf_url}}/tmf-api/productCatalogManagement/v4/productOffering",
Expand All @@ -78,6 +102,18 @@
},
{
"name": "Create Organization (by consumer)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"ORGANIZATION_ID\", jsonData.id)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
Expand All @@ -94,7 +130,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"HappyPets\",\n \"tradingName\": \"HappyPets\",\n \"partyCharacteristic\": [\n {\n \"name\": \"did\",\n \"valueType\": \"string\",\n \"value\": \"did:web:happypets.dsba.fiware.dev:did\"\n }\n ]\n}"
"raw": "{\n \"name\": \"HappyPets\",\n \"tradingName\": \"HappyPets\",\n \"partyCharacteristic\": [\n {\n \"name\": \"did\",\n \"valueType\": \"string\",\n \"value\": \"{{DID}}\"\n }\n ]\n}"
},
"url": {
"raw": "{{tmf_url}}/tmf-api/party/v4/organization",
Expand Down Expand Up @@ -139,6 +175,20 @@
},
{
"name": "Create Product Order (by consumer)",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"var uuid = require('uuid')",
"",
"pm.environment.set(\"PRODUCT_ORDER_ID\", uuid.v4());",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
Expand All @@ -155,7 +205,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"productOrderItem\": [\n {\n \"id\": \"<orderId>\",\n \"action\": \"add\",\n \"productOffering\": {\n \"id\": \"<prodOfferingId>\",\n \"name\": \"Packet Delivery Premium Service\"\n }\n }\n ],\n \"relatedParty\": [\n {\n \"id\": \"<HappyPets_OrgId>\",\n \"name\": \"HappyPets\"\n }\n ]\n}"
"raw": "{\n \"productOrderItem\": [\n {\n \"id\": \"{{PRODUCT_ORDER_ID}}\", \"action\": \"add\",\n \"productOffering\": {\n \"id\": \"{{PRODUCT_OFFERING_ID}}\",\n \"name\": \"Packet Delivery Premium Service\"\n }\n }\n ],\n \"relatedParty\": [\n {\n \"id\": \"{{ORGANIZATION_ID}}\",\n \"name\": \"HappyPets\"\n }\n ]\n}"
},
"url": {
"raw": "{{tmf_url}}/tmf-api/productOrderingManagement/v4/productOrder",
Expand Down Expand Up @@ -213,6 +263,26 @@
"key": "provider_employee_token",
"value": "<my_provider_employee_token>",
"type": "string"
},
{
"key": "DID",
"value": "<my_buyer_organization_did>",
"type": "string"
},
{
"key": "ORGANIZATION_ID",
"value": "",
"type": "string"
},
{
"key": "PRODUCT_OFFERING_ID",
"value": "",
"type": "string"
},
{
"key": "PRODUCT_SPEC_ID",
"value": "",
"type": "string"
}
]
}

0 comments on commit e5c1622

Please sign in to comment.