API

C-Mobiles provides you with a very simple API, which allows you to manage individual accounts.

You can access all of the calls from the following https://demoapis.com/cmobile/:id/:

Please note that all API calls expect an id parameter. Please pick one number 9-11 digits long, and use it for all of your calls. This way when you top up an account and then ask for the account status, you will see the balance updated.

Also, if you happen to use a number that someone else is also using (this is not very likely unless you use the demo id), just pick a different number and you should be fine.

Here is the list of available functions:

getAccountStatus

getAccountStatus allows you to ask for the Account balance, minutes, SMS, and data.

Signature:

You need to provide your selected account id.

Example:

Here is an example of how to get the account balance for id 012345678

https://demoapis.com/cmobile/012345678/getAccountStatus

Result:

 

topUp

topUp allows you to top up your account balance, as a result, the balance will increase and you will receive an updated account status.

Signature:

You need to provide your selected account id.

Additionally, you need to provide two query params:

Example:

Here is an example of how to top the account id 012345678 with 10 credits using the card ending with 9876 (don't worry no card payment will actually happen 😉).

https://demoapis.com/cmobile/012345678/topUp?val=10&card=9876

Result:

 

availableCards

availableCads allows you to look up all associated payment cards with the account.

Signature:

You need to provide your selected account id.

Example:

Here is an example of how to check what payment cards are associated with the account id 012345678.

https://demoapis.com/cmobile/012345678/availableCards

Result:

 

resetAccount

resetAccount allows you to reset your account. This can come useful when you want to start from scratch.

Signature:

You need to provide your selected account id.

Example:

Here is an example of how to reset the account id 012345678.

https://demoapis.com/cmobile/012345678/reset

Result:

 

dataPackages

dataPackages allows you to view available data packages for you to purchase.

For each package you will receive a name, formatted data size, megabytes, and a price.

Signature:

No parameters are required.

Example:

Here is an example of how to view available data packages.

https://demoapis.com/cmobile/012345678/dataPackages

Result:

 

buyData

buyData allows you to purchase more data for your account. As a result, more data will be added to the account, and the price of the package will be deducted from the balance.

Signature:

You need to provide your selected account id.

Additionally, you need to provide a query param dataPack with the name of the package that you want to purchase.

Example:

Here is an example of how to buy a medium data pack for the account id 012345678.

https://demoapis.com/cmobile/012345678/buyData?dataPack=tiny

Result: