> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.iot.telia.lt/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.iot.telia.lt/_mcp/server.

# Send SMS to an endpoint

POST https://iot.telia.lt/api/v1/endpoint/{endpoint_id}/sms
Content-Type: application/json

Sends a mobile terminating SMS (MT-SMS) to a connected device.
The device must have an active SIM with SMS capability enabled in its service profile.

## Use cases

### Standard SMS

Send an SMS with a numeric sender ID.
Set `source_address` to the sender's phone number (for example, `12345689`) and include your message in `payload`.

### Alphanumeric sender ID

Display a custom sender name instead of a phone number.
Set `source_address` to your brand name (for example, `CompanyName`, up to 11 characters) and include `source_address_type` with `id: 208`.

Alphanumeric sender IDs are one-way only.
Recipients can't reply directly to these messages.

### Person-to-Application (P2A) SMS

Receive SMS responses at your server.
Set `dest_address` with a callback identifier.
The platform forwards incoming messages to the API callback URL configured in your service profile.

### Concatenated SMS

Send messages longer than 160 characters by splitting them across multiple API calls.
Each call requires a `udh` (User Data Header) that identifies the message sequence.

The UDH format `050003XXYYZZ` contains:

* `XX`: Unique message reference (for example, `CC`)
* `YY`: Total number of parts (for example, `02` for 2 parts)
* `ZZ`: Current part number (for example, `01` for part 1)

For more information, see the [3GPP TS 23.040 specification](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=747).

Reference: https://docs.iot.telia.lt/developers/api/endpoint/endpoint-sms-by-id-post

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `endpoint_id` (integer, required) — Numeric ID of an endpoint

### Body (application/json)

This endpoint expects an object.

- `payload` (string, required) — The SMS message content. Must be UTF-8 encoded. Maximum 160 characters for a single SMS, or use `udh` for longer messages.
- `source_address` (string, optional) — The sender identifier displayed on the recipient's device. Can be an MSISDN (phone number), short code, or alphanumeric string. Alphanumeric strings are limited to 11 characters per GSM specifications.
- `source_address_type` (ApiV1EndpointEndpointIdSmsPostRequestBodyContentApplicationJsonSchemaSourceAddressType, optional) — Defines the format of `source_address`. Required when using alphanumeric sender IDs.
- `dest_address` (string, optional) — The callback identifier for Person-to-Application (P2A) SMS. When set, incoming SMS responses are forwarded to the API callback URL configured in your service profile.
- `udh` (string, optional) — User Data Header for concatenated SMS. Encoded as a hexadecimal string following 3GPP TS 23.040. For example, `050003CC0201` indicates message 1 of 2 in sequence `CC`.
- `dcs` (integer, optional) — Data Coding Scheme per 3GPP TS 23.038. Controls character encoding (for example, `0` for GSM 7-bit default alphabet, `8` for UCS2/UTF-16).
- `expiry_date` (string, optional) — The deadline for delivery attempts. If the SMS can't be delivered by this time, it's discarded. ISO 8601 format.

## Response

### 201

Resource Created

## Errors

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

## Types

### ApiV1EndpointEndpointIdSmsPostRequestBodyContentApplicationJsonSchemaSourceAddressType

Defines the format of `source_address`. Required when using alphanumeric sender IDs.

- `id` (integer, optional) — The source address format: - `145`: International number format (E.164) - `161`: National number format - `208`: Alphanumeric string (for example, "CompanyName")

## Examples

### Standard SMS

**Request**

```json
{
  "payload": "This is the message text",
  "source_address": "12345689"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Standard SMS
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/sms"

payload = {
    "payload": "This is the message text",
    "source_address": "12345689"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Standard SMS
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":"This is the message text","source_address":"12345689"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Standard SMS
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/sms"

	payload := strings.NewReader("{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"12345689\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Standard SMS
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"12345689\"\n}"

response = http.request(request)
puts response.read_body
```

```java Standard SMS
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/endpoint/12345/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"12345689\"\n}")
  .asString();
```

