Documentation Index
Fetch the complete documentation index at: https://orbit-docs.devotel.io/llms.txt
Use this file to discover all available pages before exploring further.
Go SDK
The official Orbit Go SDK provides an idiomatic Go client for the Orbit API with context support, structured errors, and automatic retries.
Installation
go get github.com/devotel/orbit-go
Quick Start
package main
import (
"fmt"
"log"
devotel "github.com/devotel/orbit-go"
)
func main() {
client := devotel.New("dv_live_sk_your_key_here")
// Argument order matches the REST URL shape `/messages/<channel>`
// and the other-language SDK signatures (Python: channel=, to=, body=;
// Node: { channel, to, body }) so multi-language teams stay consistent.
message, err := client.Messages.Send("sms", "+14155552671", "Hello from Orbit!")
if err != nil {
log.Fatal(err)
}
fmt.Println(message["data"]) // msg_abc123
}
Messaging
// Send WhatsApp message
waMessage, err := client.Messages.SendWhatsApp("+14155552671", "Hello from Orbit on WhatsApp!")
if err != nil {
log.Fatal(err)
}
// Send Email
email, err := client.Messages.SendEmail("user@example.com", "Welcome!", "<h1>Welcome to Acme</h1>")
if err != nil {
log.Fatal(err)
}
Voice
// Make an outbound call
call, err := client.Voice.CreateCall("+14155552671", "+18005551234")
if err != nil {
log.Fatal(err)
}
// Retrieve call details
callDetails, err := client.Voice.GetCall(call["data"].(map[string]any)["id"].(string))
if err != nil {
log.Fatal(err)
}
Verify
// Send OTP
verification, err := client.Verify.Send("+14155552671", "sms")
if err != nil {
log.Fatal(err)
}
// Check OTP
result, err := client.Verify.Check(
verification["data"].(map[string]any)["verification_id"].(string),
"482901",
)
if err != nil {
log.Fatal(err)
}
fmt.Println(result["data"]) // "approved"
Webhooks
import "github.com/devotel/orbit-go/webhook"
func handleWebhook(w http.ResponseWriter, r *http.Request) {
payload, err := io.ReadAll(r.Body)
if err != nil {
http.Error(w, "Bad request", http.StatusBadRequest)
return
}
signature := r.Header.Get("X-Devotel-Signature")
if !webhook.Verify(payload, signature, "whsec_your_secret") {
http.Error(w, "Invalid signature", http.StatusUnauthorized)
return
}
event, err := webhook.ParseEvent(payload)
if err != nil {
http.Error(w, "Bad payload", http.StatusBadRequest)
return
}
switch event.Type {
case "message.delivered":
// Handle delivery
case "call.completed":
// Handle call
}
w.WriteHeader(http.StatusOK)
w.Write([]byte(`{"received": true}`))
}
Error Handling
_, err := client.Messages.Send("sms", "invalid", "Hi")
if err != nil {
var orbitErr *devotel.OrbitError
if errors.As(err, &orbitErr) {
fmt.Println(orbitErr.Code) // "INVALID_PHONE_NUMBER"
fmt.Println(orbitErr.StatusCode) // 422
fmt.Println(orbitErr.Message) // "The to field must be a valid E.164 phone number"
}
}
Configuration
client := devotel.New("dv_live_sk_your_key_here",
devotel.WithBaseURL("https://orbit-api.devotel.io/api/v1"),
)
| Option | Type | Default | Description |
|---|
WithBaseURL | string | https://orbit-api.devotel.io/api/v1 | API base URL |
Requirements