Skip to content

API Reference

Table of Contents

Base URL

All API requests should be made to:

https://engagifii-billtracking.azurewebsites.net

Required Headers

Every request must include:

http
api-version: 1.0
tenant-code: YOUR_TENANT_CODE
Content-Type: application/json

Activity Logging

Track and audit user activities within the system.

Save Activity Log

POST /api/{api-version}/activity/log/save

Saves a new activity log entry for audit tracking.

Request Body

json
{
  "userId": "user123",
  "action": "VIEW_BILL",
  "entityType": "BILL",
  "entityId": "12345",
  "metadata": {
    "billNumber": "HB1234",
    "state": "CA"
  },
  "timestamp": "2025-01-28T10:30:00Z"
}

Response

json
true

Code Examples

cURL
bash
curl -X POST "https://engagifii-billtracking.azurewebsites.net/api/1.0/activity/log/save" \
  -H "api-version: 1.0" \
  -H "tenant-code: YOUR_TENANT_CODE" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user123",
    "action": "VIEW_BILL",
    "entityType": "BILL",
    "entityId": "12345",
    "timestamp": "2025-01-28T10:30:00Z"
  }'
JavaScript
javascript
const response = await fetch('https://engagifii-billtracking.azurewebsites.net/api/1.0/activity/log/save', {
  method: 'POST',
  headers: {
    'api-version': '1.0',
    'tenant-code': 'YOUR_TENANT_CODE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    userId: 'user123',
    action: 'VIEW_BILL',
    entityType: 'BILL',
    entityId: '12345',
    timestamp: new Date().toISOString()
  })
});

const result = await response.json();
Python
python
import requests
from datetime import datetime

response = requests.post(
    'https://engagifii-billtracking.azurewebsites.net/api/1.0/activity/log/save',
    headers={
        'api-version': '1.0',
        'tenant-code': 'YOUR_TENANT_CODE',
        'Content-Type': 'application/json'
    },
    json={
        'userId': 'user123',
        'action': 'VIEW_BILL',
        'entityType': 'BILL',
        'entityId': '12345',
        'timestamp': datetime.utcnow().isoformat() + 'Z'
    }
)

result = response.json()

List Activity Logs

POST /api/{api-version}/activity/log/list

Retrieves paginated activity logs with filtering options.

Request Body

json
{
  "text": "search term",
  "userId": "user123",
  "startDate": "2025-01-01",
  "endDate": "2025-01-31",
  "pageNumber": 1,
  "pageSize": 50,
  "sortBy": "timestamp",
  "isAscending": false
}

Response

json
{
  "collection": [
    {
      "id": 1,
      "userId": "user123",
      "action": "VIEW_BILL",
      "entityType": "BILL",
      "entityId": "12345",
      "timestamp": "2025-01-28T10:30:00Z",
      "metadata": {}
    }
  ],
  "pagingModel": {
    "pageNumber": 1,
    "pageSize": 50,
    "totalRecords": 100,
    "totalPages": 2
  }
}

Advocacy Management

Manage advocacy campaigns and templates.

Get Campaign Template

GET /api/{api-version}/Advocacy/getChampaignTemplate/{id}

Retrieves a specific campaign template by ID.

Parameters

  • id (path, required): Campaign template ID (integer)

Response

json
{
  "id": 1,
  "name": "Environmental Advocacy Campaign",
  "description": "Template for environmental bills",
  "targetAudience": "Legislators",
  "messageTemplate": "Dear [Legislator Name], ...",
  "createdDate": "2025-01-15T08:00:00Z",
  "modifiedDate": "2025-01-20T14:30:00Z"
}

Save Campaign Template

POST /api/{api-version}/Advocacy/saveChampaignTemplate

Creates or updates a campaign template.

Request Body

json
{
  "id": 0,
  "name": "New Campaign Template",
  "description": "Description of the campaign",
  "targetAudience": "Legislators",
  "messageTemplate": "Template message content",
  "isActive": true
}

