Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOIA-455: Removing references to webform submit from swagger. #1851

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1763,75 +1763,6 @@
}
}
}
},
"/webform/submit": {
"post": {
"summary": "Submit FOIA Request",
"description": "<p>You can submit FOIA Requests using the webform endpoint, but you will first need the Request Form for the Agency. Each Agency has their own rules for which fields are required. The elements object from the request_form endpoint will display the required fields for that Agency.</p>",
"consumes": ["application/json"],
"parameters": [{
"name": "id",
"in": "formData",
"type": "string",
"required": false,
"description": "The ID of the request_form you received from the request_form endpoint."
}, {
"name": "email",
"in": "formData",
"type": "string",
"required": false,
"description": "The email address of the requester."
}, {
"name": "name_first",
"in": "formData",
"type": "string",
"required": false,
"description": "First Name of requester."
}, {
"name": "name_last",
"in": "formData",
"type": "string",
"required": false,
"description": "Last Name of requester."
},
{
"name": "request_description",
"in": "formData",
"type": "string",
"required": false,
"description": "A description for your request."
},
{
"name": "request_category",
"in": "formData",
"type": "string",
"required": false,
"description": "<p>The request category is limited to specific options.</p><p>List of example suggestions:</p> <ul><li><code>media: 'Representative of the news media'</code></li><li><code>educational: 'Educational Institution'</code></li><li><code>scientific: 'Non-commercial scientific institution'</code></li><li><code>commercial: 'Commercial-use requester'</code></li><li><code>other: 'All other requester'</code></li></ul>"
},
{
"name": "phone_number",
"in": "formData",
"type": "string",
"required": false,
"description": "A description for your request."
}
],
"tags": ["Submit FOIA Request"],
"responses": {
"200": {
"description": "Successful Operation"
},
"400": {
"description": "Syntax error"
},
"403": {
"description": "Forbidden: The api_key is missing"
},
"404": {
"description": "Not Found"
}
}
}
}
},
"definitions": {
Expand Down
62 changes: 0 additions & 62 deletions www.foia.gov/developer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,68 +58,6 @@ Fetch the Office of Information Policy’s FOIA request form.
curl -g -v -H 'X-API-Key: <your-api-key>' https://api.foia.gov/api/agency_components/8216158f-8089-431d-b866-dc334e8d4758/request_form
```


### Submission

You can submit a FOIA request using our API. The endpoint for the submission API:

https://api.foia.gov/api/webform/submit

You'll need to identify the request form you are submitting to using the Agency
component API and provide any relevant data to Agency.

Get the Office of Information Policy's form id.

```
$ curl -H 'X-API-Key: <your-api-key>' https://api.foia.gov/api/agency_components/8216158f-8089-431d-b866-dc334e8d4758/request_form | jq '.data.attributes.drupal_internal__id'
"test_form"
```

Note that each agency may require different information based on their
regulations. You can see what information is being requested by looking at
their webform `elements`. Check the element’s properties to determine which
fields are required.

```
$ curl -H 'X-API-Key: <your-api-key>' https://api.foia.gov/api/agency_components/8216158f-8089-431d-b866-dc334e8d4758/request_form | jq '.data.attributes.elements | keys'
[
"address_city",
"address_country",
"address_line1",
"address_line2",
"address_state_province",
"address_zip_postal_code",
"attachments_supporting_documentation",
"company_organization",
"email",
"expedited_processing",
"expedited_processing_explanation",
"fax_number",
"fee_amount_willing",
"fee_waiver",
"fee_waiver_explanation",
"name_first",
"name_last",
"phone_number",
"request_category",
"request_description"
]
```

Submit a request to the Office of Information Policy.

```
curl -v -H 'X-Api-Key: <your-api-key>' -H 'Content-Type: application/json' https://api.foia.gov/api/webform/submit --data-binary @- <<EOF
{
"id": "test_form",
"email": "[email protected]",
"name_first": "George",
"name_last": "Washington",
"request_description": "A very specific description of records."
}
EOF
```

## The FOIA XML Schema

<p>Federal agencies publish FOIA information in accordance with guidelines prepared by the U. S. Department of Justice Office of Information Policy. These guidelines, available <a href="http://www.justice.gov/oip/foiapost/guidance-annualreport-052008.pdf" target="_blank">here</a>, describe the format and meaning of FOIA annual report information. In addition, a <em>FOIA Annual Report XML schema</em> has been developed allowing agency FOIA annual report information to be represented and exchanged in a standardized format. This XML schema closely follows the structure and terminology of the guidance document, and conforms to the NIEM standard (<a href="http://niem.gov" target="_blank">http://niem.gov</a>).&nbsp;</p>
Expand Down
Loading