Closed glycerine closed 7 years ago
hmm... none of my /controller calls work. I must not be using that right.
For context, I'm trying to update calls using the endpoint /api/network/%s/member/%s
(in https://github.com/unixbigot/gozer) that used to have an ActiveMembers.... but no longer have that.. to still get an active status from the api somehow.
For the example you posted above, you're missing /api/
in the call. URL should be: https://my.zerotier.com/api/controller/network/17d709436c0898a5/active
@glimberg Thanks for the hint!
Are you sure that is right? I don't get any reply...
$ curl -H "Authorization: Bearer ******************************" https://my.zerotier.com/api/controller/network/17d709436c0898a5/active
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/controller/network/17d709436c0898a5/active</pre>
</body>
$
Take /active off the end as well
Without the active, I still get an error.
<pre>Cannot GET /api/controller/network/17d709436c0898a5</pre>
Ohhh. You're looking at the Controller API. That is not public on https://my.zerotier.com/. If you need to access controller data directly, you'll have to run your own network controller. The available public API is listed here: https://my.zerotier.com/help/api
Gotcha.
I see ActiveMemberCount, but I don't any way to get the "Active" status of each assigned IP address. That used to be returned the ActiveMembers field, but that map is always null now. Is there no way to obtain that information now?
Try caling https://my.zerotier.com/api/network/<networkid>/member
for a list of networks
I'm trying to use the documented endpoint to get the active members of a network:
https://github.com/zerotier/ZeroTierOne/tree/master/controller#controllernetworknetwork-idactive
So I do:
curl -H "Authorization: Bearer **" https://my.zerotier.com/controller/network/17d709436c0898a5/active
But I get html instead of json back. Headers omitted, body returned is: