Manual send
This endpoint send code to provided channel.
Alert
This request must be sent from the server side only.
Secret key
You must add the x-api-key: your-secret from the admin panel settings to the headers
Endpoint
POST https://api.kod.mobi/manual/send
Request
ManualSendRequest
| Param |
Type |
Description |
Required |
| to |
phone (E.164) | email |
Mobile phone number in international format or email address |
true |
| channel |
Channel |
Channel type |
true |
| provider_id |
number |
Provider ID |
false |
| code |
string-number | length:4,6 |
User code |
false |
| callback_url |
string | url |
Callback url to send finished status |
false |
Response
ManualSendResponse
| Param |
Type |
Description |
| message |
string |
Information message |
| code |
string | encryption:aes256 |
An encrypted code |
| message_id |
number |
Message ID |
Example
| curl --location 'https://api.kod.mobi/manual/send' \
--header 'x-api-key: <replace me>' \
--data-raw '{
"to": "<replace me>",
"channel": "email",
"provider_id": 1,
"code": "0000",
"callback_url": "<replace me>"
}'
|
| const headers = new Headers();
headers.append('x-api-key', '<replace me>');
const raw = JSON.stringify({
"to": "<replace me>",
"channel": "email",
"provider_id": 1,
"code": "0000",
"callback_url": "<replace me>"
});
const requestOptions: RequestInit = {
method: 'POST',
headers,
body: raw,
redirect: 'follow',
};
fetch(
'https://api.kod.mobi/manual/send',
requestOptions,
)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.error(error));
|
| <?php
$client = new \GuzzleHttp\Client();
$headers = [
'x-api-key' => '<replace me>'
];
$body = '{
"to": "<replace me>",
"channel": "email",
"provider_id": 1,
"code": "0000",
"callback_url": "<replace me>"
}';
$request = new Request('POST', 'https://api.kod.mobi/manual/send', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
|
| package main
import (
"fmt"
"io"
"net/http"
)
func main() {
payload := strings.NewReader(`{
"to": "<replace me>",
"channel": "email",
"provider_id": 1,
"code": "0000",
"callback_url": "<replace me>"
}`)
client := &http.Client{}
req, err := http.NewRequest("POST", "https://api.kod.mobi/manual/send", payload)
if err != nil {
panic(err)
}
req.Header.Add("x-api-key", "<replace me>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
|
| #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let data = r#"{
"to": "<replace me>",
"channel": "email",
"provider_id": 1,
"code": "0000",
"callback_url": "<replace me>"
}"#;
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "<replace me>".into());
let request = client.request(reqwest::Method::POST, "https://api.kod.mobi/manual/send")
.headers(headers);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
|
Example output
{
"message": "Sent to queue.",
"code": "aes256:8fd2a47c91e5b04f3a2cd99b8c1e77d5:da4b66f38c1a2799e0851dcbf4a62a3f:58327419",
"message_id": 1
}