This app was mentioned in 17 comments, with an average of 1.53 upvotes
Yep I was having the same issue. Like I said in the OP the POST request needs to include a token in the header, but sadly Tasker doesn't allow this, instead only letting you specify the body. I'd been using Tasker without issues until I updated as well.
If you want to use Tasker you need this plugin, or you can use HTTP Shortcuts. I chose the latter because after trying RESTask I noticed that calling a request either was super slow or just threw an error at me. You can still call a HTTP Shortcut from Tasker so I'd advise you to go that route.
If you're having any more issues just let me know!
Well it does take a little more knowledge than just your basic Tasker know how. I have used it in my main Tasker project but I have yet to learn log ins and such. I think this plugin will help but you still need to know the http basic of Tasker and for that there are some videos around.
The HTTP Post action in tasker has never been reliable for me. I've struggled for hours trying to figure out why tasks weren't acting like they should, only to find that HTTP Post wasn't returning what it should.
Now I use RESTask for all tasks which require http get or post, it's much better.
There seems to be a lot of posts and internet articles on this topic. Search for "curl" or "post". You basically need to run a shell command. You'll probably use the Action called "Run Shell"
Or try this plugin - https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=en_US
One caveat: network health is going to ping your phone every minute, taking your phone out of sleep mode. When I had a similar setup it depleted my battery considerably when I was on my home wifi.
The solution (for me) was to make a Tasker profile that directly sets the mode of my phone's switch item to ON/OFF when I leave the area near my home (with a HTTP PUT request using RESTask and openHAB's REST API, and every hour do an extra ping to make sure it's current.
(Also with Marshmallow's doze mode I'm not sure if the phone will answer to pings eventually if it's left alone.)
On top of the various Auto* Plugins, I also have:
Some of them I don't use right now, but figured it would be worth a mention anyways.
I can't seem to use Tasker's POST with JSON. But I did get it to work with RESTask.
Goo.gl A1: RESTask [ Configuration:REST call Package:com.freehaha.restask Name:RESTask Timeout (Seconds):30 ] A2: JavaScriptlet [ Code:var shorturl=JSON.parse(rtres).id Libraries: Auto Exit:On Timeout (Seconds):45 ] A3: Popup [ Title: Text:%shorturl Background Image: Layout:Popup Timeout (Seconds):5 Show Over Keyguard:On ]
RESTask has the following:
Type: POST Host: https://www.googleapis.com/urlshortener/v1/url Custom body: {"longUrl": "https://reddit.com"}
Headers Content-Type: application/json
You may try RESTask plugin
There's a few ways around it. Here's a good thread https://community.home-assistant.io/t/tasker-long-lived-access-tokens/69253
One is using JavaScript as discussed here https://community.home-assistant.io/t/tutorial-using-the-new-auth-system-with-tasker/82423
One is using the RESTask plugin here https://play.google.com/store/apps/details?id=com.freehaha.restask
Tasker doesn't support http headers in the http post task. There's a few ways around it. Here's a good thread https://community.home-assistant.io/t/tasker-long-lived-access-tokens/69253
One is using JavaScript as discussed here https://community.home-assistant.io/t/tutorial-using-the-new-auth-system-with-tasker/82423
One is using the RESTask plugin here https://play.google.com/store/apps/details?id=com.freehaha.restask
Why do you not use RESTask?
https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=es
Hi,
It sounds like you want to use basic authentication first, this can be done by doing: > https://username:[email protected]/api/projects.json
This should work for most cases, however it communicates your username and password over plain text (albeit in HTTPS)
So according to the api you could do something like this: >https://username:[email protected]/api/authentication/token.json
And the response will contain a token for you to use (it expires every 5 hours, so you will have to check to see if the token is expired)
And then you should be able to do something along the lines of this
GET /api/projects.json Host: https://todo.ly Token: <token value>
Personally, I use ResTask for HTTP requests, it works pretty well and sets the response code/data as local variables for you automatically. Sources:
https://todo.ly/apiwiki/?authentication/token-authentication
I use a the RESTask plugin to hit the HabitRPG api. My sleep tracker, Sleep as Android broadcasts events that can be caught by Tasker, and in those events, I use the RESTask action to check the relevant item only if it's in the right time window.
So, for example, the "Sleep Tracking Started" event does two things: It turns my lights off (using AutoHUE), and if it's after 8PM but before 2AM, it automatically ticks my "Asleep by 2" daily.
My alarm going off stores the time it happened in a variable, and my dismissing the alarm ticks my awake daily only if the time since the alarm went off is short enough.