ATLAS FormBuilder - Webservice Quickstart

Short commands to get started using the FormBuilder webservice.

FormBuilder provides a REST-like webservice. For full API documentation visit https://appserv7.admin.uillinois.edu/FormBuilderService (or https://apps.atlas.illinois.edu/formbuilderservice/ for UIUC College of LAS users.)

Read All Form Responses for a Form

Request

curl --user "UOFI\[username]" --header "X-Api-Version:1" --header "Accept:application/json" "https://appsdev.atlas.illinois.edu/FormBuilderService/api/FormResponse?formId=[formId]"

Response

[
   {
      "IsWaitlisted":false,
      "HasRegistrationOffer":false,
      "HasExpiredRegistrationOffer":false,
      "IsChildFormResponse":false,
      "ReferenceIdentifier":"iuro-yyyy-yyyy-y",
      "FormId":"686e11d5-a6f1-4c3c-a9fe-aa1c00ee75b6",
      "CurrentPhaseId":"596c3051-7a37-49e0-b4fd-aa1c00ee9933",
      "PeriodId":"016f2632-2e4e-4bc5-8aef-aa1c00ee75b6",
      "AssociatedUser":"user1@illinois.edu",
      "SubmittedBy":"user1@illinois.edu",
      "SubmittedByIp":"::1",
      "CreatedOn":"2019-04-04T16:19:37.043Z",
      "CreatedBy":"user1@illinois.edu",
      "CreatedByIp":"::1",
      "SubmissionCompleted":true,
      "LastModifiedOn":"2019-04-04T16:19:37.087Z",
      "LastModifiedBy":"user1@illinois.edu",
      "LastModifiedByIp":"::1",
      "SubmissionCompletedOn":"2019-04-04T16:19:37.057Z",
      "SubmissionCancelled":false,
      "Questions":[
         {
            "Id":"5f7113a1-0c1e-483e-bac5-aa1c00eebfb0",
            "FieldName":"this_is_a_text_input_box",
            "Answers":[
               {
                  "FormResponseId":"c55c375e-79ca-41e4-9579-aa2500baa986",
                  "QuestionId":"5f7113a1-0c1e-483e-bac5-aa1c00eebfb0",
                  "AnswerValue":"ert",
                  "OriginalAnswerDisplayValue":null,
                  "LastModifiedOn":"0001-01-01T00:00:00",
                  "LastModifiedBy":null
               }
            ],
            "ChildQuestions":[

            ]
         }
      ],
      "ChildFormResponseIds":[

      ],
      "Id":"c55c375e-79ca-41e4-9579-aa2500baa986"
   },
   {
      "IsWaitlisted":false,
      "HasRegistrationOffer":false,
      "HasExpiredRegistrationOffer":false,
    ...
   }
]

Update the answer to a question for a single form response

Note: when updating a form response, the permissions for the phase that the response is in apply to the user that is making the request. It is as if the user were filling out the survey portion of the form with all of the validation rules attached to it.

Request

curl --user "UOFI\exampleUser" --header "X-Api-Version:1" --header "Accept:application/json" --header "Content-Type:application/json" -X PUT -d '[ { "QuestionFieldName": "this_is_a_text_input_box", "AnswerValue": "new value goes here!" } ]' "https://apps.atlas.illinois.edu/FormBuilderService/api/FormResponse/{id}?formId={formId}"

Response

