I have BSNL FTTH connection, and I am unable to check data usage using their website. There is no working iOS app also. The app that works is on Android called BSNL FTTH Usage. I tried a few similar Android apps but found this one working. I don't use Android much. Also thought of analyzing the API call made by the app so that I don't have always rely on this app. Checked connecting it with Android Studio with Network view, but it does not show any data because it shows only for app that's under debugging. So got Charles Proxy installed. The devices must be connected to the BSNL network to check the usage as there is no additional authentication to get the data.

  1. In Charles, under Proxy > SSL Proxying Settings add *.* for Location under the Include section.

SSL Proxing

  1. Connect Android phone to the same WiFi network as the mac. Then on the phone go to WiFi Settings, select the settings for the WiFi connection. Under Proxy select Manual and enter Hostname as the IP address of the mac. To find the IP address of the mac Option click on the WiFi icon on the menu bar. Mine is 192.168.1.6. For Port use 8888 which is the default port Charles Proxy is listening on and tap Save. Then open browser on Android and load any website. On mac, a popup will be displayed asking to allow the proxying. Click Allow.

  2. Next go to http://charlesproxy.com/getssl on Android which will download the SSL certificate to the file system.

  3. Go to Settings > Security and privacy > More security settings. Under Credential storage, tap Install from device storage and select the downloaded SSL certificate to install. Once done with the below steps, remember to turn off the Proxy option to none and save.

  4. Now clear the Charles Proxy session and launch the BSNL FFTH Usage app. All network calls made by the app will be displayed in the Charles Proxy.

POST API details

Here we can see that a POST call is made to the address https://selfcarebbportal.bsnl.co.in/portal/fetchUserQuotaPM.do and this returns the usage details as JSON response.

API response

Below is the cURL code.

curl --request POST 'https://selfcarebbportal.bsnl.co.in/portal/fetchUserQuotaPM.do'