make channel public, if it is private, take it's public name and use in the url. Make request, in response you'll get the id.
curl 'https://api.telegram.org/bot<bot-token>/sendMessage?chat_id=@<channel_name>&text=123'