# Zulip API
This crate aims to implement the full [Zulip REST API](https://zulip.com/api/rest#the-zulip-rest-api).
There is potential for also implementing the [Webhook API](https://zulip.com/api/incoming-webhooks-overview) for more complete integration with Zulip servers.
## Alternatives
- [zulip](https://github.com/zulip/zulip): official Python bindings
- [zulip_rs](https://docs.rs/zulip_rs): unmaintained community Zulip client library
## Tests
Unit tests can be run with the normal:
```console
$ cargo test
```
### Integration tests
Integration tests require a little more setup based on the [docker-zulip](https://github.com/zulip/docker-zulip) project.
#### docker-zulip setup
First, use the Docker setup inside the `tests/docker` folder to launch a local Zulip instance:
```console
$ cd tests/docker
// use docker-compose to launch the instance
# docker compose up -d
// create new "realm" (Zulip term for an organization) link
# docker compose exec docker_zulip_1 \
"su zulip -c '/home/zulip/deployments/current/manage.py generate_realm_creation_link'"
```
Instructions are the same using `podman compose`.
After getting the `realm` creation link, open it in a browser, and complete the form.
You will need to click through a TLS error about self-signed certificates.
For detailed instructions, see the [docker-zulip](https://github.com/zulip/docker-zulip) repository.
#### Zulip API configuration
A `zuliprc` file with API authentication settings will be needed to run the integration tests.
You can generate the file by navigating to `Settings > Account & Privacy > API Key`, and click the `Manage API Key` button.
You will be prompted for your account password, and presented with the option to download a `zuliprc` file.
Save the file to `zulip-api/tests/zuliprc`.
#### Running integration tests
Once setup is complete, you can run integration tests with:
```console
$ cargo test --features int-tests
```