Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

458
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda