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

249
Visualizações
Riot API: I don't know why it returns unauthorized (401)

I don't know why this would be unauthorized. I checked that the api_key and puuid are correct. When I made a request to another Riot API in a similar way, I got the desired result (status code: 200). I'm guessing there is a typo in the URL that sent the request, but I can't find where it went wrong.

import fetch from 'node-fetch'

const getMatchList = async () => {
  const puuid = 'XXXXXXXX'
  const api_key = 'XXXXXXX'
  const res = await fetch(
    `https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1?api_key=${api_key}`
  )
  const myJson = await res.json()
  console.log(myJson) // { status: { message: 'Unauthorized', status_code: 401 } }
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Change the '?' in the api_key for '&' just like that: Original: https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1?api_key=${api_key}

Right: https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/${puuid}/ids?start=0&count=1&api_key=${api_key}

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