---
title: "SDKs, OpenAPI spec and code samples"
description: "Use the TypeScript SDK, import the OpenAPI 3.1 spec into Postman or Insomnia, generate clients, and call the API from Java, .NET, Go and Ruby."
canonical: "https://omnichannels.ai/developers/sdks/"
language: "en"
updated: "2026-10-10"
publisher: "BroadNet Technologies"
brand: "OmniChannels.ai"
section: "Tools"
---

# SDKs, OpenAPI spec and code samples

Canonical: https://omnichannels.ai/developers/sdks/
Language: en
Publisher: OmniChannels.ai by BroadNet Technologies

There is one official SDK, for TypeScript and Node.js, generated from the OpenAPI specification. For every other language, call the REST API with your usual HTTP client (samples below) or generate a client from the spec.

## TypeScript SDK

`@broadnet/cpaas-sdk` is published on npm. It ships CommonJS and ES modules with full type definitions, has one API class per channel area, and uses axios as its only runtime dependency.

```bash title="npm"
npm install @broadnet/cpaas-sdk axios
```

Requires Node.js 18 or later. Pin the exact version in `package.json` and upgrade deliberately: a new major version can change generated method names or types.

### Send an SMS

```ts title="TypeScript"
import { Configuration, SMSSMSApi } from "@broadnet/cpaas-sdk";

const config = new Configuration({
  basePath: "https://api.broadnet.me",
  accessToken: process.env.BROADNET_TOKEN!,
});

const sms = new SMSSMSApi(config);

const res = await sms.smsSendsmsPost({
  sMSSmsRequest: {
    senderId: "OmniDemo",
    destinationNumber: "447700900123",
    message: "Your OmniDemo code is 482913",
    messageType: "TEXT",
  },
});

console.log(res.data); // message ID
```

### Send a WhatsApp message

```ts title="TypeScript"
import { Configuration, WhatsAppWhatsAppMessagingAPIApi } from "@broadnet/cpaas-sdk";

const wa = new WhatsAppWhatsAppMessagingAPIApi(
  new Configuration({
    basePath: "https://api.broadnet.me",
    accessToken: process.env.BROADNET_TOKEN!,
  }),
);

const res = await wa.whatsappMessageSendbulkPost({
  campaignName: "order-updates",
  messageType: "TEXT",
  destinationNo: "971500000000",
  content: "Your order has shipped.",
});

console.log(res.data); // batchId and per-file acceptance counts
```

Class and method names are generated from the spec's tags and paths, following the pattern above (`SMSSMSApi.smsSendsmsPost` for `POST /sms/sendSms`). Your editor's autocomplete, or the SDK's type definitions, list the classes for the other channels.

Errors surface as axios errors: read `err.response.status` and `err.response.data` and apply the rules in [Errors and limits](/developers/errors-and-limits/).

## OpenAPI 3.1 specification

The API is described in an OpenAPI 3.1 document, published at [/developers/openapi.json](/developers/openapi.json) and [/developers/openapi.yaml](/developers/openapi.yaml). It covers every operation a customer token can call across SMS, WhatsApp, RCS, Messenger, Instagram, Telegram, Email and Push; operator-only operations and the legacy `/websmpp` HTTP API are left out.

The spec states the base URL (`https://api.broadnet.me`) and the Bearer authentication scheme, and documents the request fields and examples for every operation. The [OpenAPI spec page](/developers/openapi/) covers importing it, generating clients and using it with AI coding tools.

### Import into Postman or Insomnia

1. In Postman, choose **Import** and select the spec file. Insomnia: **Import** then **From file**.
2. Set a collection variable `baseUrl` to `https://api.broadnet.me` if the tool did not pick it up.
3. Set the collection's authorization to **Bearer Token** and use a variable, for example `{{token}}`, for your token.
4. Send `POST /sms/identify` first: it is harmless and confirms that authentication works.

### Generate a client

Use OpenAPI Generator to build a client in your language:

```bash title="Generate clients"
# Python
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g python -o omni-python

# Go
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g go -o omni-go

# Java
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g java -o omni-java
```

Generated clients are a starting point. Review the generated multipart handling for the channel send endpoints, and keep your own wrapper around the calls you use so that regenerating the client does not ripple through your code.

### Track changes

API paths carry no version prefix. To follow changes:

- diff the spec between the versions you receive (`info.version` records the version);
- pin the SDK version and read its release notes before upgrading;
- write tolerant clients that ignore unknown JSON fields and do not assume a closed list of statuses.

## Plain HTTP samples

Every sample sends one SMS with `POST /sms/sendSms` and prints the status and message ID. None needs a vendor library.

```java title="Java"
// Java 17+: java.net.http is built in; text blocks need Java 15+
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class SendSms {
    public static void main(String[] args) throws Exception {
        String json = """
            {"senderId":"OmniDemo","destinationNumber":"447700900123",
             "message":"Your OmniDemo code is 482913","messageType":"TEXT"}
            """;
        HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.broadnet.me/sms/sendSms"))
            .header("Authorization", "Bearer " + System.getenv("BROADNET_TOKEN"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();
        HttpResponse<String> res = HttpClient.newHttpClient()
            .send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.statusCode() + " " + res.body());
    }
}
```

```csharp title=".NET"
// .NET 6+ console app: HttpClient is built in
using System.Net.Http.Headers;
using System.Net.Http.Json;

using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("BROADNET_TOKEN"));

var res = await http.PostAsJsonAsync("https://api.broadnet.me/sms/sendSms", new
{
    senderId = "OmniDemo",
    destinationNumber = "447700900123",
    message = "Your OmniDemo code is 482913",
    messageType = "TEXT",
});
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");
```

```go title="Go"
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	body := []byte(`{"senderId":"OmniDemo","destinationNumber":"447700900123",
		"message":"Your OmniDemo code is 482913","messageType":"TEXT"}`)

	req, err := http.NewRequest(http.MethodPost, "https://api.broadnet.me/sms/sendSms", bytes.NewReader(body))
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("BROADNET_TOKEN"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	id, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(id))
}
```

```ruby title="Ruby"
require "net/http"
require "json"

uri = URI("https://api.broadnet.me/sms/sendSms")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch('BROADNET_TOKEN')}"
req["Content-Type"] = "application/json"
req.body = {
  senderId: "OmniDemo",
  destinationNumber: "447700900123",
  message: "Your OmniDemo code is 482913",
  messageType: "TEXT"
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts "#{res.code} #{res.body}"
```

cURL, Node.js, Python and PHP versions are in the [Quickstart](/developers/quickstart/).

## Next steps

- [Quickstart](/developers/quickstart/): your first message end to end.
- [OpenAPI spec](/developers/openapi/): import, generate and use the spec with AI tools.
- [MCP server](/developers/mcp/): give AI agents the same API as tools.
- [Errors and limits](/developers/errors-and-limits/): retries and rate limits for any client.
