đź’¬ Send SMS
Send SMS with Pingram without using Twilio or other third parties. Setup is quick and simple: here’s how.
Install the SDK:
npm install pingrampip install pingram-pythoncomposer require pingram/phpgo get github.com/pingram-io/pingram-godotnet add package PingramAdd the Pingram dependency to your pom.xml. Check Maven Central for the latest version.
<dependencies> <dependency> <groupId>io.pingram</groupId> <artifactId>pingram</artifactId> <version>0.1.0</version> </dependency></dependencies>gem install pingramOr add to your Gemfile: gem 'pingram'
Now, send an SMS notification from your backend:
TIP
Use your API key (pingram_sk_...). You can find it on the API Keys page
in the Pingram dashboard.
import { Pingram } from 'pingram';
// Initialize with API keyconst pingram = new Pingram({ apiKey: 'pingram_sk_...' // Your secret API key});
// Send SMS notificationawait pingram.sms.send({ type: 'welcome_sms', to: '+16175551212', // Replace using format [+][country code][area code][local number] message: 'Welcome to Acme Corp! Thanks for joining.'});import asynciofrom pingram import Pingramfrom pingram.models import SendSmsRequest
async def send_sms(): async with Pingram(api_key="pingram_sk_...") as client: await client.sms.sms_send( SendSmsRequest( type="welcome_sms", to="+16175551212", # Replace using format [+][country code][area code][local number] message="Welcome to Acme Corp! Thanks for joining.", ) )
# Run the async functionasyncio.run(send_sms())use Pingram\Client;use Pingram\Model\SendSmsRequest;
$client = new Client('pingram_sk_...');
$body = new SendSmsRequest([ 'type' => 'welcome_sms', 'to' => '+16175551212', // Replace using format [+][country code][area code][local number] 'message' => 'Welcome to Acme Corp! Thanks for joining.',]);$client->getSms()->smsSend($body);package main
import ( "context" "log"
pingram "github.com/pingram-io/pingram-go")
func main() { client := pingram.NewClient("pingram_sk_...") // Your secret API key
body := pingram.NewSendSmsRequest( "welcome_sms", "+16175551212", // Replace using format [+][country code][area code][local number] ) body.Message = pingram.PtrString("Welcome to Acme Corp! Thanks for joining.")
_, _, err := client.SmsAPI.SmsSend(context.Background()).SendSmsRequest(*body).Execute() if err != nil { log.Fatal(err) }}using Pingram;using Pingram.Model;
var client = new PingramClient("pingram_sk_...");var body = new SendSmsRequest( type: "welcome_sms", to: "+16175551212" // Replace using format [+][country code][area code][local number]){ Message = "Welcome to Acme Corp! Thanks for joining."};await client.SmsApi.SmsSendAsync(body);package com.example;
import io.pingram.Pingram;import io.pingram.model.*;
public class Example { public static void main(String[] args) { Pingram pingram = new Pingram("pingram_sk_..."); // Your secret API key
SendSmsRequest body = new SendSmsRequest() .type("welcome_sms") .to("+16175551212") // Replace using format [+][country code][area code][local number] .message("Welcome to Acme Corp! Thanks for joining.");
SendSmsResponse response = pingram.getSms().smsSend(body); System.out.println("Tracking ID: " + response.getTrackingId()); }}require 'pingram'
client = Pingram::Client.new(api_key: 'pingram_sk_...')body = Pingram::SendSmsRequest.new( type: 'welcome_sms', to: '+16175551212', # Replace using format [+][country code][area code][local number] message: 'Welcome to Acme Corp! Thanks for joining.')client.sms.sms_send(body)You’re All Set!
🎉 Congrats! You’re now sending SMS notifications!
For more advanced features like sender numbers, A2P 10DLC registration, and SMS best practices, check out our SMS documentation.