-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I Kick or Ban someone from the room through the API? #441
Comments
in the neko v3 or neko-rooms v3 ? and the v3 is release? |
In neko v3, neko rooms works with both. Its on the v3 branch. |
what different about with the v3 and v3-phase1? |
Its all explained in #371
It is meant only for development. But you could replace directory |
Thanks very much! |
In v3 yes. You can copy the openapi.yaml to some editor like https://swagger.io and it shows you interactively what APIs are available. |
I use the https://app.swaggerhub.com/apis/Z858570636/n-eko_rest_api/1.0.0#/members/membersCreate but it show the error
how to add the token |
You need to perform login, one of the first api calls. And then there is probably possibly to set the token in swagger. https://stackoverflow.com/questions/32910065/how-to-use-authorization-bearer-token-in-a-swagger-spec |
I use the and then get the response and then use the token {
"id": "admin-tRjjT",
"token": "VBPykToh-HpB7Yuw-gDRMkoutYmatJriI-IC6BE9iqmy3Bs6sM8lhRTbI83CdoRs",
"profile": {
"name": "admin",
"is_admin": false,
"can_login": true,
"can_connect": true,
"can_watch": true,
"can_host": true,
"can_share_media": true,
"can_access_clipboard": true,
"sends_inactive_cursor": true,
"can_see_inactive_cursors": false,
"plugins": null
},
"state": {
"is_connected": false,
"is_watching": false
}
} and then use the import requests
url = "http://74.48.86.124:3000/api/members"
token = "VBPykToh-HpB7Yuw-gDRMkoutYmatJriI-IC6BE9iqmy3Bs6sM8lhRTbI83CdoRs"
headers = {
"Authorization": f"Bearer {token}"
}
data = {
"username": "admin",
"password": "neko",
"profile": {
"name": "bill",
"is_admin": False,
"can_login": True,
"can_connect": True,
"can_watch": True,
"can_host": True,
"can_share_media": True,
"can_access_clipboard": True,
"sends_inactive_cursor": True,
"can_see_inactive_cursors": True,
"plugins": {
"additionalProp1": {}
}
}
}
response = requests.post(url, headers=headers, json=data)
print(response.status_code)
print(response.text) but I get the result
I say the admin account not the admin, another account ? how to solve it ? |
I use the
to get the token and send the request
but it still can not to create the new user,it raise the error ERR request failed (500): Internal Server Error error="new user is created on first login in multiuser mode" |
By default, there is multiuser mode meaning that new users are created when logging in. You can switch to other user mode and then you need to create your own users. Add this to env: NEKO_SESSION_API_TOKEN="yourApiTokenCanBeAnything"
NEKO_MEMBER_PROVIDER="object" You will now need to create your own users and you can delete/manage them. By default you will have no users when starting neko, and you can use the specified access token to create these users. Or you can preserve your logins by using file provider. All users will be saved to specified json file. You must then mount it outside of container to have it available when recreated. NEKO_MEMBER_PROVIDER="file"
NEKO_MEMBER_FILE_PATH="/path/to/members.json" |
add this |
If you use dev scripts then you need to directly modify start script. You will see there are other environment variables and you need to add it to them. |
The issue is probably your additional quotes So it should look like this: -e "NEKO_SESSION_API_TOKEN=yourApiTokenCanBeAnything" \
-e "NEKO_MEMBER_PROVIDER=object" \ |
it works,thanks a lot! |
Can I Kick or Ban someone from the room through the API?
or
Can I make someone in the room lose control through an API?
The text was updated successfully, but these errors were encountered: