Submissions Version 1

Note: This documentation describes Version 1 of our API, which is now depreciated. It will continue to work, but it will not reveive any updates or bug fixes. We recommend you use Version 2 instead. Documentation for this resource for Version 2 of our API is available here.

This document describes the OSDI submissions collection and submission resource as implemented by the Action Network.

Submissions represent the action an activist took when they submitted a specific form.

Submissions can have question answers embedded with them representing the questions the person answered when they submitted the form, and are linked to the person resource corresponding to the activist who submitted the form as well as the question answers.

Note: Submissions are deduplicated based on person, so a specific person can only submit a given form once.

Sections:

Endpoints and URL structures

Endpoints:

https://actionnetwork.org/api/v1/forms/[form_id]/submissions

https://actionnetwork.org/api/v1/people/[person_id]/submissions

Submission resources live at endpoints relating to the person who submitted the form and the form they signed. The endpoints return a collection of all submissions associated with either that person or that form.

URL Structures:

https://actionnetwork.org/api/v1/forms/[form_id]/submissions/[submission_id]

https://actionnetwork.org/api/v1/people/[person_id]/submissions/[submission_id]

To address a specific submission, use the identifier without the action_network: prefix to construct a URL, like https://actionnetwork.org/api/v1/forms/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/submissions/167ce1d2-70b7-423e-b480-914981cbeaff

Back To Top ↑

Field names and descriptions

Field Name Type Required on POST Description
identifiers array[] An array of identifiers in the format [system name]:[id]. See the general concepts document for more information about identifiers.
originating_system string Yes A human readable string identifying where this submission originated. May be used in the user interface for this purpose.
created_at datetime The date and time the resource was created. System generated, not editable.
modified_at datetime The date and time the resource was last modified. System generated, not editable.
question_answers osdi:question_answers[]* An embedded collection of question answers. Click here for question answer documentation.
action_network:person_id string The native Action Network identifier associated with the person who submitted on this form. Action Network-only feature. System generated, not editable.
action_network:form_id string The native Action Network identifier associated with the form this submission was left on. Action Network-only feature. System generated, not editable.
action_network:referrer_data hash A hash of referrer data such as source code and referrer code. Action Network-only.
action_network:referrer_data.source string The source code of this submission. Equivalent to someone taking action with the url argument ?source=[your source]. Corresponds to the sources chart in this action's manage page. Action Network-only.
action_network:referrer_data.referrer string The referrer code of this submission. Equivalent to someone taking action with the url argument ?referrer=[your referrer code]. Must be a valid Action Network referrer code. Read-only. Corresponds to the referrers chart in this action's manage page. Action Network-only.
action_network:referrer_data.website string The website referrer for this submission. Equivalent to someone taking action after clicking a link on the listed website. Corresponds to the websites chart in this action's manage page. Action Network-only.
Back To Top ↑

Links

Link Name Description
self A link to this individual submission resource.
osdi:person A link to the person who made this submission. Click here for people documentation.
osdi:form A link to the form this submission was left on. Note: If this submission was created via a referral code, this link may not be accessible because your API key does not give you permission to access the form itself. Click here for form documentation.
osdi:question_answers A link to a collection of question answers associated with this submission. Click here for question answers documentation.
Back To Top ↑

Scenario: Retrieving a collection of submission resources (GET)

Submission resources are sometimes presented as collections of submission. For example, calling the submission endpoint on a specific form will return a collection of all the submission associated with that form.

Request

						
GET https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions

