HomeFormSpring APIMethodsform

2.2. form

This method returns detailed information about a form.

Authentication

This method requires an API key with info, data or 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)

Example Request

https://www.formspring.com/api/form?api_key=ABCDE&type=xml&id=100

Response

  • name - form name
  • views - the number of times the form has been viewed
  • submissions - the number of submissions stored for the form
  • created - the date the form was created in YYYY-MM-DD HH:MM:SS format
  • last_submission_id - the id of the latest submission
  • last_submission_time - the timestamp of the latest submission in YYYY-MM-DD HH:MM:SS format
  • url - public url for the form
  • data_url - share data url with full data access (only supplied if the API key has data access)
  • summary_url - share data url with summary access (only supplied if the API key has data access)
  • rss_url - url to the rss feed for data (only supplied if the API key has data access)
  • javascript - contents of the javascript code required to embed the form within an external page
  • html - contents of the full html code used to construct the form
  • fields - array containing one entry per field on the form
    • id - field id
    • label - field label
    • name - name of the field, used when submitting
    • type - field type (one of text, textarea, select, checkbox, radio, datetime, email or file)
    • options - list of options set for the field (if applicable)
      • label - option label
      • value - option value
    • default - default value for the field
    • required - "1" or "0" depending on whether or not the field is required
  • Example XML Response

    		 
    	<?xml version="1.0" encoding="utf-8"?>
    	<response status="ok">
    	<name>Test Form</name>
    	<views>100</views>
    	<created>2007-01-01 23:59:59</created>
    	<submissions>100</submissions>
    	<last_submission_id>9999</last_submission_id>
    	<last_submission_time>2007-02-02 23:59:59</last_submission_time>
    	<url>https://www.formspring.com/admin/data.php?11111</url>
    	<data_url>https://www.formspring.com/admin/data.php?11112</data_url>
    	<summary_url>https://www.formspring.com/admin/data.php?11113</summary_url>
    	<rss_url>https://www.formspring.com/admin/rss.php?11114</rss_url>
    	<html></html>
    	<javascript></javascript>
    	<fields>
    	<field>
    	<id>1001</id>
    	<label>First Name</label>
    	<name>first_name</name>
    	<type>text</type>
    	<options></options>
    	<default></default>
    	<required>1</required>
    	</field>
    	<field>
    	<id>1002</id>
    	<label>State</label>
    	<name>state</name>
    	<type>select</type>
    	<options>
    	<option>
    	<label>Idaho</label>
    	<value>Idaho</value>
    	</option>
    	<option>
    	<label>Illinois</label>
    	<value>Illinois</value>
    	</option>
    	<option>
    	<label>Indiana</label>
    	<value>Indiana</value>
    	</option>
    	<option>
    	<label>Iowa</label>
    	<value>Iowa</value>
    	</option>
    	</options>
    	<default>Indiana</default>
    	<required>0</required>
    	</field>
    	</fields>
    	</response>
    	

    Example JSON Response

    		 
    	{
    	"status" : "ok",
    	"response" : {
    	"name" : "Test Form",
    	"views" : "100",
    	"created" : "2007-01-01 23:59:59",
    	"submissions" : 100,
    	"last_submission_id" : "9999",
    	"last_submission_time" : "2007-02-02 23:59:59",
    	"url" : "https://www.formspring.com/admin/data.php?11111",
    	"data_url" : "https://www.formspring.com/admin/data.php?11112",
    	"summary_url" : "https://www.formspring.com/admin/data.php?11113",
    	"rss_url" : "https://www.formspring.com/admin/rss.php?11114",
    	"html" : "",
    	"javascript" : "",
    	"fields" : [ {
    	"id" : "1001",
    	"label" : "First Name",
    	"name" : "first_name",
    	"type" : "text",
    	"options" : [ ],
    	"default" : "",
    	"required" : "1"
    	}, {
    	"id" : "1002",
    	"label" : "State",
    	"name" : "state",
    	"type" : "select",
    	"options" : {
    	"1" : {
    	"label" : "Idaho",
    	"value" : "Idaho"
    	},
    	"2" : {
    	"label" : "Illinois",
    	"value" : "Illinois"
    	},
    	"3" : {
    	"label" : "Indiana",
    	"value" : "Indiana"
    	},
    	"4" : {
    	"label" : "Iowa",
    	"value" : "Iowa"
    	}
    	},
    	"default" : "Indiana",
    	"required" : "0"
    	} ]
    	}
    	}
    	

    Example PHP Response

    		 
    	a:2:{s:6:"status";s:2:"ok";s:8:"response";a:13:{s:4:"name";s:9:"Test Form";s:5:"views";s:3:"100";s:7:"created";s:19:"2007-01-01 23:59:59";s:11:"submissions";i:100;s:18:"last_submission_id";s:4:"9999";s:20:"last_submission_time";s:19:"2007-02-02 23:59:59";s:3:"url";s:47:"https://www.formspring.com/admin/data.php?11111";s:8:"data_url";s:47:"https://www.formspring.com/admin/data.php?11112";s:11:"summary_url";s:47:"https://www.formspring.com/admin/data.php?11113";s:7:"rss_url";s:46:"https://www.formspring.com/admin/rss.php?11114";s:4:"html";s:0:"";s:10:"javascript";s:0:"";s:6:"fields";a:2:{i:0;a:7:{s:2:"id";s:4:"1001";s:5:"label";s:10:"First Name";s:4:"name";s:10:"first_name";s:4:"type";s:4:"text";s:7:"options";a:0:{}s:7:"default";s:0:"";s:8:"required";s:1:"1";}i:1;a:7:{s:2:"id";s:4:"1002";s:5:"label";s:5:"State";s:4:"name";s:5:"state";s:4:"type";s:6:"select";s:7:"options";a:4:{i:1;a:2:{s:5:"label";s:5:"Idaho";s:5:"value";s:5:"Idaho";}i:2;a:2:{s:5:"label";s:8:"Illinois";s:5:"value";s:8:"Illinois";}i:3;a:2:{s:5:"label";s:7:"Indiana";s:5:"value";s:7:"Indiana";}i:4;a:2:{s:5:"label";s:4:"Iowa";s:5:"value";s:4:"Iowa";}}s:7:"default";s:7:"Indiana";s:8:"required";s:1:"0";}}}}
    	

This page was: Helpful | Not Helpful