#Get a form

Description
Method GET
Resource URL /form/
Parameters
  • id : form id
  • callback : jsonp callback
Response formats
  • JSON without callback
  • JSONP
Example Request /form/?id=557809235f07aa3a1988491a&callback=mycallback
Example Result
               
                  /**/ typeof mycallback === 'function' && mycallback(
                      {
                        "code": 1,
                        "msg": "success",
                        "data": {
                          "_id": "557809235f07aa3a1988491a",
                          "desc": "form Description",
                          "title": "Form title",
                          "sid": "N14Hdg-L",
                          "schemata": [
                            {
                              "child": [
                                {
                                  "child": [],
                                  "title": "text",
                                  "name": "child_attribute1"
                                },
                                {
                                  "child": [],
                                  "title": "text",
                                  "name": "child_attribute2"
                                }
                              ],
                              "title": "text",
                              "name": "attribute1"
                            },
                            {
                              "child": [],
                              "title": "text",
                              "name": "attribute2"
                            }
                          ]
                        }
                      }
                    );
                 
                
"code": 0 error,1 success

#Get a form's data

Description
Method GET
Resource URL /formdata/
Parameters
  • formid : form id
  • page : page number
  • callback : jsonp callback
Response formats
  • JSON without callback
  • JSONP
Example Request /formdata/?formid=557809235f07aa3a1988491a&page=0&callback=mycallback
Example Result
               
                  /**/ typeof mycallback === 'function' && mycallback(
                      {
                        "data": [
                          {
                            "_id": "5579300acd0f8fb525872d91",
                            "form": "557809235f07aa3a1988491a",
                            "data": {
                              "attribute2": "value2",
                              "attribute1": "value1"
                            },
                            "__v": 0,
                            "updateDateTime": "2015-06-11T06:52:27.499Z",
                            "createDateTime": "2015-06-11T06:51:54.730Z"
                          },
                          {
                            "_id": "5578f16d322a895e20d29e8e",
                            "form": "557809235f07aa3a1988491a",
                            "__v": 0,
                            "data": {
                              "attribute2": "value2",
                              "attribute1": "value1"
                            },
                            "updateDateTime": "2015-06-11T06:50:59.182Z",
                            "createDateTime": "2015-06-11T02:24:45.464Z"
                          }
                        ],
                        "total": 2,
                        "page": 0,
                        "perPage": 50,
                        "code": 1,
                        "msg": "success"
                      }
                    );
               
              
"code": 0 error,1 success

#Post data to a form

Description
Method POST
Resource URL /formdata/
Parameters
  • formid : form id
  • failure_url : failed redirect to the url
  • success_url : success redirect to the url
  • attribute name-N : form's attribute name-n
Response formats
  • JSON without callback
  • JSONP
Example Request
                
        <iframe id="_if" name="_if"></iframe>
        <form target="_if" method="POST" action="/apis/v1/formdata/">
          <input type="text" name="formid" value="557809235f07aa3a1988491a"/>
          <input type="text" name="attribute1" value="val1"/>
          <input type="text" name="attribute2" value="val2"/>
          <input type="text" name="failure_url" value="result.html?success=0"/>
          <input type="text" name="success_url" value="result.html?success=1"/>
          <button type="submit">Submit</button>
        </form>
                
                
Example Result
  • success redirect to result.html?success=1
  • failed redirect toresult.html?success=0

#Get a form data's detail

Description
Method GET
Resource URL /formdata_detail/
Parameters
  • id : data id
  • callback : jsonp callback
Response formats
  • JSON without callback
  • JSONP
Example Request /formdata_detail/?id=568523e508f920d049b31ad2&callback=mycallback
Example Result
               
                  /**/ typeof mycallback === 'function' && mycallback(
                      {
                        "data": {
                          "_id": "568523e508f920d049b31ad2",
                          "form": "557809235f07aa3a1988491a",
                          "data": {
                            "attribute2": "value2",
                            "attribute1": "value1"
                          },
                          "__v": 0,
                          "updateDateTime": "2015-06-11T06:52:27.499Z",
                          "createDateTime": "2015-06-11T06:51:54.730Z"
                        },
                        "code": 1,
                        "msg": "success"
                      }
                    );
               
              
"code": 0 error,1 success

#Update a form data's detail

Description
Method POST
Resource URL /formdata_detail/
Parameters
  • id : data id
  • failure_url : failed redirect to the url
  • success_url : success redirect to the url
  • attribute name-N : form's attribute name-n
Response formats
  • JSON without callback
  • JSONP
Example Request
                
    <iframe id="_if" name="_if"></iframe>
    <form target="_if" method="POST" action="/apis/v1/formdata_detail/">
      <input type="text" name="id" value="568523e508f920d049b31ad2"/>
      <input type="text" name="attribute1" value="val1"/>
      <input type="text" name="attribute2" value="val2"/>
      <input type="text" name="failure_url" value="result.html?success=0"/>
      <input type="text" name="success_url" value="result.html?success=1"/>
      <button type="submit">Submit</button>
    </form>
                
                
Example Result
  • success redirect to result.html?success=1
  • failed redirect toresult.html?success=0