Issue in http request

Hi team

I am facing issue in http request

I am trying to send message via telegram api.

But i am facing an issue like unauthorized like 401 etc.

The code used here is

                           Create session  telegram  https://api.telegram.org/bot${token}/sendMessage?

${resp}=  Get Request  telegram   chat_id=${chat_id}&text=${result}

But i am getting issue like 401 which implies unauthorized

Why so

Please help @osrjv @Teppo

Regards

Nived N

Hi,

I guess the problem is with the how you call Create Session… it should contain request base url, but your url contains lot more stuff.

try with this

Create session  telegram  https://api.telegram.org
${resp}=  Get Request  telegram   /bot${token}/sendMessage?chat_id=${chat_id}&text=${result}
1 Like

Hi @mika

Thanks for your response

Why we are creating an session

Can u explain it please?

Hi @mika
I am facing the same issue again

If you only want to send notification to telegram, there is also a specific library for it:

the sendMessage request you are trying to make is a POST request, not GET

${resp}= Post Request telegram /bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}&text=${MESSAGE}