[REQUEST] manage timeline with flowcard

How did you get te bearer token, Peter? @Peter_de_Vos

Just here in the app settings

Thanks, I knowšŸ˜, but Iā€™ve 2FA enabled, and I got an error.

So uneanable itšŸ˜€

Will do

Weirdā€¦

Please restart the app and see if that fixes that problem. Does a ā€˜self-deleting-flowā€™ work?

Iā€™ll have a look at it, although I doubt that I can upload a new buildā€¦ For now you can only disable 2FA I guess

Thanks,
So I disabled 2FA, logged on, got a bearer token and restarted the app.
I made a flow ā€œdelete messages older than 1 dayā€.
It worked, but Homey got unrespinsive and the Timeline Manager got paused by Homey.
Restarting both Homey app and Timeline app solved it for now.

And Iā€™ve 2FA is enabled again after this.

It works, but the notification wonā€™t dissapear yet (set to 1min, now 5mins have passed)

Category pick works here, but messages donā€™t disappear.

No hurries!

Cheers

Iā€™m afraid I made a bit of a design flawā€¦ I donā€™t ā€˜saveā€™ the token, just hold it in memory. Only the credentials are stored, not the token itself. So every time the app (or Homey) is restarted it needs to obtain a new token, but with 2FA enabled that will fail.

Iā€™ll change that in the next version.

I never experienced Homey becoming unresponsive. I did experience that sometimes the deletion of flows wasnā€™t shown in the mobile app. After restarting the mobile at they were gone. The webapp does show the deletions immediately; I guess that does a pull, while the mobile app uses a websocket

1 Like

The flow works

Just fyi,
This probably occurred when running the ā€œremove msgs older than 1 dayā€ flow

Perhaps I donā€™t understand the issue, but apps donā€™t require any credentials to be able to use the Web API. Only the correct permission (in app.json).

Hi,

Iā€™m using the REST Api because otherwise I donā€™t seem to have the right persmission to do certain stuff. My app.json includes the homey:manager:api permission, but I canā€™t get it to work, but maybe Iā€™m missing something, the documentation isnā€™t what one hoped for.

this.homey.api.get(ā€˜http://127.0.0.1/api/manager/notifications/ownerā€™)

gives me an ā€œmissing_permissionā€ error, while

  	var response = await fetch('https://' + cloudId + '.connect.athom.com/api/manager/notifications/owner', {
  		method: 'GET',
  		headers: { 'Authorization': 'Bearer ' + bearerToken }
  	})

gives me a a nice list. But that way I need the Bearer Token, and for that it needs the credentials.

If you know of a way to do it without the REST Api please let me know, that would make things much easier.

1 Like

Apologies, it looks like Athom has decided that SDKv3 apps arenā€™t allowed to use the Web API ā€œnativelyā€ anymore, which is still allowed for SDKv2 apps (like HomeyKit).

This is the code Iā€™m using (in SDKv2):

const { HomeyAPI } = require('athom-api');
ā€¦
const api = await HomeyAPI.forCurrentUser();

Thanks. Thatā€™s too bad then!

After having a quick look I doubt that I will be able to get de 2FA working. Peterā€™s memory problem can undoubtedly be solved/prevented, but without 2FA working a lot of people canā€™t use it, of need to disable it every once in a while.

Talking on Slack to the Athom devs, they seem to suggest that it should still work. Iā€™ll let you know if we can solve the issue.

2 Likes

Thanks, I can really appreciate it!

I got the Web API working again from an SDKv3 app, but sadly, notifications are off-limits using it :frowning:

Wouldnā€™t it be possible to make the app available in the Community Store?

2 Likes

Hi Uwe,

That is of course a possibility, but as I am using API keys that can only be used for development purposes it doesnā€™t feel right.

Iā€™ll wait for Athom to reply on my request for my own API keys. If they deny that request I might reconsider though. :wink:

In the meantime Iā€™ll look at the issues from both Peters.

3 Likes