API


The following API endpoints can be used to programmatically retrieve frequently asked questions, reviews, issues and issue comments.

To use them, you must have a valid API token provided by us. We give this token automatically to all creators (content owners) who have at least one content they proved their ownership for on Telegramic. If you are a creator, you can find your API token on this page.

Let's say your API token is bxcb33f7945ce1fbfea0fc625xid8a377a6acac. You should add that API token into the HTTP header named 'Authorization' like this: 'Authorization: Telegramic bxcb33f7945ce1fbfea0fc625xid8a377a6acac'. The string "Telegramic" is a keyword we use for the API v1.

Basic Examples:

HTTPie Example

Here's an example with the HTTPie command-line HTTP client. We'll retrieve the frequently asked questions for the official Telegramic channel:

http https://telegramic.org/api/v1/faqs/?username=tlgrmc 'Authorization: Telegramic bxcb33f7945ce1fbfea0fc625xid8a377a6acac'

Python "requests" Example

Another example written in Python programming language. Note: The "requests" library should be installed on your system.

from requests import get

url = 'https://telegramic.org/api/v1/faqs/?username=tlgrmc'
token = 'Telegramic bxcb33f7945ce1fbfea0fc625xid8a377a6acac'
headers = {
    'Authorization': token
}

results = get(url, headers=headers)
status_code = results.status_code

if status_code == 200:
    faqs = results.json()
    first = faqs['results'][0]

    print("Question: {question}\nAnswer: {answer}".format(
        question=first['question'],
        answer=first['answer']
    ))
else:
    print('ERR: {code}'.format(code=status_code))


# OUTPUT:
# Question: What is Telegramic?
# Answer: Telegramic is both a community for Telegram users and developers, and a Telegram directory containing bots, channels, groups, stickers, news, and so forth!

 

NOTE: The following API endpoints are rate limited: 100 requests / 1 hour window (creator auth) in total.

 

Frequently Asked Questions

Returns the 50 most recent frequently asked questions for the desired content.

Resource URL:
https://telegramic.org/api/v1/faqs/

Parameters for the Frequently Asked Questions
Name Required Description Default Value Example
username required The username of the desired content to get its frequently asked questions.   tlgrmc
offset optional The starting position of the query in relation to the complete set of unpaginated records. 0 100
limit optional The maximum number of records to return 0 50

 

Example URL:
GET https://telegramic.org/api/v1/faqs/?username=tlgrmc&limit=3

 

Example Response:
{
    "count": 6,
    "next": "https://telegramic.org/api/v1/faqs/?limit=3&offset=3&username=tlgrmc",
    "previous": null,
    "results": [
        {
            "answer": "Telegramic is both a community for Telegram users and developers, and a Telegram directory containing bots, channels, groups, stickers, news, and so forth!",
            "id": 34,
            "question": "What is Telegramic?"
        },
        {
            "answer": "No.",
            "id": 35,
            "question": "Is Telegramic affiliated with Telegram?"
        },
        {
            "answer": "Yes.",
            "id": 36,
            "question": "Is it free to use?"
        }
    ]
}

 

Reviews

Returns the 50 most recent rates & reviews for the desired content.

Resource URL:
https://telegramic.org/api/v1/reviews/

Parameters for the Reviews
Name Required Description Default Value Example
username required The username of the desired content to get its reviews.   tlgrmcbot
offset optional The starting position of the query in relation to the complete set of unpaginated records. 0 100
limit optional The maximum number of records to return 0 50

 

Example URL:
GET https://telegramic.org/api/v1/reviews/?username=tlgrmcbot&limit=3&offset=3

 

Example Response:
{
    "count": 6,
    "next": null,
    "previous": "https://telegramic.org/api/v1/reviews/?limit=3&username=tlgrmcbot",
    "results": [
        {
            "anonymous": false,
            "comment": "",
            "created": "2019-02-09T21:46:05.540991Z",
            "id": 457,
            "owner": "Berlín",
            "rate": "5.0",
            "url": "https://telegramic.org/bot/tlgrmcbot/reviews/457/"
        },
        {
            "anonymous": false,
            "comment": "",
            "created": "2019-01-07T23:43:21.913671Z",
            "id": 109,
            "owner": "【fxuls】",
            "rate": "5.0",
            "url": "https://telegramic.org/bot/tlgrmcbot/reviews/109/"
        },
        {
            "anonymous": false,
            "comment": "Easy to use. Too bad, there is no option for anyone to comment on posts.",
            "created": "2018-12-11T17:45:06.041636Z",
            "id": 55,
            "owner": "Admiral Awesome",
            "rate": "5.0",
            "url": "https://telegramic.org/bot/tlgrmcbot/reviews/55/"
        }
    ]
}

 

Issues

Returns the 50 most recent issues for the desired content.

Resource URL:
https://telegramic.org/api/v1/issues/

Parameters for the Issues
Name Required Description Default Value Example
username required The username of the desired content to get its Issues.   tlgrmc
offset optional The starting position of the query in relation to the complete set of unpaginated records. 0 100
limit optional The maximum number of records to return 0 50

 

Example URL:
GET https://telegramic.org/api/v1/issues/?username=tlgrmc&limit=2&offset=15

 

Example Response:
{
    "count": 28,
    "next": "https://telegramic.org/api/v1/issues/?limit=2&offset=17&username=tlgrmc",
    "previous": "https://telegramic.org/api/v1/issues/?limit=2&offset=13&username=tlgrmc",
    "results": [
        {
            "comments_count": 1,
            "content": "A user for his first review receives a bonification of +2 stars ⭐⭐, or +5 stars ⭐⭐⭐⭐⭐ if it includes a comment, but nothing else. However, I think that a user who previously earned +2 stars by rating with no comments should receive a bonification of +3 stars ⭐⭐⭐ next time he make a review with a comment.",
            "created": "2019-09-16T19:37:25.809443Z",
            "id": 48,
            "is_open": false,
            "owner": "nilox",
            "title": "Review with comment after review with no comment",
            "type": "Idea",
            "url": "https://telegramic.org/channel/tlgrmc/issues/48/"
        },
        {
            "comments_count": 4,
            "content": "I updated my telegram username (@xxxxxxxx) in the app and now I can't update it here.",
            "created": "2019-09-16T15:04:36.817279Z",
            "id": 46,
            "is_open": false,
            "owner": "nilox",
            "title": "Cannot update user name",
            "type": "Problem",
            "url": "https://telegramic.org/channel/tlgrmc/issues/46/"
        }
    ]
}

 

Issue Comments

Returns the 50 most recent issue comments for the desired issue.

Resource URL:
https://telegramic.org/api/v1/issues/comments/

Parameters for the Issue Comments
Name Required Description Default Value Example
id required The ID of the issue to return the comments of   48
offset optional The starting position of the query in relation to the complete set of unpaginated records. 0 100
limit optional The maximum number of records to return. 0 50

 

Example URL:
GET https://telegramic.org/api/v1/issues/comments/?id=48

 

Example Response:
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "content": "Oh thanks, we'll consider this for the next update!",
            "created": "2019-10-17T16:41:22.046840Z",
            "id": 28,
            "owner": "Telegramic Robot"
        }
    ]
}