{
   "Successful":true,
   "Action":"RedirectToSurvey",
   "ExecutedActions":[
      {
         "ActionType":"Internal"
      }
   ],
   "FormResponse":{
      "IsWaitlisted":false,
      "HasRegistrationOffer":false,
      "HasExpiredRegistrationOffer":false,
      "IsChildFormResponse":false,
      "ReferenceIdentifier":"iuro-yyyy-yyyy-y",
      "FormId":"686e11d5-a6f1-4c3c-a9fe-aa1c00ee75b6",
      "CurrentPhaseId":"596c3051-7a37-49e0-b4fd-aa1c00ee9933",
      "PeriodId":"016f2632-2e4e-4bc5-8aef-aa1c00ee75b6",
      "AssociatedUser":"user1@illinois.edu",
      "SubmittedBy":"user1@illinois.edu",
      "SubmittedByIp":"::1",
      "CreatedOn":"2019-04-04T16:19:37.043Z",
      "CreatedBy":"user1@illinois.edu",
      "CreatedByIp":"::1",
      "SubmissionCompleted":true,
      "LastModifiedOn":"2019-04-09T19:59:56.427Z",
      "LastModifiedBy":"exampleUser@illinois.edu",
      "LastModifiedByIp":"123.45.678.90",
      "SubmissionCompletedOn":"2019-04-04T16:19:37.057Z",
      "SubmissionCancelled":false,
      "Questions":[
         {
            "Id":"5f7113a1-0c1e-483e-bac5-aa1c00eebfb0",
            "FieldName":"this_is_a_text_input_box",
            "Answers":[
               {
                  "FormResponseId":"c55c375e-79ca-41e4-9579-aa2500baa986",
                  "QuestionId":"5f7113a1-0c1e-483e-bac5-aa1c00eebfb0",
                  "AnswerValue":"new value goes here!",
                  "OriginalAnswerDisplayValue":null,
                  "LastModifiedOn":"0001-01-01T00:00:00",
                  "LastModifiedBy":null
               }
            ],
            "ChildQuestions":[

            ]
         }
      ],
      "ChildFormResponseIds":[

      ],
      "Id":"c55c375e-79ca-41e4-9579-aa2500baa986"
   }
}

Update the answer to multiple questions for a single form response

Updating multiple answers can be done by adding additional values to the array passed in the body of the request. For example, the following request updates the email_address answer, along with the third row (rows are zero-based indexes) of the Multiple_Questions question.

Request

curl --user "UOFI\exampleUser" --header "X-Api-Version:1" --header "Accept:application/json" --header "Content-Type:application/json" -X PUT -d '[ { "QuestionFieldName": "email_address", "AnswerValue": "me2@example.com" }, { "QuestionFieldName": "Multiple_Questions", "Rows": [ { "RowNumber": 2, "Answers": [ { "QuestionFieldName": "First_Name", "AnswerValue": "barrr" }, { "QuestionFieldName": "Age", "AnswerValue": "43" } ] } ] } ]' "https://apps.atlas.illinois.edu/FormBuilderService/api/FormResponse/{id}?formId={formId}"

Response

