diff --git a/docs/api/central/examples.md b/docs/api/central/examples.md index 717a1eb..3a7318b 100644 --- a/docs/api/central/examples.md +++ b/docs/api/central/examples.md @@ -98,7 +98,9 @@ curl -H "Authorization: token $ZT_TOKEN" -X POST \ -### Deauthorize a network member +### Deauthorize a network member ( shell ) + +curl on Unix ```sh curl -H "Authorization: token $ZT_TOKEN" -X POST \ @@ -106,6 +108,29 @@ curl -H "Authorization: token $ZT_TOKEN" -X POST \ --data '{"config": {"authorized": false}}' ``` +### Deauthorize a network member ( Powershell Invoke-WebRequest ) + +```code +$ZT_TOKEN = "" +$NWID = "" +$MEMBER_ID = "" + +$headers = @{ + "Authorization" = "token $ZT_TOKEN" +} + +$body = @{ + config = @{ + authorized = $false + } +} | ConvertTo-Json + +Invoke-WebRequest -Uri "https://api.zerotier.com/api/v1/network/$NWID/member/$MEMBER_ID" ` + -Method Post -Headers $headers -Body $body -ContentType "application/json" +``` + +Please note, if you encounter an error, System.String and System.Collections.IDictionary when using curl within Powershell, be advised this is an _alias_ which can lead to confusion because it is a wrapper for Invoke-WebRequest which has different parameter syntax than curl on non-windows operating systems. As an alternative solution, curl.exe can be used, however may not be available on your system. Caveat emptor. +