Telegram Hook API

Build Telegram Hook to send push notifications into channels

Overview

Base Endpoint

For Telegram Hook API, the format of your endpoint ⤵️

https://v1.nocodeapi.com/<username>/telegram/<token>

- username- your nocodeapi username.

- token- every api have unique token. See your API card when you setup API.

API Error Codes:

If your query fails, API will return a 3-digit error-code and info as plain text

Error response example: If you provide a invalid key or do not send one, you will be responded with Unauthorised Access in below format.

{
    "error": 1,
    "code": 401,
    "info": "Unauthorized"
}

Common API Errors:

Code Info [affected API endpoints]
200 (OK)Standard response for successful GET, POST, UPDATE & DELETE
400 (Bad Request)Error response when creating (POST) or updating (UPDATE, DELETE).
401 (Unauthorized)Error response when wrong or invalid API key
402 (Payment Required)Returned if pro feature is tried to be accessed from free account
403 (Forbidden)Error response when action is forbidden by the user (API owner)
404 (No such route) Route is not valid or query params is in-valid.
429 (Rate limit exceeded)Your API request limit exceeded per month.
500 (Server error)Server error

API Endpoints

Send Object Data

Make the POST request on below endpoint with object in body to send data into chat.

https://v1.nocodeapi.com/<username>/telegram/<token>

[Required] body object format ⤵️

{
    "email": "hello@nocodeapi.com",
    "notification": "payment",
    "source": "nocodeapi.com"
}

- Code Examples

const axios = require('axios');
    
axios({
    method: 'post',
    url: 'https://v1.nocodeapi.com/<username>/telegram/<token>', 
    data: {"email":"hello@nocodeapi.com","notification":"payment","source":"nocodeapi.com"}
}).then(function (response) {
        // handle success
        console.log(response);
}).catch(function (error) {
        // handle error
        console.log(error);
})

Send Text

Make the POST request on below endpoint with text in body to send into chat.

https://v1.nocodeapi.com/<username>/telegram/<token>/sendText?text=hello

- Request Parameters:

ObjectDescription
text[Required] text that you want to send into channel

- Code Examples

const axios = require('axios');
    
axios({
    method: 'post',
    url: 'https://v1.nocodeapi.com/<username>/telegram/<token>/sendText', 
    params: {text: 'hello'},
}).then(function (response) {
        // handle success
        console.log(response);
}).catch(function (error) {
        // handle error
        console.log(error);
})