I'm troubleshooting an issue where some custom APIs (v3) via an extension are not recognized by the site, either in the API explorer or when attempting to run them via cv. The situation is puzzling:

  • the extension has multiple APIs, some of which are recognized and working
  • the working/non-working APIs are structurally identical (except for the different action value). in other words, the file location and functions have a matching structure (they use the same entity value).
  • I tried creating some test APIs via civix directly on the server, and they are not recognized
  • What's more confusing is that the APIs do show up when I install the extension on another site. So site A registers some of the APIs; site B registers all of them. Identical code, and nothing particularly odd about the server environments.

I've checked the obvious -- cleared caches, etc. For some inexplicable reason, some APIs are recognized, others are not. Any suggestions on further troubleshooting?

  • Just in case you haven't checked this, the naming convention is picky, as per docs.civicrm.org/dev/en/latest/framework/api-architecture/…. Does everything match up? As it says If you have created the files and functions but they do not appear in API explorer, it is most likely because of a mis-match in your naming conventions. It might not explain your last point about about using civix directly, but I don't have any other ideas at the moment. – Demerit Jul 16 '19 at 3:05
  • As @Demerit says, check naming conventions, particularly the case of filenames and classes/functions in them. – Aidan Jul 16 '19 at 8:04
  • Naming conventions are correct and identical to other APIs that are showing up. – lcdservices Jul 16 '19 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.