Response

json
12345

Returns the ID of the saved template

List Campaigns

POST /api/{api-version}/Advocacy/list

Retrieves a filtered list of campaigns.

Request Body

json
{
  "text": "search term",
  "isActive": true,
  "startDate": "2025-01-01",
  "endDate": "2025-12-31",
  "pageNumber": 1,
  "pageSize": 20
}

Response

json
{
  "collection": [
    {
      "id": 1,
      "name": "Campaign Name",
      "status": "Active",
      "startDate": "2025-01-01",
      "endDate": "2025-12-31",
      "participantCount": 150
    }
  ],
  "pagingModel": {
    "pageNumber": 1,
    "pageSize": 20,
    "totalRecords": 45,
    "totalPages": 3
  }
}

Delete Campaign Template

DELETE /api/{api-version}/Advocacy/ChampaignTemplate/{id}

Deletes a campaign template.

Parameters

  • id (path, required): Campaign template ID to delete

Response

json
true

Bill Events & Calendar

Manage legislative calendars and bill event scheduling.

Get Calendar Events

POST /api/{api-version}/bill/event/calendar

Retrieves calendar events for bills based on filter criteria.

Request Body

json
{
  "startDate": "2025-01-01",
  "endDate": "2025-01-31",
  "stateIds": [1, 2, 3],
  "committeeIds": [10, 20],
  "billIds": [100, 200],
  "eventTypes": ["HEARING", "VOTE"],
  "includeArchived": false
}

Response

json
[
  {
    "id": 1,
    "billId": 100,
    "billNumber": "HB1234",
    "title": "Environmental Protection Act",
    "eventDate": "2025-01-15T14:00:00Z",
    "eventType": "HEARING",
    "location": "Room 201",
    "committee": "Environment Committee",
    "state": "California",
    "status": "Scheduled"
  }
]

Get Calendar Count

POST /api/{api-version}/bill/event/calendar/count

Returns the count of bills matching the filter criteria.

Request Body

Same as Get Calendar Events

Response

json
42

Get Calendar Lite

POST /api/{api-version}/bill/event/calendar-lite

Retrieves a simplified version of calendar events for better performance.

Request Body

json
{
  "startDate": "2025-01-01",
  "endDate": "2025-01-31",
  "stateIds": [1, 2, 3],
  "maxResults": 100
}

Response

json
[
  {
    "id": 1,
    "billNumber": "HB1234",
    "eventDate": "2025-01-15T14:00:00Z",
    "eventType": "HEARING",
    "state": "CA"
  }
]

Subscribe to Events

POST /api/{api-version}/bill/event/subscribe

Subscribe to receive notifications for specific bill events.

Request Body

json
[
  {
    "billId": 100,
    "eventTypes": ["HEARING", "VOTE"],
    "notificationMethods": ["EMAIL", "SMS"],
    "emailAddress": "user@example.com",
    "phoneNumber": "+1234567890"
  }
]

Response

Returns the created subscription configurations.

Get Subscriptions

POST /api/{api-version}/bill/event/Getsubscriptions

Retrieves all active event subscriptions for the current tenant.

Response

json
[
  {
    "id": 1,
    "billId": 100,
    "billNumber": "HB1234",
    "eventTypes": ["HEARING", "VOTE"],
    "notificationMethods": ["EMAIL"],
    "isActive": true,
    "createdDate": "2025-01-10T08:00:00Z"
  }
]

Bill Details & Tabs

Manage bill detail tab configurations.

Get Bill Detail Tabs

GET /api/{api-version}/billdetail-tabs/GetBillDetailTabs

Retrieves the configuration for bill detail tabs.

Response

json
[
  {
    "id": 1,
    "name": "Summary",
    "displayName": "Bill Summary",
    "isVisible": true,
    "isDefault": true,
    "sequence": 1,
    "permissions": ["VIEW"]
  },
  {
    "id": 2,
    "name": "History",
    "displayName": "Legislative History",
    "isVisible": true,
    "isDefault": false,
    "sequence": 2,
    "permissions": ["VIEW"]
  }
]

