diff --git a/server/routes.ts b/server/routes.ts index 2843140..57e2ca7 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -497,11 +497,9 @@ export async function registerRoutes(app: Express): Promise { const taxonId = taxaResponse.data.result[0].taxonid; // Now retrieve the threats using the taxon ID - const threatsResponse = await axios.get(`https://apiv4.iucnredlist.org/api/v4/threats`, { - headers: { - "Authorization": `Bearer ${iucnToken}` - }, + const threatsResponse = await axios.get(`https://api.iucnredlist.org/api/v4/threats`, { params: { + token: iucnToken, taxonid: taxonId } }); @@ -595,11 +593,9 @@ export async function registerRoutes(app: Express): Promise { const taxonId = taxaResponse.data.result[0].taxonid; // Now retrieve the habitats using the taxon ID - const habitatsResponse = await axios.get(`https://apiv4.iucnredlist.org/api/v4/habitats`, { - headers: { - "Authorization": `Bearer ${iucnToken}` - }, + const habitatsResponse = await axios.get(`https://api.iucnredlist.org/api/v4/habitats`, { params: { + token: iucnToken, taxonid: taxonId } }); @@ -693,11 +689,9 @@ export async function registerRoutes(app: Express): Promise { const taxonId = taxaResponse.data.result[0].taxonid; // Now retrieve the conservation measures using the taxon ID - const measuresResponse = await axios.get(`https://apiv4.iucnredlist.org/api/v4/measures`, { - headers: { - "Authorization": `Bearer ${iucnToken}` - }, + const measuresResponse = await axios.get(`https://api.iucnredlist.org/api/v4/measures`, { params: { + token: iucnToken, taxonid: taxonId } });