{
  "info": {
    "name": "Bill Tracking API",
    "description": "Comprehensive Postman collection for Bill Tracking API with all endpoints, authentication, and examples",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "api-version",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_version}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Set required headers for all requests",
          "pm.request.headers.add({",
          "    key: 'api-version',",
          "    value: pm.environment.get('api_version')",
          "});",
          "",
          "pm.request.headers.add({",
          "    key: 'tenant-code',",
          "    value: pm.environment.get('tenant_code')",
          "});",
          "",
          "pm.request.headers.add({",
          "    key: 'Content-Type',",
          "    value: 'application/json'",
          "});"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Common test scripts",
          "pm.test('Status code is 200', function () {",
          "    pm.response.to.have.status(200);",
          "});",
          "",
          "pm.test('Response time is less than 2000ms', function () {",
          "    pm.expect(pm.response.responseTime).to.be.below(2000);",
          "});",
          "",
          "pm.test('Content-Type is application/json', function () {",
          "    pm.response.to.have.header('Content-Type', 'application/json');",
          "});"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://engagifii-billtracking.azurewebsites.net",
      "type": "string"
    },
    {
      "key": "api_version",
      "value": "1.0",
      "type": "string"
    },
    {
      "key": "tenant_code",
      "value": "YOUR_TENANT_CODE",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Activity Logging",
      "item": [
        {
          "name": "Save Activity Log",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user123\",\n  \"action\": \"VIEW_BILL\",\n  \"entityType\": \"BILL\",\n  \"entityId\": \"12345\",\n  \"metadata\": {\n    \"billNumber\": \"HB1234\",\n    \"state\": \"CA\"\n  },\n  \"timestamp\": \"{{$isoTimestamp}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/activity/log/save",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "activity", "log", "save"]
            },
            "description": "Saves a new activity log entry for audit tracking"
          }
        },
        {
          "name": "List Activity Logs",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"\",\n  \"userId\": \"\",\n  \"startDate\": \"2025-01-01\",\n  \"endDate\": \"2025-01-31\",\n  \"pageNumber\": 1,\n  \"pageSize\": 50,\n  \"sortBy\": \"timestamp\",\n  \"isAscending\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/activity/log/list",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "activity", "log", "list"]
            },
            "description": "Retrieves paginated activity logs with filtering options"
          }
        }
      ]
    },
    {
      "name": "Advocacy",
      "item": [
        {
          "name": "Get Campaign Template",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/Advocacy/getChampaignTemplate/1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "Advocacy", "getChampaignTemplate", "1"]
            },
            "description": "Retrieves a specific campaign template by ID"
          }
        },
        {
          "name": "Save Campaign Template",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": 0,\n  \"name\": \"Environmental Campaign\",\n  \"description\": \"Template for environmental advocacy\",\n  \"targetAudience\": \"Legislators\",\n  \"messageTemplate\": \"Dear [Name], We urge you to support...\",\n  \"isActive\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/Advocacy/saveChampaignTemplate",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "Advocacy", "saveChampaignTemplate"]
            },
            "description": "Creates or updates a campaign template"
          }
        },
        {
          "name": "List Campaigns",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"\",\n  \"isActive\": true,\n  \"startDate\": \"2025-01-01\",\n  \"endDate\": \"2025-12-31\",\n  \"pageNumber\": 1,\n  \"pageSize\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/Advocacy/list",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "Advocacy", "list"]
            },
            "description": "Retrieves a filtered list of campaigns"
          }
        },
        {
          "name": "Delete Campaign Template",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/Advocacy/ChampaignTemplate/1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "Advocacy", "ChampaignTemplate", "1"]
            },
            "description": "Deletes a campaign template by ID"
          }
        }
      ]
    },
    {
      "name": "Bill Events",
      "item": [
        {
          "name": "Get Calendar Events",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDate\": \"2025-01-01\",\n  \"endDate\": \"2025-01-31\",\n  \"stateIds\": [1, 2, 3],\n  \"committeeIds\": [],\n  \"billIds\": [],\n  \"eventTypes\": [\"HEARING\", \"VOTE\"],\n  \"includeArchived\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/bill/event/calendar",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "bill", "event", "calendar"]
            },
            "description": "Retrieves calendar events for bills based on filter criteria"
          }
        },
        {
          "name": "Get Calendar Count",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDate\": \"2025-01-01\",\n  \"endDate\": \"2025-01-31\",\n  \"stateIds\": [1, 2, 3]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/bill/event/calendar/count",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "bill", "event", "calendar", "count"]
            },
            "description": "Returns the count of bills matching the filter criteria"
          }
        },
        {
          "name": "Subscribe to Events",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"billId\": 100,\n    \"eventTypes\": [\"HEARING\", \"VOTE\"],\n    \"notificationMethods\": [\"EMAIL\"],\n    \"emailAddress\": \"user@example.com\"\n  }\n]",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/bill/event/subscribe",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "bill", "event", "subscribe"]
            },
            "description": "Subscribe to receive notifications for specific bill events"
          }
        },
        {
          "name": "Get Subscriptions",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/bill/event/Getsubscriptions",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "bill", "event", "Getsubscriptions"]
            },
            "description": "Retrieves all active event subscriptions for the current tenant"
          }
        }
      ]
    },
    {
      "name": "Capitol Reports",
      "item": [
        {
          "name": "Get Legislation Days",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/CapitolReport/get-legislationDays/1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "CapitolReport", "get-legislationDays", "1"]
            },
            "description": "Retrieves legislation days for a specific state"
          }
        },
        {
          "name": "Save Legislation Days",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"date\": \"2025-01-15\",\n    \"dayType\": \"Session\",\n    \"description\": \"Regular Session Day\",\n    \"isActive\": true\n  }\n]",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/CapitolReport/save-legislationDays/1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "CapitolReport", "save-legislationDays", "1"]
            },
            "description": "Saves legislation days for a specific state"
          }
        },
        {
          "name": "Save Report",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Weekly Legislative Report\",\n  \"reportDate\": \"2025-01-28\",\n  \"content\": \"<html>Report content</html>\",\n  \"billIds\": [100, 200, 300],\n  \"reportType\": 1,\n  \"isPublished\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/CapitolReport/save-report/1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "CapitolReport", "save-report", "1"]
            },
            "description": "Saves a capitol report for a specific state"
          }
        }
      ]
    },
    {
      "name": "Dropdown Data",
      "item": [
        {
          "name": "Get States",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/dropdown/states",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "dropdown", "states"]
            },
            "description": "Retrieves list of all available states"
          }
        },
        {
          "name": "Get Sessions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/dropdown/sessions?stateId=1",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "dropdown", "sessions"],
              "query": [
                {
                  "key": "stateId",
                  "value": "1",
                  "description": "Filter by state ID (optional)"
                }
              ]
            },
            "description": "Retrieves list of legislative sessions"
          }
        },
        {
          "name": "Get Committees",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/dropdown/committees?stateId=1&sessionId=10",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "dropdown", "committees"],
              "query": [
                {
                  "key": "stateId",
                  "value": "1",
                  "description": "Filter by state ID (optional)"
                },
                {
                  "key": "sessionId",
                  "value": "10",
                  "description": "Filter by session ID (optional)"
                }
              ]
            },
            "description": "Retrieves list of committees"
          }
        },
        {
          "name": "Get Bill Types",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/dropdown/billtypes",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "dropdown", "billtypes"]
            },
            "description": "Retrieves list of bill types"
          }
        },
        {
          "name": "Get Users",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/{{api_version}}/dropdown/users",
              "host": ["{{base_url}}"],
              "path": ["api", "{{api_version}}", "dropdown", "users"]
            },
            "description": "Retrieves list of users in the tenant"
          }
        }
      ]
    },
    {
      "name": "Health Check",
      "item": [
        {
          "name": "API Health",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/health",
              "host": ["{{base_url}}"],
              "path": ["health"]
            },
            "description": "Check API health status"
          }
        }
      ]
    }
  ]
}