Update IUCN API requests to use query parameters for authentication and taxon ID.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: e931b5ab-041b-42e7-baf1-50017869cef6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/e19c6a51-7e4c-4bb8-a6a6-46dc00f0ec99/0999f8cc-1cbe-4d49-9b15-f22b9302278f.jpg
This commit is contained in:
@ -497,11 +497,9 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
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<Server> {
|
||||
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<Server> {
|
||||
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
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user