Getting Started
Draft
This is a structural skeleton. Documentation content is authored separately as
Markdown/MDX — see docs/_templates/page-template.mdx.
Get from zero to a delivered SMS with a single API call. This guide covers creating an API key, installing an SDK and sending your first message.
Example
Send an SMS in your language of choice:
- cURL
- Node.js
- Python
- Java
- Kotlin
- PHP
- Go
- C#
curl https://api.msgly.live/v1/messages \
-H "Authorization: Bearer $MSGLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+48512345678",
"from": "Msgly",
"text": "Your Msgly code is 4921"
}'
import { Msgly } from '@msgly/sdk';
const msgly = new Msgly({ apiKey: process.env.MSGLY_API_KEY });
const message = await msgly.messages.send({
to: '+48512345678',
from: 'Msgly',
text: 'Your Msgly code is 4921',
});
console.log(message.id, message.status);
import os
from msgly import Msgly
client = Msgly(api_key=os.environ["MSGLY_API_KEY"])
message = client.messages.send(
to="+48512345678",
sender="Msgly",
text="Your Msgly code is 4921",
)
print(message.id, message.status)
import live.msgly.Msgly;
import live.msgly.model.Message;
Msgly msgly = Msgly.builder()
.apiKey(System.getenv("MSGLY_API_KEY"))
.build();
Message message = msgly.messages().send(
Message.request()
.to("+48512345678")
.from("Msgly")
.text("Your Msgly code is 4921")
.build());
System.out.println(message.id() + " " + message.status());
import live.msgly.Msgly
import live.msgly.model.MessageRequest
val msgly = Msgly(apiKey = System.getenv("MSGLY_API_KEY"))
val message = msgly.messages.send(
MessageRequest(
to = "+48512345678",
from = "Msgly",
text = "Your Msgly code is 4921",
),
)
println("${message.id} ${message.status}")
<?php
use Msgly\Client;
$msgly = new Client(getenv('MSGLY_API_KEY'));
$message = $msgly->messages->send([
'to' => '+48512345678',
'from' => 'Msgly',
'text' => 'Your Msgly code is 4921',
]);
echo $message->id, ' ', $message->status;
package main
import (
"context"
"fmt"
"os"
"gitlab.com/msgly/msgly-go"
)
func main() {
client := msgly.NewClient(os.Getenv("MSGLY_API_KEY"))
message, err := client.Messages.Send(context.Background(), &msgly.MessageRequest{
To: "+48512345678",
From: "Msgly",
Text: "Your Msgly code is 4921",
})
if err != nil {
panic(err)
}
fmt.Println(message.ID, message.Status)
}
using Msgly;
var client = new MsglyClient(Environment.GetEnvironmentVariable("MSGLY_API_KEY"));
var message = await client.Messages.SendAsync(new MessageRequest
{
To = "+48512345678",
From = "Msgly",
Text = "Your Msgly code is 4921",
});
Console.WriteLine($"{message.Id} {message.Status}");