Skip to content

Manual channels

This endpoint returns project channels.

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

GET https://api.kod.mobi/manual/channels

Response

The Response will be an array of ManualChannel

ManualChannel

Param Type Description
name string Channel name
type Channel Channel type
providers array | []ManualProvider Channel providers

ManualProvider

Param Type Description
id number Provider id
name string Provider name
type Provider Provider type
is_system boolean System provider flag

Example

curl --location 'https://api.kod.mobi/manual/channels' \
  --header 'x-api-key: <replace me>'
const headers = new Headers();
headers.append('x-api-key', '<replace me>');

const requestOptions: RequestInit = {
  method: 'GET',
  headers,
  redirect: 'follow',
};

fetch(
  'https://api.kod.mobi/manual/channels',
  requestOptions,
)
  .then((response) => response.json())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
1
2
3
4
5
6
7
8
9
<?php

$client = new \GuzzleHttp\Client();
$headers = [
  'x-api-key' => '<replace me>'
];
$request = new Request('GET', 'https://api.kod.mobi/manual/channels', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
package main

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

func main() { 
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://api.kod.mobi/manual/channels", nil)

    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 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::GET, "https://api.kod.mobi/manual/channels")
        .headers(headers);

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}

Example output

[
  {
    "name": "Whatsapp",
    "type": "whatsapp",
    "providers": [
      {
        "id": 1,
        "type": "ultramsg",
        "is_system": true
      },
      {
        "id": 2,
        "type": "cloudapi",
        "is_system": false
      }
    ]
  },
  {
    "name": "Telegram",
    "type": "telegram",
    "providers": [
      {
        "id": 3,
        "type": "telegram_gateway",
        "is_system": false
      }
    ]
  },
  {
    "name": "SMS",
    "type": "sms",
    "providers": [
      {
        "id": 4,
        "type": "sms_c",
        "is_system": true
      },
      {
        "id": 5,
        "type": "sms_aero",
        "is_system": false
      }
    ]
  },
  {
    "name": "Email",
    "type": "email",
    "providers": [
      {
        "id": 6,
        "type": "postal",
        "is_system": true
      }
    ]
  }
]