Categories: None [Edit]
one_msg_sdk
# 1MSG Ruby SDK
Official Ruby SDK for the **1MSG WhatsApp Business API**.
This document is generated from the public OpenAPI contract. It covers install,
auth, quick start, and every public operation available in the client.
| | |
|---|---|
| **RubyGems** | [`one_msg_sdk`](https://rubygems.org/gems/one_msg_sdk) |
| **Source** | [github.com/1msg/1msg-sdk/ruby](https://github.com/1msg/1msg-sdk/tree/main/ruby) |
| **API docs** | [docs.1msg.io](https://docs.1msg.io/) |
| **Platform** | [platform.1msg.io](https://platform.1msg.io/) |
| **Support** | [email protected] |
| **OpenAPI version** | 1.0.0 |
| **Operations** | 60 |
| **AI agent guide** | [AGENTS.md](./AGENTS.md) |
---
## Install
```bash
gem install one_msg_sdk -v 2.0.2
```
## Requirements
| Variable | Where to get it | Example |
|----------|-----------------|---------|
| `baseUrl` | Platform → channel → API host | `https://api.1msg.io` |
| `instanceId` | Platform → channel id | `ODI371267300` |
| `token` | Platform → channel → API token | JWT or API key |
Use environment variables (`MSG_API_TOKEN`, `MSG_INSTANCE_ID`). Never commit tokens.
## Quick start
```ruby
require 'one_msg_sdk'
OneMsgSdk.configure do |config|
config.host = "https://api.1msg.io/#{ENV.fetch('MSG_INSTANCE_ID')}"
end
messaging = OneMsgSdk::MessagingApi.new
messaging.send_message(
ENV.fetch('MSG_API_TOKEN'),
'Hello from 1MSG SDK',
nil,
'[email protected]'
)
```
## Authentication
All requests use query-token auth:
```text
https://{baseUrl}/{instanceId}/{path}?token={token}
```
Pass the channel token as the first argument to generated API methods.
## Recipient addressing
- `chatId`: `[email protected]` (1:1) or `[email protected]` (group)
- `phone`: country code + number, no `+`
- Exactly one of `chatId` | `phone` per request
## 24-hour messaging window
Free-form `sendMessage` only works inside the 24h customer-care window.
Outside that window use `sendTemplate`.
## Client map
```ruby
MessagingApi # send/list messages, media, interactive
ProfileApi # getMe
GroupsApi ...
Total
Ranking: 157,633 of 196,739
Downloads: 3,723
Daily
Ranking: 73,665 of 196,700
Downloads: 1
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
| Rank | Downloads | Name |
|---|
Depends on
| Rank | Downloads | Name |
|---|---|---|
| 17 | 1,252,668,281 | faraday |
| 29 | 1,017,300,652 | rspec |
| 106 | 482,581,320 | marcel |
| 129 | 394,784,283 | faraday-multipart |
Owners
| # | Gravatar | Handle |
|---|---|---|
| 1 | OneMsg |