Back

Hi guys, how to do an api call using only url

  • 1
  • General
  • Functions
  • REST API
groots645#645
11 Dec, 2023, 10:26

Hi guys, i want to add a backlink from my payment gateway server to Appwrite functions, but in the payment gateway i can only add the url to call, but in Appwrite there are headers that i need to set, how i can do it then?

TL;DR
Summary: The user is asking how to make an API call using only a URL in Appwrite. They mention trying to set the function endpoint in the function domains and configuring DNS with a custom domain, but it's not working as expected. They also mention coming from using Firebase and needing help with Appwrite. Additionally, they want to know how to add headers to the API call from their payment gateway server. Solution: To make an API call using only a URL in Appwrite, you need to set the function domain in the environment variables or add a custom function domain under the Domains tab in Appwrite. For setting headers in the
groots645#645
11 Dec, 2023, 10:42

I had installed the appwrite in digitalOcean cloud and using the IP address in which the appwrite runs, i added a A record with name 'appwrite.mydomain.com', and when i called that domain from browser the Appwrite successfully added ssl to it, but when i deployed a nodejs function into appwrite in the domain console of appwrite it's showing localhost address something instead of my global domains

groots645#645
11 Dec, 2023, 10:43

am new to Appwrite, previously i used firebase, please help me on this

Drake
11 Dec, 2023, 14:19

That localhost thing is the auto generated function domain. There is an environment variable for configuring what that domain is. It's something like _APP_FUNCTIONS_DOMAIN. Anyways, I would suggest going to the domains tab of your function and adding a custom function domain

groots645#645
11 Dec, 2023, 17:47

but i had configured in dns of domain

groots645#645
11 Dec, 2023, 17:47

is that not enough?

groots645#645
11 Dec, 2023, 17:48

i need to setup the environmental variables? sorry got confused, i tried looking into documentation and i tried things like setting in the function endpoint in functions domains

Ernest
11 Dec, 2023, 17:55

As Steven stated the function.localhost is autogenerated by default. You can either click on the Domains tab in your attached image and add a custom function domain or update the .env variables Checkout the documentation here for the relevant .env vars. https://appwrite.io/docs/advanced/self-hosting/functions

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