Hi - working my way to something more sophisticated - currently I have:
a moralis server on polygon testnet -
moralis dashboard -
cloud function -
Moralis.Cloud.define("Sendnotifications", async (request) =>{
const logger = Moralis.Cloud.getLogger();
const res = await Moralis.Cloud.httpRequest({
'method': 'POST',
url: 'https://discord.com/api/webhooks/WEBHOOKURLREDACTED',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
params: {
'content': "beep"
}
})
logger.info(res);
});
Rather than sending a tx, just using postman to send a message to moralis server through moralis api
Getting a few diff errors, been playing around with the code - either i get
“cant send empty message”
“bad request”
or i can make it work by changing method from POST to GET but this doesnt make sense, and the output runs but it only gives me “{}” and “undefined” in the logs.
If anyone has any tips or sees something your help would be appreciated.