API: Pull Activity for just a single type of form? | Community
Skip to main content
June 1, 2015
Solved

API: Pull Activity for just a single type of form?

Hi Nation!

Hoping someone can help me out: When pulling form fill out activity from the SOAP or REST API, is it possible to pull just the activities related to a specific FORM ID? I feel like this should be possible, but I didn't see anything in the API documentation to support this.

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
John_M
John_MAccepted solution
Employee
June 15, 2015

You'd have to do it a bit programmatically, I think. If you're using REST and you call "Get Activity Types" This is what comes back for a form fill. Note the primary attribute is form fill ID. I think it would involve calling all activity of a certain type (or types) and then parsing the jSON response for the form ID you're interested in.

Note that the form ID is the value after "FO# in the editor.

does that help?

{

      "id": 2,

      "name": "Fill Out Form",

      "description": "User fills out and submits a form on web page",

      "primaryAttribute": {

        "name": "Webform ID",

        "dataType": "integer"

      },

      "attributes": [

        {

          "name": "Client IP Address",

          "dataType": "string"

        },

        {

          "name": "Query Parameters",

          "dataType": "string"

        },

        {

          "name": "Referrer URL",

          "dataType": "string"

        },

        {

          "name": "User Agent",

          "dataType": "string"

        },

        {

          "name": "Webpage ID",

          "dataType": "integer"

        }

      ]

    },

4 replies

John_M
John_MAccepted solution
Employee
June 15, 2015

You'd have to do it a bit programmatically, I think. If you're using REST and you call "Get Activity Types" This is what comes back for a form fill. Note the primary attribute is form fill ID. I think it would involve calling all activity of a certain type (or types) and then parsing the jSON response for the form ID you're interested in.

Note that the form ID is the value after "FO# in the editor.

does that help?

{

      "id": 2,

      "name": "Fill Out Form",

      "description": "User fills out and submits a form on web page",

      "primaryAttribute": {

        "name": "Webform ID",

        "dataType": "integer"

      },

      "attributes": [

        {

          "name": "Client IP Address",

          "dataType": "string"

        },

        {

          "name": "Query Parameters",

          "dataType": "string"

        },

        {

          "name": "Referrer URL",

          "dataType": "string"

        },

        {

          "name": "User Agent",

          "dataType": "string"

        },

        {

          "name": "Webpage ID",

          "dataType": "integer"

        }

      ]

    },

Translate
SanfordWhiteman
Level 10
June 15, 2015

John, obvs. that would work, but when you're parsing client-side that means you are going to use up your API calls on unwanted records.

Translate
John_M
Employee
June 22, 2015

Sanford, I disagree. There is nothing in this thread that indicates this is a client side rest call. I'd assume this is being done in some secure middle tier, which is the best practice.

If you have a better solution given the current end points in the REST API, feel free to share them.

Translate
SanfordWhiteman
Level 10
June 1, 2015

There's no filter like this as far as I know.

Translate