Back

cloud function execution url as callback url

  • 0
  • Functions
dammy
22 Jun, 2024, 06:38

I created a cloud function and used the generated url as callback URL so that the function will be triggered each time I need a response from a third party API but I wasn't able to fetch the data it was sending to my function (what I used as the call back url) despite using both context.body and context.rawBody for dart.

TL;DR
Cloud function created with callback URL not receiving data from third-party API. Use `context.req.body` in Dart function to fetch data.
darShan
22 Jun, 2024, 06:52

should be context.req.body.

darShan
22 Jun, 2024, 06:56
TypeScript
Future<dynamic> main(final context) async {
  final bodyRaw = context.req.bodyRaw;
  final body = json.encode(context.req.body);

  return context.res.send("OK", 200);
}
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more