Header:
api-key:[your api key here]
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "total_pages": 1,
  "per_page": 25,
  "page": 1,
  "total_records": 4,
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions"
    },
    "record_submissions_helper": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions"
    },
    "osdi:submissions": [
      {
        "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56"
      },
      {
        "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/32dc6359-76fd-4e97-aef7-f053a4fcc550"
      },
      //truncated for brevity
    ],
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  },
  "_embedded": {
    "osdi:submissions": [
      {
        "identifiers": [
          "action_network:c851b31b-291e-4503-b8ea-e51a740e6e56"
        ],
        "created_at": "2014-03-25T15:26:45Z",
        "modified_at": "2014-03-25T15:26:46Z",
        "originating_system": "Action Network",
        "action:person_id": "d3e27e15-e5b5-4707-be96-8bc359462133",
        "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
        "_embedded": {
          "osdi:question_answers": [
            {
              "identifiers": [
                "action_network:54a0aff2-4277-42b2-b6b5-166056a1ffa8"
              ],
              "originating_system": "Action Network",
              "value": "My story is very long, too long for this form.",
              "person_id": "d3e27e15-e5b5-4707-be96-8bc359462133",
              "question_id": "5587b89e-68ce-4b18-8484-60f5b220a3a1",
              "_embedded": {
                "osdi:question": {
                  "identifiers": [
                    "action_network:5587b89e-68ce-4b18-8484-60f5b220a3a1"
                  ],
                  "name": "Tell your story",
                  "question_type": "Paragraph",
                  "created_at": "2014-03-21T23:44:56Z",
                  "modified_at": "2014-03-21T23:44:56Z",
                  "originating_system": "Action Network",
                  "_links": {
                    "self": {
                      "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
                    },
                    "osdi:question_answers": {
                      "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1/question_answers"
                    }
                  }
                }
              },
              "created_at": "2014-03-25T15:26:45Z",
              "modified_at": "2014-03-25T15:26:45Z",
              "_links": {
                "self": {
                  "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56/question_answers/54a0aff2-4277-42b2-b6b5-166056a1ffa8"
                },
                "osdi:question": {
                  "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
                },
                "osdi:person": {
                  "href": "https://actionnetwork.org/api/v1/people/d3e27e15-e5b5-4707-be96-8bc359462133"
                }
              }
            }
          ]
        },
        "_links": {
          "self": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56"
          },
          "osdi:form": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v1/people/d3e27e15-e5b5-4707-be96-8bc359462133"
          },
          "osdi:question_answers": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56/question_answers"
          }
        }
      },
      {
        "identifiers": [
          "action_network:4bf4254a-9411-4028-8cb7-a7d3ade5edea",
          "free_forms:1"
        ],
        "originating_system": "FreeForms.com",
        "created_at": "2014-03-24T17:00:42Z",
        "modified_at": "2014-03-24T17:00:42Z",
        "action:person_id": "c945d6fe-929e-11e3-a2e9-12313d316c29",
        "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
        "_embedded": {
          "question_answers": [
            {
              "identifiers": [
                "action_network:7dbdfb2b-5dfe-4d4a-ac25-de42696cd84d"
              ],
              "value": "true",
              "person_id": "c945d6fe-929e-11e3-a2e9-12313d316c29",
              "question_id": "ab47a8d9-de7d-43a8-bfd4-5a6244d991c1",
              "originating_system": "FreeForms.com",
              "_embedded": {
                "osdi:question": {
                  "identifiers": [
                    "action_network:ab47a8d9-de7d-43a8-bfd4-5a6244d991c1"
                  ],
                  "name": "I am a parent",
                  "originating_system": "FreeForms.com",
                  "question_type": "Paragraph",
                  "created_at": "2014-03-24T16:59:13Z",
                  "modified_at": "2014-03-24T16:59:13Z",
                  "_links": {
                    "self": {
                      "href": "https://actionnetwork.org/api/v1/questions/ab47a8d9-de7d-43a8-bfd4-5a6244d991c1"
                    },
                    "osdi:question_answers": {
                      "href": "https://actionnetwork.org/api/v1/questions/ab47a8d9-de7d-43a8-bfd4-5a6244d991c1/question_answers"
                    }
                  }
                }
              },
              "created_at": "2014-03-24T16:59:13Z",
              "modified_at": "2014-03-24T16:59:13Z",
              "_links": {
                "self": {
                  "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/4bf4254a-9411-4028-8cb7-a7d3ade5edea/question_answers/7dbdfb2b-5dfe-4d4a-ac25-de42696cd84d"
                },
                "osdi:question": {
                  "href": "https://actionnetwork.org/api/v1/questions/ab47a8d9-de7d-43a8-bfd4-5a6244d991c1"
                },
                "osdi:person": {
                  "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                }
              }
            }
          ]
        },
        "_links": {
          "self": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/4bf4254a-9411-4028-8cb7-a7d3ade5edea"
          },
          "osdi:form": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
          },
          "osdi:question_answers": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/4bf4254a-9411-4028-8cb7-a7d3ade5edea/question_answers"
          }
        }
      },
      //truncated for brevity
    ]
  }
}
					
