WAservix WhatsApp API Gateway: Clojure client by Tekservix.
Send WhatsApp messages from your own number. A thin wrapper over the official Java client (com.tekservix/waservix on Maven Central); every call returns plain Clojure data (maps with keyword keys, vectors).
You need a Tekservix account with WAservix and your number's device API key (it starts with wpk_): https://tekservix.com/waservix
WAservix WhatsApp API Gateway: Clojure client by Tekservix. Send WhatsApp messages from your own number. A thin wrapper over the official Java client (com.tekservix/waservix on Maven Central); every call returns plain Clojure data (maps with keyword keys, vectors). You need a Tekservix account with WAservix and your number's device API key (it starts with wpk_): https://tekservix.com/waservix
(client api-key)(client api-key
{:keys [base-url timeout-ms]
:or {base-url WAservix/DEFAULT_BASE_URL timeout-ms 30000}})Creates a client. Options: :base-url, :timeout-ms (default 30000).
(def wa (client (System/getenv "WASERVIX_API_KEY")))
Creates a client. Options: :base-url, :timeout-ms (default 30000). (def wa (client (System/getenv "WASERVIX_API_KEY")))
(delete-message c msg-id)Deletes a message for everyone.
Deletes a message for everyone.
(edit-message c msg-id text)Edits a sent text (WhatsApp allows about 15 minutes).
Edits a sent text (WhatsApp allows about 15 minutes).
(group-metadata c group-id)One group's details; group-id ends in @g.us.
One group's details; group-id ends in @g.us.
(json->clj e)Turns a Gson JsonElement into Clojure data.
Turns a Gson JsonElement into Clojure data.
(list-contacts c)Contacts of your number.
Contacts of your number.
(list-groups c)Groups your number is in.
Groups your number is in.
(message-info c msg-id)Status of a sent message: queued, sent, delivered, read, played or failed.
Status of a sent message: queued, sent, delivered, read, played or failed.
(on-whatsapp? c phone)Does this number have WhatsApp? Returns the API answer, e.g. {:exists true …}.
Does this number have WhatsApp? Returns the API answer, e.g. {:exists true …}.
(request c method path & [body])Any other API call: (request wa :get "/user").
Any other API call: (request wa :get "/user").
(resend-message c msg-id)Sends a failed message again.
Sends a failed message again.
(save-contact c phone contact-name)Saves a contact name.
Saves a contact name.
(send-document c to document-url & [file-name caption])Document from a public URL, with an optional file name and caption.
Document from a public URL, with an optional file name and caption.
(send-image c to image-url & [caption])Image from a public URL, with an optional caption.
Image from a public URL, with an optional caption.
(send-message c to fields)Sends any message type to a number or a group ID (…@g.us). Field names follow the API: :text :imageUrl :videoUrl :audioUrl :documentUrl :fileName :location :poll :replyTo :mentions …
(send-message wa "+250788123456" {:location {:latitude -1.9441 :longitude 30.0619 :name "Our shop"}})
Sends any message type to a number or a group ID (…@g.us). Field names follow the API:
:text :imageUrl :videoUrl :audioUrl :documentUrl :fileName :location :poll :replyTo :mentions …
(send-message wa "+250788123456" {:location {:latitude -1.9441 :longitude 30.0619 :name "Our shop"}})(send-text c to text)(send-text wa "+250788123456" "Your order has shipped")
(send-text wa "+250788123456" "Your order has shipped")
(status c)Connection status of your number.
Connection status of your number.
(verify-webhook signature secret)Checks the X-Webhook-Signature header of a webhook call against your number's webhook secret.
Checks the X-Webhook-Signature header of a webhook call against your number's webhook secret.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |