Tengo un problema. Estoy tratando de obtener una API, pero hay un mensaje de error que dice:
Debe existir al menos un parámetro de filtrado.
Encontré algo en Google, pero nada funcionó. Mi código se ve así:
let api = await fetch("https://api.clashofclans.com/v1/clans/#2Q8GRY8LQ", { method: `GET`, headers: new Headers({ 'Authorization': `Bearer ${API_TOKEN}`, }) }) let apiJSON = await api.json() console.log(apiJSON)Gracias
Intente encodeURIComponent de la etiqueta del clan de esta manera:
let api = await fetch(`https://api.clashofclans.com/v1/clans/${encodeURIComponent(#2Q8GRY8LQ)}`, { method: `GET`, headers: new Headers({ 'Authorization': `Bearer ${API_TOKEN}`, }) }) let apiJSON = await api.json() console.log(apiJSON)