Gated content via external site via javascript API

caomicc
Level 1

Gated content via external site via javascript API

Hi!
I'm building a site using react, and need to create a method to gate content based on a marketo form. I am using the forms 2.0 and have been able to return a form using the get command for forms.json via REST API endpoint reference for Forms

{
    "id": 2740,
    "name": "Dev Test",
    "description": "",
    "createdAt": "2019-11-25T17:20:58Z+0000",
    "updatedAt": "2022-11-02T23:54:55Z+0000",
    "url": "https://app-aba.marketo.com/XXXXXX",
    "status": "approved",
    "theme": "simple",
    "language": "English",
    "locale": "en_US",
    "progressiveProfiling": false,
    "labelPosition": "above",
    "fontFamily": "Helvetica",
    "fontSize": "13px",
    "folder": {
        "type": "Folder",
        "value": 44,
        "folderName": "Test Forms"
    },
    "knownVisitor": {
        "type": "custom",
        "template": "Welcome back, {{lead.FirstName}} {{lead.LastName}}<br/><br/>{{form.Button:default=Download}}<br/><br/>{{form.NotYou:default=Not you?}}"
    },
    "thankYouList": [
        {
            "followupType": "none",
            "followupValue": null,
            "default": true
        }
    ],
    "buttonLocation": 120,
    "buttonLabel": "Submit",
    "waitingLabel": "Please Wait",
    "workSpaceId": 1
}

 

My problem is that I do not know / cannot find documentation on how to know if a person has filled out a specific form using the API. Beforehand we were just using redirects to a webinar page and sometimes known visitor HTML, but I would like to not allow anyone to view the gated content if they have not filled out the form but were forwarded that page if that page is not a marketo landing page.

 

Is there a cookie or API call that marketo has that references if a person has filled out a specific form or am I better off creating a cookie/using local storage from the front end on successful form submit and referencing that instead? Only concern I have going that method is that if someone knows the cookie it could be easily spoofed. I could be missing something in the documentation but I just cannot find it myself.

 

Thanks in advance!

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Gated content via external site via javascript API


Is there a cookie or API call that marketo has that references if a person has filled out a specific form or am I better off creating a cookie/using local storage from the front end on successful form submit and referencing that instead?

No API endpoint that doesn’t open a monster DOS vulnerability. So in practice: No.

 

The Marketo REST API in general is not designed to be called in response to individual end user activities without another layer of severe rate limiting and/or authentication on top of it.

 

I‘m assuming of course that you have too many fields to populate an individual DateTime field when each one is filled out.

caomicc
Level 1

Re: Gated content via external site via javascript API

Would it be possible to use the javascript API for it? 

 


I‘m assuming of course that you have too many fields to populate an individual DateTime field when each one is filled out.


And I'm not sure if there are too many fields as I'm not the person setting the forms up but rather building building the front end, but I would go off the assumption that yes there are too many fields. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Gated content via external site via javascript API

No, there's no way to query the Activity Log using the JS API.