Is it possible to call an RPC function from curl?
# help
u
Is it possible to call an RPC function from curl?
g
If you go to the API tab and have an RPC function you can click on it and get the code like this:
Copy code
curl -X POST 'https://zkinvnbbamvnaqhblxrq.supabase.co/rest/v1/rpc/fetch_data1' \
-H "Content-Type: application/json" \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"
If you go to API page in the UI and have an rpc function you can get the code. example:
Copy code
curl -X POST 'https://zkifgsfgbbamfdgdfgklbl.supabase.co/rest/v1/rpc/fetch_data1' \
-H "Content-Type: application/json" \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"
u
where does the argument go?
in the path or a parm?
g
If you use the API tab it will show you that too if you have parameters...
Copy code
curl -X POST 'https://zkindffvnbbamvnadfdqhblg.supabase.co/rest/v1/rpc/room_exists' \
-d '{ "roomkey": "value" }' \
-H "Content-Type: application/json" \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"
u
sweet, ty!