Back To Top ↑

Scenario: Retrieving an individual submission resource (GET)

Calling an individual submission resource will return the resource directly, along with all associated fields and appropriate links to additional information about the submission.

Request

						
GET https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56

Header:
api-key:[your api key here]
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:c851b31b-291e-4503-b8ea-e51a740e6e56"
  ],
  "created_at": "2014-03-25T15:26:45Z",
  "modified_at": "2014-03-25T15:26:46Z",
  "originating_system": "Action Network",
  "action:person_id": "d3e27e15-e5b5-4707-be96-8bc359462133",
  "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
  "_embedded": {
    "osdi:question_answers": [
      {
        "identifiers": [
          "action_network:54a0aff2-4277-42b2-b6b5-166056a1ffa8"
        ],
        "value": "My story is very long, too long for this form.",
        "originating_system": "Action Network",
        "person_id": "d3e27e15-e5b5-4707-be96-8bc359462133",
        "question_id": "5587b89e-68ce-4b18-8484-60f5b220a3a1",
        "_embedded": {
          "osdi:question": {
            "identifiers": [
              "action_network:5587b89e-68ce-4b18-8484-60f5b220a3a1"
            ],
            "name": "Tell your story",
            "question_type": "Paragraph",
            "originating_system": "Action Network",
            "created_at": "2014-03-21T23:44:56Z",
            "modified_at": "2014-03-21T23:44:56Z",
            "_links": {
              "self": {
                "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
              },
              "osdi:question_answers": {
                "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1/question_answers"
              },
              "curies": [
                {
                  "name": "osdi",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                },
                {
                  "name": "action_network",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                }
              ]
            }
          }
        },
        "created_at": "2014-03-25T15:26:45Z",
        "modified_at": "2014-03-25T15:26:45Z",
        "_links": {
          "self": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56/question_answers/54a0aff2-4277-42b2-b6b5-166056a1ffa8"
          },
          "osdi:question": {
            "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v1/people/d3e27e15-e5b5-4707-be96-8bc359462133"
          },
          "curies": [
            {
              "name": "osdi",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            },
            {
              "name": "action_network",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            }
          ]
        }
      }
    ]
  },
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56"
    },
    "osdi:form": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/d3e27e15-e5b5-4707-be96-8bc359462133"
    },
    "osdi:question_answers": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c851b31b-291e-4503-b8ea-e51a740e6e56/question_answers"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					
Back To Top ↑

Scenario: Creating a new submission (POST)

You can post a new submission to a form with that form's submissions endpoint and a submission resource will be created in our system.

When you post a submission, you can either link to an existing person to register that this person submitted this form, or you can post information about a new person inline to the special record_submissions_helper endpoint, to both create a new person and register that they submitted the form at the same time.

Either way, submissions are deduplicated by person, so a person can only submit a form once. Posting a new submission by a person who previously submitted the form will replace the old submission resource with the new one.

Here is an example of posting a submission linking to an existing person:

Request

						
POST https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/

Header:
Content-Type: application/json
api-key:[your api key here]
						

