Page 1 of 2
Telegram Messenger
Posted: Mon Oct 23, 2017 1:38 pm
by unixkd
Hi ALL
Telegram Messenger is like whatsapp but with a comprehensive API. Has anybody integrate it to his/her application?
Thanks
Joe
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 12:16 am
by c-tec
Hello,
look at Pushbullet, works great and easy to implement, have most of the API functions in Xbase
regards
Rudolf
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 1:30 am
by unixkd
Thank you Rudolf
Can you please send me a sample code of how you implemented it in your application.
Thanks.
Joe
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 2:35 am
by c-tec
Hello Joe,
you find the docs at
https://docs.pushbullet.com/
Attached a sample, I would use Chilkat instead of OT4XB because it has much more possibilities, especially for json parsing. Have also for this code, but must bevore extract from other things. But you can see that is not so complicated.
regards
Rudolf
Code: Select all
function pushb_getdevices()
******************************************************************
local cUrl := "https://api.pushbullet.com/v2/devices"
local aVars := {}
local cToken := dcc_iniread("FORMCOMMANDER.INI","PUSHBULLET","TESTTOKEN"),xRet
local oHttp := TServerXMLHTTPRequest():New()
aadd(aVars,"active")
aadd(aVars,"app_version")
aadd(aVars,"created")
aadd(aVars,"iden")
aadd(aVars,"manufacturer")
aadd(aVars,"model")
aadd(aVars,"modified")
aadd(aVars,"nickname")
aadd(aVars,"push_token")
xRet := oHttp:Open( "GET" , cUrl , .F.)
xRet := oHttp:lIgnoreCertAll := .T.
xRet := oHttp:SetRequestHeader( "Access-Token", cToken )
xRet := oHttp:Send()
cc := oHttp:responseText
dcqdebug oHttp:status
oHttp:Release()
dcqdebug cc
prot("getdevices:" + CRLF + cc + CRLF,PUSHBULLETLOG)
prot("pretty:" + CRLF + json_pretty_out(cc) + CRLF,PUSHBULLETLOG)
aTmp := jsonreadblock(json_pretty_out(cc),,aVars)
//dc_arrayview(aTmp)
return .t.
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 3:01 am
by unixkd
Thanks Rudolf
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 4:27 am
by c-tec
Hello Joe,
the json functions I can send you if needed.
regards
Rudolf
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 6:18 am
by bwolfsohn
pushbullet looks interesting....
I'm wondering how you use it in your application...
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 9:01 am
by c-tec
Hello Brian,
I use it in my digital pen & paper and CRM software for some workflows to inform user about events and documents. The nice thing is that it also has addons for browser. Actually I have problems to send files, but should be no problem also.
regards
Rudolf
Re: Telegram Messenger
Posted: Tue Oct 24, 2017 2:19 pm
by unixkd
Great.
Pls send the json functions.
Joe
Re: Telegram Messenger
Posted: Wed Oct 25, 2017 1:25 am
by c-tec
Hello Joe,
sent you a pm
regards
Rudolf