ivozprovider icon indicating copy to clipboard operation
ivozprovider copied to clipboard

How to create a new API (Balance Addition)

Open habibshahid opened this issue 5 years ago • 2 comments

I wanted to ask how to add a new API in swagger. We want to have balance addition control via API. Please guide

habibshahid avatar Jul 10 '20 17:07 habibshahid

HI @habibshahid,

Please use provided issue template ir order to make a feature request or it'll be automatically closed next time. You can use the mailing list otherwise.

About your question, I'd suggest you to check out any PR implementing a similar feature, https://github.com/irontec/ivozprovider/pull/1160 for instance.

Within the controller you'll need to use the services below:

  • library/Ivoz/Provider/Domain/Service/Company/IncrementBalance.php
  • library/Ivoz/Provider/Domain/Service/Company/DecrementBalance.php
  • library/Ivoz/Provider/Domain/Service/Carrier/IncrementBalance.php
  • library/Ivoz/Provider/Domain/Service/Carrier/DecrementBalance.php

Let us know whether you are willing to implement it yourself and do a PR or not, it will certainly be interesting to have it in the API.

Regards

mmadariaga avatar Jul 20 '20 09:07 mmadariaga

Thank you for the response. I have implemented the API locally and would love to contribute it to the project.

habibshahid avatar Jul 27 '20 07:07 habibshahid