{
  "identifiers": [
    "free_forms:1"
  ],
  "originating_system" : "FreeForms.com",
  "_links" : {
    "osdi:person" : { "href" : "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }
  }
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "free_forms:1",
    "action_network:42d8e92f-f88a-4bd1-bc67-3c91474295c1"
  ],
  "originating_system": "FreeForms.com",
  "created_at": "2014-03-27T14:04:28Z",
  "modified_at": "2014-03-27T14:04:28Z",
  "action:person_id": "c945d6fe-929e-11e3-a2e9-12313d316c29",
  "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
  "_embedded": {
    "osdi:question_answers": []
  },
  "_links": {
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
    },
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/42d8e92f-f88a-4bd1-bc67-3c91474295c1"
    },
    "osdi:form": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
    },
    "osdi:question_answers": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/42d8e92f-f88a-4bd1-bc67-3c91474295c1/question_answers"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					

And here is an example of posting a submission with person data inlined to the special record_submissions_helper link on the submissions collection:

Request

						
POST https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/

Header:
Content-Type: application/json
api-key:[your api key here]
						

{
  "identifiers": [
    "free_forms:2"
  ],
  "originating_system" : "FreeForms.com",
  "person" : {
    "family_name" : "Smith",
    "given_name" : "John",
    "postal_addresses" : [ { "postal_code" : "20009" }],
    "email_addresses" : [ { "address" : "jsmith@mail.com" }]
  }
} 
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "free_forms:2",
    "action_network:c449e8cd-0a81-42d1-91f7-47cacf33dbe4"
  ],
  "originating_system": "FreeForms.com",
  "created_at": "2014-03-27T14:05:44Z",
  "modified_at": "2014-03-27T14:05:44Z",
  "action:person_id": "17be9a36-bb9a-4f68-94a8-40523b9dab27",
  "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
  "_embedded": {
    "osdi:question_answers": []
  },
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4"
    },
    "osdi:form": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/17be9a36-bb9a-4f68-94a8-40523b9dab27"
    },
    "osdi:question_answers": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4/question_answers"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					

In the above example, a new person was created and their submission added to the form at the same time. We deduplicate new people added this way by email address, so if the email posted corresponded with a person already in the system, we would update their record instead of creating a new person. The required fields for person remain the same -- email address and postal code -- and any posts missing that information will fail.

Note: The record_submissions_helper link is currently the same as the submissions collection, but that may not always be the case. Check the link to know exactly where to post.

And of course you can post a submission with more fields (such as address lines for your inline person data) if you'd like, but they are not required.

Back To Top ↑

Scenario: Modifying a submission (PUT)

You can modify an existing submission by using PUT on its individual endpoint.

Request

						
PUT https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4

Header:
Content-Type: application/json
api-key:[your api key here]
						

{	
  "identifiers": [
    "free_forms:5"
  ]
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "free_forms:2",
    "action_network:c449e8cd-0a81-42d1-91f7-47cacf33dbe4",
    "free_forms:5"
  ],
  "originating_system": "FreeForms.com",
  "created_at": "2014-03-27T14:05:44Z",
  "modified_at": "2014-03-27T14:07:36Z",
  "action:person_id": "17be9a36-bb9a-4f68-94a8-40523b9dab27",
  "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
  "_embedded": {
    "osdi:question_answers": []
  },
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4"
    },
    "osdi:form": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/17be9a36-bb9a-4f68-94a8-40523b9dab27"
    },
    "osdi:question_answers": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4/question_answers"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					

The above example added a new identifier to the submission.

Editing of certain fields via PUT is not allowed, and is noted in the field names table above. For example, you can't change the person who is associated with this submission. Invalid entries will be ignored.

Back To Top ↑

Scenario: Adding a question answer to a submission (POST)

You can add a question answer to a submission in two ways -- you can post to the question_answers endpoint and reference an existing question, or you can create a new question and question answer inline (and optionally a person) when you post a submission using the record_submission_helper endpoint and key/value pairs.

Either way, questions and questions answers are deduplicated. You can only have one question with a given name and any additional questions posted with that name will be merged. A person can only have one question answer to a given question, so a new question answer will replace the old one. If new question answers are posted that relate to different questions than ones already present on the submission, they will be merged into the question answer array, so all data is kept.

