-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource3.js
37 lines (30 loc) · 881 Bytes
/
source3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
let address = args[0];
async function makeApiRequest(url) {
try {
const response = await Functions.makeHttpRequest({
url,
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
},
params: {
address: address,
},
});
if (response.error) {
console.error(`API request error for ${url}:`, response.message);
return [];
}
return response.data || [];
} catch (error) {
console.error(`Error making API request for ${url}:`, error);
return [];
}
}
try {
const medicalLicenseAPI = "https://3sxnx9ycb9.execute-api.ap-southeast-1.amazonaws.com/dev/md/license";
const licenseData = await makeApiRequest(medicalLicenseAPI);
return Functions.encodeString(JSON.stringify(licenseData));
} catch (error) {
console.error("Error processing data:", error);
}