{
   "Successful":true,
   "Action":"RedirectToSurvey",
   "ExecutedActions":[
      {
         "ActionType":"Internal"
      }
   ],
   "FormResponse":{
      "IsWaitlisted":false,
      "HasRegistrationOffer":false,
      "HasExpiredRegistrationOffer":false,
      "IsChildFormResponse":false,
      "ReferenceIdentifier":"iuro-yyyy-yyyy-y",
      "FormId":"686e11d5-a6f1-4c3c-a9fe-aa1c00ee75b6",
      "CurrentPhaseId":"596c3051-7a37-49e0-b4fd-aa1c00ee9933",
      "PeriodId":"016f2632-2e4e-4bc5-8aef-aa1c00ee75b6",
      "AssociatedUser":"user1@illinois.edu",
      "SubmittedBy":"user1@illinois.edu",
      "SubmittedByIp":"::1",
      "CreatedOn":"2019-04-04T16:19:37.043Z",
      "CreatedBy":"user1@illinois.edu",
      "CreatedByIp":"::1",
      "SubmissionCompleted":true,
      "LastModifiedOn":"2019-04-09T19:59:56.427Z",
      "LastModifiedBy":"UOFI\\user1",
      "LastModifiedByIp":"123.45.678.90",
      "SubmissionCompletedOn":"2019-04-04T16:19:37.057Z",
      "SubmissionCancelled":false,
       "Questions": [
            {
                "Id": "348bc195-35ab-48d3-9328-a07c00f68aed",
                "FieldName": "email_address",
                "Answers": [
                    {
                        "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                        "QuestionId": "348bc195-35ab-48d3-9328-a07c00f68aed",
                        "AnswerValue": "me2@example.com",
                        "OriginalAnswerDisplayValue": null,
                        "LastModifiedOn": "0001-01-01T00:00:00",
                        "LastModifiedBy": null
                    }
                ],
                "ChildQuestions": []
            },
            {
                "Id": "fb891891-c740-4beb-b5f6-a07c00f68aed",
                "FieldName": "Multiple_Questions",
                "Answers": [
                    {
                        "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                        "QuestionId": "fb891891-c740-4beb-b5f6-a07c00f68aed",
                        "SequenceNumber": 0,
                        "AnswerValue": null,
                        "OriginalAnswerDisplayValue": null,
                        "LastModifiedOn": "0001-01-01T00:00:00",
                        "LastModifiedBy": null
                    },
                    {
                        "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                        "QuestionId": "fb891891-c740-4beb-b5f6-a07c00f68aed",
                        "SequenceNumber": 1,
                        "AnswerValue": null,
                        "OriginalAnswerDisplayValue": null,
                        "LastModifiedOn": "0001-01-01T00:00:00",
                        "LastModifiedBy": null
                    },
                    {
                        "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                        "QuestionId": "fb891891-c740-4beb-b5f6-a07c00f68aed",
                        "SequenceNumber": 2,
                        "AnswerValue": null,
                        "OriginalAnswerDisplayValue": null,
                        "LastModifiedOn": "0001-01-01T00:00:00",
                        "LastModifiedBy": null
                    }
                ],
                "ChildQuestions": [
                    {
                        "Id": "3719f446-69a6-4c7c-86b7-a07c00f68aed",
                        "FieldName": "First_Name",
                        "Answers": [
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "3719f446-69a6-4c7c-86b7-a07c00f68aed",
                                "SequenceNumber": 0,
                                "AnswerValue": "foo",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            },
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "3719f446-69a6-4c7c-86b7-a07c00f68aed",
                                "SequenceNumber": 1,
                                "AnswerValue": "baz",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            },
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "3719f446-69a6-4c7c-86b7-a07c00f68aed",
                                "SequenceNumber": 2,
                                "AnswerValue": "barrr",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            }
                        ],
                        "ChildQuestions": []
                    },
                    {
                        "Id": "f852c48c-34e2-49de-9b3d-a07c00f68aed",
                        "FieldName": "Age",
                        "Answers": [
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "f852c48c-34e2-49de-9b3d-a07c00f68aed",
                                "SequenceNumber": 0,
                                "AnswerValue": "37",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            },
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "f852c48c-34e2-49de-9b3d-a07c00f68aed",
                                "SequenceNumber": 1,
                                "AnswerValue": "36",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            },
                            {
                                "FormResponseId": "8b4cf02d-c335-4923-bd02-a50000e128a0",
                                "QuestionId": "f852c48c-34e2-49de-9b3d-a07c00f68aed",
                                "SequenceNumber": 2,
                                "AnswerValue": "43",
                                "OriginalAnswerDisplayValue": null,
                                "LastModifiedOn": "0001-01-01T00:00:00",
                                "LastModifiedBy": null
                            }
                        ],
                        "ChildQuestions": []
                    }
                ]
            }
        ],
      "ChildFormResponseIds":[

      ],
      "Id":"c55c375e-79ca-41e4-9579-aa2500baa986"
   }
}




Keywords:formbuilder, webservice   Doc ID:91087
Owner:Tim S.Group:University of Illinois Liberal Arts and Sciences
Created:2019-04-16 11:23 CDTUpdated:2020-05-19 07:34 CDT
Sites:University of Illinois Liberal Arts and Sciences
Feedback:  0   0