HomeFormSpring APIMethodssubmit

2.5. submit

This method submits data to a form. This method does not honor any validation or default values configured for a field. It also does not trigger any auto-responders or email notifications. It is designed to be useful to import data into the database, because of the lack of validation checks, it is not intended for day-to-day use for public submissions.

The form must be configured to store submissions in the database. An error will be returned if the maximum number of submissions for the account has been reached.

Authentication

This method requires an API key with write permissions for the form. If the API key does not have permissions to access the form, a 404 (not found) will be returned.

Arguments

  • api_key (required)
  • id - form id (required)
  • timestamp - the time that should be recorded for the submission. YYYY-MM-DD HH:MM:SS format is expected. defaults to the current time. (optional)
  • user_agent - browser user agent value that should be recorded for the submission. defaults to value in the request User-Agent header, or blank if none is found. (optional)
  • remote_addr - IP address that should be recorded for the submission. defaults to the IP address from the API request. (optional)
  • field_x - value that should be stored for a specific field on the form. x must contain the id of the field whose value should be set. (optional)

Example Request

https://www.formspring.com/api/submit?api_key=ABCDE&id=111&field_1001=john&field_1002=smith

Response

  • id - the id of the new submission, unique to each entry

Example XML Response

<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
<id>10001</id>
</response>

Example JSON Response

{
"status" : "ok",
"response" : {
"id" : 10001
}
}

Example PHP Response

a:2:{s:6:"status";s:2:"ok";s:8:"response";a:1:{s:2:"id";i:10001;}}

File Uploads

Files can be uploaded via the API in a similar way text values are passed, except that file contents must be base64 encoded before transfer. You can also optionally specify the file name to use by pre-pending it to the data along with a semicolon. e.g.:

https://www.formspring.com/api/submit?api_key=ABCDE&id=111&field_1001=hello.txt;SGVsbG8hIFRoYW5rcyBmb3IgdXNpbmcgdGhlIEZvcm1TcHJpbmcgQVBJLg==

This page was: Helpful | Not Helpful