PROGRADE-Tech / Tarchivebot

:page_with_curl: Telegram chat message archive and statistics
https://tarchive.neat.moe
GNU Affero General Public License v3.0
10 stars 4 forks source link

Implemented basic "Recent Messages" API #23

Closed fuerbringer closed 7 years ago

fuerbringer commented 7 years ago

Example API-Call

Curl POST request

curl -d 'key=84d56bf53f0f487b16cbc316b1a62482b48d72b364c3ebe472424e6c02d2dc96&amount=2' http://localhost:3000/api/recent

Example response

[ { id: 2,
    data: '/apikey',
    timestamp: 1492112504,
    chat_name: '123402866',
    user_name: 'sevfbr',
    message_type: 'private' },
  { id: 1,
    data: 'hello there',
    timestamp: 1492112502,
    chat_name: '123402866',
    user_name: 'sevfbr',
    message_type: 'private' } ]

Partly implements #14.