How to send automatic notification for new message?

I need to create web based chat application with 1-1 and group chat.
For that we have selected rocket chat and I am looking at rest api doc
https://rocket.chat/docs/developer-guides/rest-api/

But here I am not sure what i can use for sending push notification to browser(Better i say listen to new incoming message) as I have web based application when there is new message.

Or should I use https://rocket.chat/docs/developer-guides/realtime-api for such function?

The Real-Time API provides a stream of everything that is happening on a server.

I made a small/quick example of how to connect to the stream that might help you get started - GitHub - JSzaszvari/rocketchat-ddp-listener: Subscribes and listens to the Real Time stream of all messages happening in a Rocket.Chat Channel/Room

sending push notification to browser

I’m not sure what you mean by this, if you have notifications turned on, you will also get browser notifications if the browser supports it.

hey thanks for your reply, I am totally newbie to rocketchat.

Let me make an example,
I need to make realtime chat in asp.net web application, planning to use rocket chat.
If I use an API send message to user A then with which API I can display message to user A automatically?
Can I this ddp listener use with jQuery/Javascript client side?

Yes basically you’d establish the connection and then subscribe to the event, and perform what ever logic you would like with the received message.