Go
package main import ( "context" "fmt" "log" "github.com/AhaSend/ahasend-go/api" "github.com/google/uuid" ) func main() { // Create API client with authentication client := api.NewAPIClient( api.WithAPIKey("aha-sk-your-64-character-key"), ) accountID := uuid.New() // Create context for the API call ctx := context.Background() response, httpResp, err := client.MessagesAPI.CancelMessage( ctx, accountID, "<[email protected]>", ) if err != nil { log.Fatalf("Error canceling message: %v", err) } // Check response if httpResp.StatusCode == 200 { fmt.Printf("✅ Successfully canceled! Status: %d\n", httpResp.StatusCode) if response != nil { fmt.Printf("Message canceled: %s\n", response.Message) } } else { fmt.Printf("❌ Unexpected status code: %d\n", httpResp.StatusCode) } }
{ "message": "Operation completed successfully" }
Cancels a scheduled message
API key for authentication
Account ID
Message API ID (the same ID returned by Create Message API)
Scheduled message is cancelled
Success message