Your question is how to get challan number in case you paid tax online, there are two way by which you can get challan number of tax payments online.
1. first way when you would have paid your tax then you would have open your bank account i.e. from which bank you would have paid your tax. So go to your bank online and login with id and password and search that transaction and get receipt of the same accordingly identify the challan number.
2. it is a best way but it is little bit lengthy as per the first way.
In this way you have to login in income tax department with your pan number after that you have to go in form 26 AS page and select Assessment Year for example if you want to see challan number of AY 2017-18, select the same Assessment Year. After that scroll down the mouse and you will find details of tax paid just click on it and you will find all things related with your tax payment.
i.e. challan number, BSR Code, Date of Tax Deposit, Amount of Tax Deposit.