Here is an example of posting a question answer using the question_answers endpoint. For more explanation on the question and question answer formats, visit the question and question_answer documentation pages.

Request

						
POST https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4/question_answers

Header:
Content-Type: application/json
api-key:[your api key here]
						

{
  "value":"This is my story.",
  "originating_system":"FreeForms.com",
  "_links": {
    "osdi:question": {
      "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
    }
  }
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:1da7ab65-a28e-4284-9092-540c6bac6ddf"
  ],
  "value":"This is my story.",
  "originating_system":"FreeForms.com",
  "person_id": "17be9a36-bb9a-4f68-94a8-40523b9dab27",
  "question_id": "5587b89e-68ce-4b18-8484-60f5b220a3a1",
  "_embedded": {
    "osdi:question": {
      "identifiers": [
        "action_network:5587b89e-68ce-4b18-8484-60f5b220a3a1"
      ],
      "name": "Tell your story",
      "question_type": "Paragraph",
      "originating_system":"FreeForms.com",
      "created_at": "2014-03-21T23:44:56Z",
      "modified_at": "2014-03-21T23:44:56Z",
      "_links": {
        "self": {
          "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
        },
        "osdi:question_answers": {
          "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1/question_answers"
        },
        "curies": [
          {
            "name": "osdi",
            "href": "https://actionnetwork.org/docs/v1/{rel}",
            "templated": true
          },
          {
            "name": "action_network",
            "href": "https://actionnetwork.org/docs/v1/{rel}",
            "templated": true
          }
        ]
      }
    }
  },
  "created_at": "2014-03-27T14:16:08Z",
  "modified_at": "2014-03-27T14:16:08Z",
  "_links": {
    "osdi:question": {
      "href": "https://actionnetwork.org/api/v1/questions/5587b89e-68ce-4b18-8484-60f5b220a3a1"
    },
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/c449e8cd-0a81-42d1-91f7-47cacf33dbe4/question_answers/1da7ab65-a28e-4284-9092-540c6bac6ddf"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/17be9a36-bb9a-4f68-94a8-40523b9dab27"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					

The new question answer is now associated with the person who made this submission as well as the question that was linked on post.

Here is an example of posting a submission, person, and question answers all at the same time using the record_submission_helper endpoint and key/value pairs.

Request

						
PUT https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/

Header:
Content-Type: application/json
api-key:[your api key here]
						

{
  "originating_system" : "FreeForms.com",
  "action_network:question_answers" : {
    "I am a parent" : "true",
    "Your story" : "This is my story"
  },
  "person" : {
    "family_name" : "Smith",
    "given_name" : "John",
    "postal_addresses" : [ { "postal_code" : "20009" }],
    "email_addresses" : [ { "address" : "jsmith@mail.com" }]
  } 
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:a59557b8-316c-4d9b-9b7a-b9be2aac4b2a"
  ],
  "originating_system": "FreeForms.com",
  "created_at": "2014-03-27T14:24:22Z",
  "modified_at": "2014-03-27T14:24:22Z",
  "action:person_id": "a1ea6af0-ae1f-43be-8b72-5e483407e083",
  "action_network:form_id": "adb951cb-51f9-420e-b7e6-de953195ec86",
  "_embedded": {
    "osdi:question_answers": [
      {
        "identifiers": [
          "action_network:22cebb5b-0216-4141-96bf-515e7e6d9a48"
        ],
        "originating_system": "FreeForms.com",
        "value": "true",
        "person_id": "a1ea6af0-ae1f-43be-8b72-5e483407e083",
        "question_id": "16a5adba-e356-4476-a9f4-3ce0ebd41b6c",
        "_embedded": {
          "osdi:question": {
            "identifiers": [
              "action_network:16a5adba-e356-4476-a9f4-3ce0ebd41b6c"
            ],
            "name": "I am a parent",
            "question_type": "Paragraph",
            "created_at": "2014-03-27T14:24:22Z",
            "modified_at": "2014-03-27T14:24:22Z",
            "originating_system": "FreeForms.com",
            "_links": {
              "self": {
                "href": "https://actionnetwork.org/api/v1/questions/16a5adba-e356-4476-a9f4-3ce0ebd41b6c"
              },
              "osdi:question_answers": {
                "href": "https://actionnetwork.org/api/v1/questions/16a5adba-e356-4476-a9f4-3ce0ebd41b6c/question_answers"
              },
              "curies": [
                {
                  "name": "osdi",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                },
                {
                  "name": "action_network",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                }
              ]
            }
          }
        },
        "created_at": "2014-03-27T14:24:22Z",
        "modified_at": "2014-03-27T14:24:22Z",
        "_links": {
          "self": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/question_answers/22cebb5b-0216-4141-96bf-515e7e6d9a48"
          },
          "osdi:question": {
            "href": "https://actionnetwork.org/api/v1/questions/16a5adba-e356-4476-a9f4-3ce0ebd41b6c"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v1/people/a1ea6af0-ae1f-43be-8b72-5e483407e083"
          },
          "curies": [
            {
              "name": "osdi",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            },
            {
              "name": "action_network",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            }
          ]
        }
      },
      {
        "identifiers": [
          "action_network:c89ea9a5-898f-4a05-a09e-3de352272c74"
        ],
        "value": "This is my story",
        "originating_system": "FreeForms.com",
        "person_id": "a1ea6af0-ae1f-43be-8b72-5e483407e083",
        "question_id": "6ca859fc-4801-4aad-8d4b-c793826ba4c3",
        "_embedded": {
          "osdi:question": {
            "identifiers": [
              "action_network:6ca859fc-4801-4aad-8d4b-c793826ba4c3"
            ],
            "name": "Your story",
            "originating_system": "FreeForms.com",
            "question_type": "Paragraph",
            "created_at": "2014-03-27T14:24:22Z",
            "modified_at": "2014-03-27T14:24:22Z",
            "_links": {
              "self": {
                "href": "https://actionnetwork.org/api/v1/questions/6ca859fc-4801-4aad-8d4b-c793826ba4c3"
              },
              "osdi:question_answers": {
                "href": "https://actionnetwork.org/api/v1/questions/6ca859fc-4801-4aad-8d4b-c793826ba4c3/question_answers"
              },
              "curies": [
                {
                  "name": "osdi",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                },
                {
                  "name": "action_network",
                  "href": "https://actionnetwork.org/docs/v1/{rel}",
                  "templated": true
                }
              ]
            }
          }
        },
        "created_at": "2014-03-27T14:24:22Z",
        "modified_at": "2014-03-27T14:24:22Z",
        "_links": {
          "self": {
            "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/question_answers/c89ea9a5-898f-4a05-a09e-3de352272c74"
          },
          "osdi:question": {
            "href": "https://actionnetwork.org/api/v1/questions/6ca859fc-4801-4aad-8d4b-c793826ba4c3"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v1/people/a1ea6af0-ae1f-43be-8b72-5e483407e083"
          },
          "curies": [
            {
              "name": "osdi",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            },
            {
              "name": "action_network",
              "href": "https://actionnetwork.org/docs/v1/{rel}",
              "templated": true
            }
          ]
        }
      }
    ]
  },
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/a59557b8-316c-4d9b-9b7a-b9be2aac4b2a"
    },
    "osdi:form": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v1/people/a1ea6af0-ae1f-43be-8b72-5e483407e083"
    },
    "osdi:question_answers": {
      "href": "https://actionnetwork.org/api/v1/forms/adb951cb-51f9-420e-b7e6-de953195ec86/submissions/a59557b8-316c-4d9b-9b7a-b9be2aac4b2a/question_answers"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					

In this example, a new person was created, a new submission for that person on this form was created, and new questions and question answers also created and linked to the new person and submission.

Back To Top ↑

Scenario: Deleting a submission (DELETE)

Deleting submissions is not allowed via the API. DELETE requests will return an error.

Back To Top ↑