Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

455
Views
Could I get my form data from formspark with js fetch() API?

As I read from formspark documentation we can use GET methods in formspark. If I understood correctly, the GET method in JS fetch() API means that we want to retrieve data from somewhere. So I wrote this code to get my data (data that were created before from submissions in formspark) with JS fetch method:

async function fetchText() {
    let response = await fetch('https://submit-form.com/my-id', {
        method: "GET",
        headers: {
            "Content-Type": "application/json",
            Accept: "application/json",
        }
    })
    let data = await response.json();
    console.log(data);
    return data;
}

fetchText().then(r => console.log(r));

But it gives me an empty object as a response data! while I have six submissions in my account now. Could someone please help me that what is wrong in my code?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The backend returns the following message This form does not exist anymore.

Server error

If I do the same with the URL sample from the documentation. It gives me the following error

Another server error

So what do you need to do is to replace the my-id with your form ID in the URL (e.g https://submit-form.com/22).

Here is the snippet with the change applied

async function fetchText(formId) {
    let response = await fetch(`https://submit-form.com/${formId}`, {
        method: "GET",
        headers: {
            "Content-Type": "application/json",
            Accept: "application/json",
        }
    })
    let data = await response.json();
    console.log(data);
    return data;
}

const targetFormId = 441; // Here should be a valid actual form ID

fetchText(targetFormId).then(r => console.log(r));

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!