Using information such as the link below provides, one can create custom APIs for WHMCS without much trouble, but there is no documentation from WHMCS for doing so. Additionally, any custom APIs are not exposed via the new API Roles area so they are more troublesome to implement. The ability to support this feature is already present in WHMCS; it's just a matter of providing documentation and at least one more function being exposed to add strings to the API roles list. Luckily, other people have documented it well enough to get started:
https://whmcs.community/topic/263421-adding-custom-external-api-functions/Feature request in short:
- Support custom API directives by providing appropriate documentation
- Provide patch notes for any changes made which might affect custom API implementations and standards
- Allow custom API directives to be listed in the API Roles area in 7.4+
Currently it is possible to manipulate the API role in the database to add local support for custom APIs, but this is not desirable and may be patched in the future to remove support for non-standard API directives. Also, it would probably be preferred to hook this into plugins in some way so plugins can register functions with the API instead of the unsupported method using files in the api directory.
Merged Ideas
permissions for custom api
Hi,I've added a new custom api to WHMCS 7.4 and 7.5 but I've not been able to use it as I get a 'Invalid Permission' error ({"result":"error","message":"Invalid Permissions: API action \u0022getadmin\u0022 is not allowed"}) It is not showing in API Roles either so I'm not able to grant that permission.It would be great if you add the functionality.Thanks.
Featured Comment
We view the API functions we distribute and document as a commitment to maintain an element of backwards and forwards compatibility across versions, and are committed to maintaining and developing the API to help meet users needs.
I'd be interested to learn about the kind of custom API commands you have found it necessary to implement, so encourage you to submit feature requests for those.