Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

467
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda