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

146
Visualizações
Using GitHub API to create new issue

I'm trying to create a GitHub issue using the GitHub API, and I found this https://github.com/ceceliacreates/APITools which is exactly what I need, but it keeps showing me my GitHub API was not found.

Following is the code:

createIssuesFromJSON = function(file) {
    file.forEach(issue => {
        fetch(`https://api.github.com/repos/${user}/${repo}/issues/`, {
            method: 'POST',
            body:    JSON.stringify(issue),
            headers: {'Content-Type': 'application/json', 'Authorization': `${process.env.TOKEN}`}
        })
        .then((res)=>{
            console.log(res);
            return res.json();
        })
        .then(json => {
            
        })
    })
}

createIssuesFromJSON(file);

error: 404 URL not found

I was checking the official GitHub website for the API usage, but I can't find anything wrong. Can anyone help me with the situation?

[Symbol(Response internals)]: {
    url: 'https://api.github.com/repos/{my github}/{my repo}/issues/',
    status: 404,
    statusText: 'Not Found',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

That code is from github.com/ceceliacreates/APITools/CreateIssuesFromJSON/CreateIssuesFromJSON.js.
Except with fetch("https://api.github.com/repos/${user}/${repo}/issues")

It seems to follow the header I mentioned before.

You need to double-check the token used, and its associated scope.

And try to use the library itself.

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