josh
November 3, 2020, 3:06pm
27
The “HTTP GET Failed” message is because the SmartThings / WebCoRE endpoint doesn’t properly support CORS. You can work around it by using the special proxy
flag:
Proxy Support (IFTTT, WebCoRE)
We’ve added an optional configuration object which enables you to configure the HTTP REST API requests to proxy through SharpTools servers. This is often helpful for services like IFTTT or WebCoRE which have issues receiving requests directly from browsers. (eg. CORS configuration issues).
To use this feature, pass a configuration object as the last parameter with a ‘proxy’ key set to true:
HTTP GET
$.get("https://maker.ifttt.com/trigger/change_volume/with/key/XXXXX", {"proxy": true})
HTTP POST
$.post("https://your.cool.url", {"volume": 10}, {"proxy": true})
There’s some other neat tips in the linked thread as well:
How To: Call REST API from Hyperlink Tiles (Syntax)
2 Likes