Zerotier rest api for member does no longer return if peers are one

It seems that that “member” rest API is no longer return if a member peer is online. That is an API call like that does no longer contains an “online” field:

curl -sX GET -H "Authorization: bearer XXXXX" \ | \
    jq -r '["Name", "IP", "Online"], (.[] | [.name, .config.ipAssignments[0], .online|tostring] )

And it seems there is not a replacement for it. Do you know if it has been replaced with something else or moved to some other hidden API?


I wrote an app that also used the “Online” flag to see which users are currently connected to the network. It’s annoying it was obviously recently removed. I find the API documentation at ZeroTier and what’s actually being transmitted via json to be different and it’s not the first time I’ve seen discrepancies between what’s written and what’s actually available.

Of course there is the “onlineMemberCount” from the network query: curl -X GET -H “Authorization: token LongTokenHere” which can give you the total users online however it would be nice if they told you somewhere what constitutes an Online user. We can probably get the values from “lastOnline” or “lastSeen” with a bit of math however I ran a test and even though I was currently connected, those values were returning weeks rather than minutes. I do know that it sometimes takes a while for those values to update but this was after 20 minutes of being connected.

So, not sure where to go with this. Guessing it was the time discrepancies that made them decide to drop “Online” from the previous json file. Anyone have some other answers?

see Central Change Rollout: Last Seen - #8 by zt-grant

1 Like

Thanks AndrewZ, that helps explain things. I’ve recoded the app using “clock” - “lastSeen” and set the user as online if the time has been less than 2 minutes (seems they used 3 minutes as their previous counter but I can tweak that as a user changeable value in the app). Nice to see the issue was addressed and an explanation put forth on how it worked before and how it now works.

We’re all on the same boat :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.