Skip to content
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

Client api #44

Open
abhatikar opened this issue Apr 25, 2021 · 1 comment
Open

Client api #44

abhatikar opened this issue Apr 25, 2021 · 1 comment

Comments

@abhatikar
Copy link

Suppose i have a server running, can i invoke a client from a script to create a room? Basically can i run it headless.? Thanks in advance

@mrgnr
Copy link
Member

mrgnr commented May 15, 2021

@abhatikar There is currently no client API, but you can use curl for creating a room:

# Do a GET request and parse the CSRF token
csrf_token=$(curl \
    -c cookies.txt \
    -b cookies.txt \
    localhost:5000/ | \
    grep csrf_token | \
    grep -Po 'value="\K[^"]*'
)

# Do a POST request to create the room
curl \
    -c cookies.txt \
    -b cookies.txt \
    -X POST \
    -F "room_name=Test Room" \
    -F "password=hello" \
    -F "public=Yes" \
    -F "guest_limit=10" \
    -F "csrf_token=$csrf_token" \
    localhost:5000/

Assuming you have a Camus server running at localhost:5000, the above commands will create a public room called "Test Room" with a password "hello" and a guest limit of 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants