Hi All,
I try this:
CREATE LINK HTTP_link AS HTTP
CREDENTIALS ‘{“headers”:{}}’
CONFIG ‘{“headers”:{“x-rapidapi-host”: “community-open-weather-map.p.rapidapi.com”, “x-rapidapi-key”: “09e1708b03msh5f6f7593db163acp1683f8jsnbe8f998ec599”}}’;
SET GLOBAL external_functions_allowlist = ‘{ “endpoints”: [“https://community-open-weather-map.p.rapidapi.com/weather”] }’;
SET GLOBAL enable_external_functions = ‘ON’;
CREATE OR REPLACE EXTERNAL FUNCTION test.weather(q TEXT, lat INT, lon INT, callback TEXT, id INT, lang TEXT, units TEXT, mode TEXT)
RETURNS TEXT
AS REMOTE SERVICE ‘https://community-open-weather-map.p.rapidapi.com/weather’
FORMAT JSON
LINK HTTP_link;
SELECT test.weather(‘Nahariya’, 0, 0, ‘test’, 2172797, ‘null’, ‘imperial’, ‘xml’);
I receive next: Error Code: 2578. {“message”:“Endpoint/weather does not exist”}
What is bad there ?
See https://rapidapi.com/community/api/open-weather-map/ to be sure that /weather exists.
Thanks!