Introduction
FOIAXpress provides a Request Data API, which allows Request data to be retrieved for use in other applications. Users can define criteria for which requests they need information about, and receive either a count of how many requests meet the criteria or a list of the field data from the Requests meeting the customized filter criteria.
There are some restrictions on which fields can be used for filters and what field data can be retrieved. These details are provided in the following sections.
In This Document
This document is divided into the following sections:
Configuration: Enabling the API in your application.
Authentication: Establishing a session.
GetRequestCount: Details on the GetRequestCount API, which returns a count of requests based on specified conditions.
GetRequests: Using the GetRequests method, which retrieves one or more field values from FOIAXpress requests.
Configuration
To enable the API, add the following to your web.config file in the <system.webServer>
section:
NOTE: You can exclude one or more of these entries if you are not planning to use the method. For example, if only using the GetRequestCount method, only GetApiToken and GetRequestCount are required.
<location path="apiex/RequestData/GetApiToken">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/GetRequestCount">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/GetRequests">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/CreateRequest">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/GetRequestStatus">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/UploadDocuments">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="apiex/RequestData/UpdateRequest">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
Authentication
Before calling other methods, the application needs to establish a session using the ApplicationURL/apiex/requestdata/GetApiToken method. This can be any user account with the appropriate permissions, but as a best practice we recommend using a unique account created for the application accessing the API. The body of this request should be:
{
"UserName": "Example", "Password": "Example"
}
The method returns an empty string if successful, and an error if it does not create a session for the user due to invalid credentials, etc.
GetRequestCount
This API method, located at ApplicationURL/apiex/requestdata/getrequestcount, returns an integer value that represents a count of requests in FOIAXpress based on one or more āwhereā conditions. GetRequestCount accepts a JSON parameter in the following format:
{
āWhereClauseFieldsā: []
}
WhereClauseFields is an array containing WhereClauseField objects. A WhereClauseField is defined as:
{
"FieldName": "",
"Operator": "",
"Value": ""6
}
Supported Fields
The following Request fields are supported as the FieldName property:
FieldName | Description |
VisibleRequestId | Request Number (ex. 2020-FOIA-001) |
ReceivedDateFrom | Original Received Date |
ReceivedDateTo | Original Received Date |
ClosedDateFrom | Closed Date |
ClosedDateTo | Closed Date |
RequestStatus | Request Status code |
RequestTypeName | Request Type name |
ActionOffice | Action Office code |
DeliveryMode | Delivery Mode |
FeeWaiverStatus | Fee Waiver Status (see the values in the next table) |
PaymentStatus | Payment Status (see the values in the next table) |
Priority | Priority |
ReceivedMode | Received Mode (how the Request was filed) |
RequesterCategory | Requester Category |
ReviewStatus | Requestās Document Review Status |
TargetDate | Target Date |
AverageProcessingDays | Processing Days for the Request as calculated for the Annual Report |
MultiTrackType | Multi-Track Type |
RequestAge | Age of the Request as calculated for the Annual Report |
RequesterFirstName | Requesterās First Name |
RequesterMiddleName | Requesterās Middle Name |
RequesterLastName | Requesterās Last Name |
Operator Property Values
The operator property allows you to specify what requests will be counted by the method. The Operator property can use the following values:
Operator | Description |
= | The field equals the āValueā property. |
> | The field is greater than the āValueā property. |
< | The field is less than the āValueā property. |
>= | The field is greater than or equal to the āValueā property. |
<= | The field is less than or equal to the āValueā property. |
CONTAINS | The fieldās value text contains the āValueā property. |
IN | The field is equal to one of the items specified in a comma-separated list (ex. āValueā: ā1,2,3ā). |
Supported Operators By Field
Not every field supports the use of every operator. The following table shows which operators are usable for each field and includes definitions for Request Status codes:
Field | Supported Operators | Possible Values |
VisibleRequestId | =, CONTAINS | 2020-FOIA-001, FOIA |
ReceivedDateFrom | =, >, >= | A valid date in MM/DD/YYYY or UTC format. Ex: 01/13/2000, 2000-01-13 |
ReceivedDateTo | =, <, <= | See possible values for ReceivedDateFrom. |
ClosedDateFrom | =, >, >= | See possible values for ReceivedDateFrom |
ClosedDateTo | =, <, <= | See possible values for ReceivedDateFrom |
RequestStatus | =, IN | Need: On Hold-Need Info/Clarification CWithheld: On Hold-Fee Related DAdded: Documents Added DD: Documents Delivered DF: Delivery Failed DP: Delivery Pending Amended: Amended Assigned: Assigned Canceled: Canceled Closed: Closed Completed: Disposition Accepted Received: Received Screened: Perfected ReqforDocs: Request for Docs Sent RvwPending: Review Pending RvwAprvd: Review Approved RvwDisApvd: Review Disapproved DAddRvwLog: Documents Added to Review Log Other: On Hold-Other |
RequestTypeName | =, IN | Request Type name, as found in Administration > Request Management. Ex: āFOIAā, āFOIA,APPā |
ActionOffice | =, IN | Office codes, as found in Administration > Organization Setup. Ex: āHQā, āHQ,DCā |
DeliveryMode | = | Delivery Modes, as found in Administration > Lookups |
FeeWaiverStatus | = | Withdrawn, TBD, Granted, Not Billable, N/A, Denied |
PaymentStatus | = | Fee Waived, Paid, Pending, No Charges |
Priority | = | Priority Codes, as defined in Administration > Lookups |
ReceivedMode | = | Received Modes, as defined in Administration > Lookups |
RequesterCategory | = | Priority Codes, as defined in Administration > Request Management |
ReviewStatus | = | ReviewStatuses, as defined in Administration > Lookups |
TargetDate | = | A valid date in MM/DD/YYYY or UTC format. Ex: 01/13/2000, 2000-01-13 |
AverageProcessingDays | =, >, >=, <, <= | An integer greater than or equal to 0 |
MultiTrackType | = | None, Simple, Complex, Expedite |
RequestAge | =, >, >=, <, <= | An integer greater than or equal to 0 |
Example JSON Object
Here is an example of a JSON object that could be used with this API method:
{
"WhereClauseFields": [
{"FieldName": "RequestTypeName", "Operator": "=", "Value": "FOIA"},
{"FieldName": "ReceivedDateFrom", "Operator": ">=", "Value": "01/01/2020"},
{"FieldName": "RequestStatus", "Operator": "=", "Value": "Closed"}
]
}
Here is an example of this input tested in Postmanā¢:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
By passing an empty array, the user can get a count of every request in the application:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
The following example shows the āINā operator in use:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
The following example shows the āCONTAINSā operator in use:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
GetRequests
GetRequests is located at ApplicationURL/apiex/requestdata/getrequests, and allows users to get one or more field values from requests in FOIAXpress. This API method accepts a JSON object in the following format:
{
"StartRow": "",
"EndRow": "",
"SortBy": "",
"Columns": [""],
"WhereClauseFieldsā: []
}
Definitions
The elements in the GetRequest method are described in the following table:
Element | Description |
āStartRowā/āEndRowā | āStartRowā and āEndRowā represent the range of records where values will be selected. Note that the āStartRowā and āEndRowā are limited to 1000 records for performance reasons. |
āSortByā | āSortByā allows you to specify how the results are ordered. This field can be left blank ("") if no sorting is needed. The available sort columns are limited to:
|
āColumnsā | āColumnsā is a list of the data fields the user wants to retrieve. The following values are allowed as āColumnsā:
|
āWhereClauseFieldsā | āWhereClauseFieldsā is a list of WhereClauseField objects, as described in the GetRequestCount section of this document. These behave identically to WhereClauseField objects defined in that section and allow you to filter only data from requests that meet the criteria. |
Examples
The following is an example of a GetRequest method:
{
"StartRow": 1,
"EndRow": 1000,
"SortBy": "VisibleRequestId",
"Columns": ["VisibleRequestId", "RequestStatus"], "WhereClauseFields": [
{"FieldName": "RequestTypeName", "Operator": "=", "Value": "FOIA"}
]
}
An example of a response to this request might look like:
[
{
"VisibleRequestId": "20-FOI-00012", "RequestStatus": "Closed"
},
{
"VisibleRequestId": "20-FOI-00013",
"RequestStatus": "Closed"
},
ā¦
]
Here is an example of what this input might look like when tested in Postmanā¢:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
Similar to GetRequestCount, passing an empty WhereClauseField array returns all the requests (up to the EndRow specified):
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)
Hereās an example where āSortByā is not applied:
.jpg?sv=2022-11-02&spr=https&st=2026-03-10T08%3A20%3A58Z&se=2026-03-10T08%3A35%3A58Z&sr=c&sp=r&sig=q204D4encQCfJ%2BiSKPrBsw5Hm8wQTQz2OBS9nFosbLg%3D)