```php Standard SMS
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/endpoint/12345/sms', [
  'body' => '{
  "payload": "This is the message text",
  "source_address": "12345689"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Standard SMS
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"12345689\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard SMS
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payload": "This is the message text",
  "source_address": "12345689"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Alphanumeric sender ID

**Request**

```json
{
  "payload": "This is the message text",
  "source_address": "Sender Name",
  "source_address_type": {
    "id": 208
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python Alphanumeric sender ID
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/sms"

payload = {
    "payload": "This is the message text",
    "source_address": "Sender Name",
    "source_address_type": { "id": 208 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Alphanumeric sender ID
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":"This is the message text","source_address":"Sender Name","source_address_type":{"id":208}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Alphanumeric sender ID
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/sms"

	payload := strings.NewReader("{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"Sender Name\",\n  \"source_address_type\": {\n    \"id\": 208\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Alphanumeric sender ID
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"Sender Name\",\n  \"source_address_type\": {\n    \"id\": 208\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Alphanumeric sender ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/endpoint/12345/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"Sender Name\",\n  \"source_address_type\": {\n    \"id\": 208\n  }\n}")
  .asString();
```

```php Alphanumeric sender ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/endpoint/12345/sms', [
  'body' => '{
  "payload": "This is the message text",
  "source_address": "Sender Name",
  "source_address_type": {
    "id": 208
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Alphanumeric sender ID
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": \"This is the message text\",\n  \"source_address\": \"Sender Name\",\n  \"source_address_type\": {\n    \"id\": 208\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Alphanumeric sender ID
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payload": "This is the message text",
  "source_address": "Sender Name",
  "source_address_type": ["id": 208]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### P2A callback

**Request**

```json
{
  "payload": "An example payload sent to my server",
  "dest_address": "1111111"
}
```

**Response**

```json
{}
```

**SDK Code**

```python P2A callback
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/sms"

payload = {
    "payload": "An example payload sent to my server",
    "dest_address": "1111111"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript P2A callback
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":"An example payload sent to my server","dest_address":"1111111"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go P2A callback
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/sms"

	payload := strings.NewReader("{\n  \"payload\": \"An example payload sent to my server\",\n  \"dest_address\": \"1111111\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby P2A callback
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": \"An example payload sent to my server\",\n  \"dest_address\": \"1111111\"\n}"

response = http.request(request)
puts response.read_body
```

```java P2A callback
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/endpoint/12345/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": \"An example payload sent to my server\",\n  \"dest_address\": \"1111111\"\n}")
  .asString();
```

```php P2A callback
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/endpoint/12345/sms', [
  'body' => '{
  "payload": "An example payload sent to my server",
  "dest_address": "1111111"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp P2A callback
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": \"An example payload sent to my server\",\n  \"dest_address\": \"1111111\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift P2A callback
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payload": "An example payload sent to my server",
  "dest_address": "1111111"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Concatenated SMS (part 1 of 2)

**Request**

```json
{
  "payload": "First part of the SMS...",
  "udh": "050003CC0201"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Concatenated SMS (part 1 of 2)
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/sms"

payload = {
    "payload": "First part of the SMS...",
    "udh": "050003CC0201"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Concatenated SMS (part 1 of 2)
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":"First part of the SMS...","udh":"050003CC0201"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Concatenated SMS (part 1 of 2)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/sms"

	payload := strings.NewReader("{\n  \"payload\": \"First part of the SMS...\",\n  \"udh\": \"050003CC0201\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Concatenated SMS (part 1 of 2)
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": \"First part of the SMS...\",\n  \"udh\": \"050003CC0201\"\n}"

response = http.request(request)
puts response.read_body
```

```java Concatenated SMS (part 1 of 2)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/endpoint/12345/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": \"First part of the SMS...\",\n  \"udh\": \"050003CC0201\"\n}")
  .asString();
```

```php Concatenated SMS (part 1 of 2)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/endpoint/12345/sms', [
  'body' => '{
  "payload": "First part of the SMS...",
  "udh": "050003CC0201"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Concatenated SMS (part 1 of 2)
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": \"First part of the SMS...\",\n  \"udh\": \"050003CC0201\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Concatenated SMS (part 1 of 2)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payload": "First part of the SMS...",
  "udh": "050003CC0201"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Concatenated SMS (part 2 of 2)

**Request**

```json
{
  "payload": "Second part of the SMS...",
  "udh": "050003CC0202"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Concatenated SMS (part 2 of 2)
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/sms"

payload = {
    "payload": "Second part of the SMS...",
    "udh": "050003CC0202"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Concatenated SMS (part 2 of 2)
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payload":"Second part of the SMS...","udh":"050003CC0202"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Concatenated SMS (part 2 of 2)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/sms"

	payload := strings.NewReader("{\n  \"payload\": \"Second part of the SMS...\",\n  \"udh\": \"050003CC0202\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Concatenated SMS (part 2 of 2)
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payload\": \"Second part of the SMS...\",\n  \"udh\": \"050003CC0202\"\n}"

response = http.request(request)
puts response.read_body
```

```java Concatenated SMS (part 2 of 2)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/endpoint/12345/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payload\": \"Second part of the SMS...\",\n  \"udh\": \"050003CC0202\"\n}")
  .asString();
```

```php Concatenated SMS (part 2 of 2)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/endpoint/12345/sms', [
  'body' => '{
  "payload": "Second part of the SMS...",
  "udh": "050003CC0202"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Concatenated SMS (part 2 of 2)
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payload\": \"Second part of the SMS...\",\n  \"udh\": \"050003CC0202\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Concatenated SMS (part 2 of 2)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payload": "Second part of the SMS...",
  "udh": "050003CC0202"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```