Save Bill Detail Tabs

POST /api/{api-version}/billdetail-tabs/SaveBillDetailTabs

Saves the configuration for bill detail tabs.

Request Body

json
[
  {
    "id": 1,
    "name": "Summary",
    "displayName": "Bill Summary",
    "isVisible": true,
    "isDefault": true,
    "sequence": 1
  }
]

Response

Returns the saved tab configuration.


Capitol Reports

Generate and manage legislative reports.

Get Legislation Days

GET /api/{api-version}/CapitolReport/get-legislationDays/{StateId}

Retrieves legislation days for a specific state.

Parameters

  • StateId (path, required): State identifier

Response

json
{
  "stateId": 1,
  "stateName": "California",
  "legislationDays": [
    {
      "id": 1,
      "date": "2025-01-15",
      "dayType": "Session",
      "description": "Regular Session Day",
      "isActive": true
    }
  ]
}

Save Legislation Days

POST /api/{api-version}/CapitolReport/save-legislationDays/{StateId}

Saves legislation days for a specific state.

Parameters

  • StateId (path, required): State identifier

Request Body

json
[
  {
    "date": "2025-01-15",
    "dayType": "Session",
    "description": "Regular Session Day",
    "isActive": true
  }
]

Response

json
true

Save Report

POST /api/{api-version}/CapitolReport/save-report/{StateId}

Saves a capitol report for a specific state.

Parameters

  • StateId (path, required): State identifier

Request Body

json
{
  "title": "Weekly Legislative Report",
  "reportDate": "2025-01-28",
  "content": "Report content HTML",
  "billIds": [100, 200, 300],
  "reportType": 1,
  "isPublished": false
}

Response

json
54321

Returns the saved report ID

Get Report HTML

GET /api/{api-version}/CapitolReport/get-html/{legislationDayId}/{billReportId}/{clientId}/{reportType}

Retrieves the HTML content of a specific report.

Parameters

  • legislationDayId (path, required): Legislation day ID
  • billReportId (path, required): Bill report ID
  • clientId (path, required): Client ID
  • reportType (path, required): Report type (1=Summary, 2=Detailed, 3=Executive)

Response

html
<html>
  <head>
    <title>Legislative Report</title>
  </head>
  <body>
    <!-- Report content -->
  </body>
</html>

Client Management

Manage client configurations and settings.

Get Client Configuration

GET /api/{api-version}/client/configuration

Retrieves client-specific configuration settings.

Response

json
{
  "clientId": "CLIENT-123",
  "clientName": "Organization Name",
  "settings": {
    "enableNotifications": true,
    "defaultState": "CA",
    "emailFrequency": "daily",
    "reportFormat": "PDF"
  },
  "permissions": [
    "VIEW_BILLS",
    "CREATE_REPORTS",
    "MANAGE_SUBSCRIPTIONS"
  ]
}

Update Client Settings

POST /api/{api-version}/client/settings

Updates client configuration settings.

Request Body

json
{
  "settings": {
    "enableNotifications": true,
    "defaultState": "CA",
    "emailFrequency": "weekly",
    "reportFormat": "HTML"
  }
}

Response

json
{
  "success": true,
  "message": "Settings updated successfully"
}

Data Synchronization

Synchronize legislative data from external sources.

Sync Bills

POST /api/{api-version}/DataSync/bills

Synchronizes bill data for specified states and sessions.

Request Body

json
{
  "stateIds": [1, 2, 3],
  "sessionIds": [10, 20],
  "fullSync": false,
  "lastSyncDate": "2025-01-20T00:00:00Z"
}

Response

json
{
  "syncId": "SYNC-123456",
  "billsProcessed": 250,
  "billsAdded": 45,
  "billsUpdated": 205,
  "errors": [],
  "duration": "00:02:45"
}

