{
  "info": {
    "_postman_id": "9ec36a7c-31d8-4db5-b9e8-59bd59a2815b",
    "name": "N3C API",
    "description": "Postman collection for the public N3C developer documentation. Run Login first to store the access token automatically.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{access_token}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "pm.request.headers.upsert({ key: 'Accept', value: 'application/json' });"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://n3c-api.cidb.gov.my",
      "type": "string"
    },
    {
      "key": "email",
      "value": "youremail@email.com",
      "type": "string"
    },
    {
      "key": "password",
      "value": "mypassword123",
      "type": "string"
    },
    {
      "key": "access_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "state_code",
      "value": "KL",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Login",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Login succeeded', function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "const response = pm.response.json();",
                  "if (response.access_token) {",
                  "  pm.collectionVariables.set('access_token', response.access_token);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/login",
            "description": "Authenticates a user and saves access_token as a collection variable."
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [],
            "url": "{{base_url}}/logout"
          }
        }
      ]
    },
    {
      "name": "Malaysia States",
      "item": [
        {
          "name": "Get All States",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/states"
          }
        },
        {
          "name": "Get Specific State",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/states/{{state_code}}"
          }
        }
      ]
    },
    {
      "name": "Labour Wage Rate",
      "item": [
        {
          "name": "Get All Labour Groups",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/labour/group"
          }
        },
        {
          "name": "Get All Labour Categories",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/labour/category"
          }
        },
        {
          "name": "Get All Labour Specifications",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/labour/specification"
          }
        },
        {
          "name": "Filter Selected Labour Specifications",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"labours\": [\n    {\n      \"labour_group\": \"Construction Workers\",\n      \"labour_category\": \"General Construction Worker - Building (helper)\",\n      \"selectedSpecs\": [\n        {\n          \"id\": 23,\n          \"labour_category_id\": 11,\n          \"category\": \"General Construction Worker - Building (helper)\",\n          \"specification\": \"General Construction Worker - Building, Local (Helper)\",\n          \"code\": \"10131\"\n        },\n        {\n          \"id\": 24,\n          \"labour_category_id\": 11,\n          \"category\": \"General Construction Worker - Building (helper)\",\n          \"specification\": \"General Construction Worker - Building, Foreign (Helper)\",\n          \"code\": \"10132\"\n        }\n      ]\n    }\n  ],\n  \"selectedStates\": [\n    { \"id\": 15, \"name\": \"Terengganu\", \"code\": \"TRG\" },\n    { \"id\": 13, \"name\": \"Selangor\", \"code\": \"SGR\" }\n  ],\n  \"option\": \"one\",\n  \"interval\": \"Three\",\n  \"between_duration\": {\n    \"from\": { \"month\": \"January\", \"year\": 2022 },\n    \"to\": { \"month\": \"January\", \"year\": 2025 }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/labour-wage-rate",
            "description": "Returns selected labour specifications for the chosen states and continuous month range."
          }
        },
        {
          "name": "Get All Labour Rates for a Year",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"selectedStates\": [\n    {\n      \"id\": 15,\n      \"name\": \"Terengganu\",\n      \"code\": \"TRG\",\n      \"region_code\": \"F\",\n      \"region\": \"Peninsular Malaysia\",\n      \"region_id\": 1\n    }\n  ],\n  \"option\": \"two\",\n  \"interval\": \"Four\",\n  \"only_year\": { \"year\": 2025 }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/labour-wage-rate"
          }
        }
      ]
    },
    {
      "name": "Building Material Price",
      "item": [
        {
          "name": "Get All Material Groups",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/material/group"
          }
        },
        {
          "name": "Get All Material Specifications",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/material/specification"
          }
        },
        {
          "name": "Filter Selected Material Specifications",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"materials\": [\n    {\n      \"material_group\": \"Cement\",\n      \"selectedSpecs\": [\n        {\n          \"id\": 188,\n          \"material_group_id\": 1,\n          \"specification\": \"Hume Panda / Tasek Buaya, 50kg/bag\",\n          \"group\": \"Cement\",\n          \"unit\": \"Bag\",\n          \"pay_terms\": \"60 Del\"\n        },\n        {\n          \"id\": 103,\n          \"material_group_id\": 1,\n          \"specification\": \"Lafarge Walcrete, 50kg/bag\",\n          \"group\": \"Cement\",\n          \"unit\": \"Bag\",\n          \"pay_terms\": \"60 Del\"\n        }\n      ]\n    },\n    {\n      \"material_group\": \"Aggregate\",\n      \"selectedSpecs\": [\n        {\n          \"id\": 211,\n          \"material_group_id\": 2,\n          \"specification\": \"Crusher run\",\n          \"group\": \"Aggregate\",\n          \"unit\": \"MT\",\n          \"pay_terms\": \"60 Del\"\n        }\n      ]\n    }\n  ],\n  \"selectedStates\": [\n    { \"id\": 13, \"name\": \"Selangor\", \"code\": \"SGR\" },\n    { \"id\": 18, \"name\": \"Sarawak - Sibu\", \"code\": \"SWK_SBU\" }\n  ],\n  \"option\": \"one\",\n  \"interval\": \"Three\",\n  \"between_duration\": {\n    \"from\": { \"month\": \"November\", \"year\": 2024 },\n    \"to\": { \"month\": \"November\", \"year\": 2025 }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/building-material-price",
            "description": "Returns selected material specifications for the chosen states and continuous month range."
          }
        },
        {
          "name": "Get All Material Prices for a Year",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"selectedStates\": [\n    {\n      \"id\": 13,\n      \"name\": \"Selangor\",\n      \"code\": \"SGR\",\n      \"region_code\": \"C\",\n      \"region\": \"Peninsular Malaysia\",\n      \"region_id\": 1\n    }\n  ],\n  \"option\": \"two\",\n  \"interval\": \"Four\",\n  \"only_year\": { \"year\": 2025 }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/building-material-price"
          }
        }
      ]
    },
    {
      "name": "Machinery Hire Rate & Equipment Purchase Price",
      "item": [
        {
          "name": "Get All Machinery and Equipment Groups",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/machinery/group"
          }
        },
        {
          "name": "Get All Machinery and Equipment Categories",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/machinery/category"
          }
        },
        {
          "name": "Get Specifications with Rates",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/internal/data/machinery/specification-only-with-rate"
          }
        },
        {
          "name": "Filter Selected Machinery and Equipment",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machinery\": [\n    {\n      \"machinery_group\": \"Machinery Hire Rate\",\n      \"machinery_category\": \"Excavator\",\n      \"selectedSpecs\": [\n        {\n          \"id\": 268,\n          \"group\": \"Machinery Hire Rate\",\n          \"category\": \"Excavator\",\n          \"machinery_category_id\": 9,\n          \"specification\": \"Operating Weight 30000kg\",\n          \"brand\": \"Caterpillar\",\n          \"model\": \"336D2L\",\n          \"type_machine\": \"Hydraulic Excavator\",\n          \"capacity\": \"-\",\n          \"weight\": \"-\",\n          \"bmeci\": 1\n        },\n        {\n          \"id\": 269,\n          \"group\": \"Machinery Hire Rate\",\n          \"category\": \"Excavator\",\n          \"machinery_category_id\": 9,\n          \"specification\": \"Operating Weight 40000kg\",\n          \"brand\": \"Caterpillar\",\n          \"model\": \"336DL\",\n          \"type_machine\": \"Hydraulic Excavator\",\n          \"capacity\": \"-\",\n          \"weight\": \"-\",\n          \"bmeci\": 1\n        }\n      ]\n    },\n    {\n      \"machinery_group\": \"Equipment Purchase Price\",\n      \"machinery_category\": \"Concrete Works & Plastering\",\n      \"selectedSpecs\": [\n        {\n          \"id\": 503,\n          \"group\": \"Equipment Purchase Price\",\n          \"category\": \"Concrete Works & Plastering\",\n          \"machinery_category_id\": 18,\n          \"specification\": \"Diesel Engine\",\n          \"brand\": \"Imuzi\",\n          \"model\": \"IM3TM\",\n          \"type_machine\": \"Concrete Mixer\",\n          \"capacity\": \"Unmixed-3.5 Cubic Feet; Mixed-2.5 Cubic Feet\",\n          \"weight\": \"-\",\n          \"bmeci\": 4\n        }\n      ]\n    }\n  ],\n  \"selectedStates\": [\n    {\n      \"id\": 4,\n      \"name\": \"WP Kuala Lumpur\",\n      \"code\": \"KL\",\n      \"region_code\": \"C\",\n      \"region\": \"Peninsular Malaysia\",\n      \"region_id\": 1\n    }\n  ],\n  \"option\": \"one\",\n  \"interval\": \"Three\",\n  \"between_duration\": {\n    \"from\": { \"month\": \"January\", \"year\": 2024 },\n    \"to\": { \"month\": \"January\", \"year\": 2025 }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/machinery-hire-rate-and-equipment-purchase-price",
            "description": "Returns selected machinery and equipment specifications for the chosen state and continuous month range."
          }
        },
        {
          "name": "Get All Machinery and Equipment for a Year",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"selectedStates\": [\n    {\n      \"id\": 4,\n      \"name\": \"WP Kuala Lumpur\",\n      \"code\": \"KL\",\n      \"region_code\": \"C\",\n      \"region\": \"Peninsular Malaysia\",\n      \"region_id\": 1\n    }\n  ],\n  \"option\": \"two\",\n  \"interval\": \"Four\",\n  \"only_year\": { \"year\": 2025 }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/internal/products/machinery-hire-rate-and-equipment-purchase-price"
          }
        }
      ]
    }
  ]
}