Sync Sessions

POST /api/{api-version}/DataSync/sessions

Synchronizes legislative session data.

Request Body

json
{
  "stateIds": [1, 2, 3],
  "includeHistorical": false
}

Response

json
{
  "sessionsProcessed": 15,
  "sessionsAdded": 3,
  "sessionsUpdated": 12
}

Sync Committees

POST /api/{api-version}/DataSync/committees

Synchronizes committee information.

Request Body

json
{
  "stateIds": [1, 2, 3],
  "sessionIds": [10, 20]
}

Response

json
{
  "committeesProcessed": 75,
  "committeesAdded": 10,
  "committeesUpdated": 65
}

Retrieve reference data for populating UI dropdowns and filters.

Get States

GET /api/{api-version}/dropdown/states

Retrieves list of all available states.

Response

json
[
  {
    "id": 1,
    "name": "California",
    "abbreviation": "CA",
    "isActive": true
  },
  {
    "id": 2,
    "name": "Texas",
    "abbreviation": "TX",
    "isActive": true
  }
]

Get Sessions

GET /api/{api-version}/dropdown/sessions

Retrieves list of legislative sessions.

Query Parameters

  • stateId (optional): Filter by state ID

Response

json
[
  {
    "id": 10,
    "stateId": 1,
    "name": "2025 Regular Session",
    "startDate": "2025-01-01",
    "endDate": "2025-06-30",
    "isActive": true
  }
]

Get Committees

GET /api/{api-version}/dropdown/committees

Retrieves list of committees.

Query Parameters

  • stateId (optional): Filter by state ID
  • sessionId (optional): Filter by session ID

Response

json
[
  {
    "id": 100,
    "name": "Environment Committee",
    "chamber": "House",
    "stateId": 1,
    "isActive": true
  }
]

Get Bill Types

GET /api/{api-version}/dropdown/billtypes

Retrieves list of bill types.

Response

json
[
  {
    "id": 1,
    "code": "HB",
    "name": "House Bill",
    "description": "Bill originating in the House"
  },
  {
    "id": 2,
    "code": "SB",
    "name": "Senate Bill",
    "description": "Bill originating in the Senate"
  }
]

Get Users

GET /api/{api-version}/dropdown/users

Retrieves list of users in the tenant.

Response

json
[
  {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "role": "Analyst",
    "isActive": true
  }
]

Response Codes

CodeDescription
200Success - Request completed successfully
400Bad Request - Invalid parameters or request body
401Unauthorized - Missing or invalid authentication
403Forbidden - Insufficient permissions
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server-side error
503Service Unavailable - Service temporarily unavailable

Rate Limiting

The API implements rate limiting to ensure fair usage:

  • Default Limit: 1000 requests per hour per tenant
  • Burst Limit: 100 requests per minute
  • Headers: Rate limit information is included in response headers:
    • X-RateLimit-Limit: Maximum requests allowed
    • X-RateLimit-Remaining: Remaining requests in current window
    • X-RateLimit-Reset: Unix timestamp when limit resets

Pagination

Most list endpoints support pagination using these standard parameters:

json
{
  "pageNumber": 1,
  "pageSize": 50,
  "sortBy": "fieldName",
  "isAscending": false
}

Response includes pagination metadata:

json
{
  "collection": [...],
  "pagingModel": {
    "pageNumber": 1,
    "pageSize": 50,
    "totalRecords": 500,
    "totalPages": 10
  }
}

Best Practices

  1. Use Pagination: Always paginate large result sets
  2. Cache Reference Data: Cache dropdown data that changes infrequently
  3. Handle Rate Limits: Implement exponential backoff for rate limit errors
  4. Validate Input: Validate request data before sending to avoid 400 errors
  5. Log Requests: Log all API interactions for debugging
  6. Use Filters: Use filtering to reduce response size and improve performance

For detailed schema definitions, see Data ModelsFor error handling strategies, see Error Handling