File Not Exists: API

I am trying to set up 3CX integration, and truthfully, I don’t know what I am doing.

Whenever, I make the call, though, I get the below in the log. Sure enough, there is no /custom/application/ext/api/* file.

Any ideas?

Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Including Ext hook file for custom/application
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/slim.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/controllers.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/factories.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/globals.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/helpers.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/middlewares.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/params.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/services.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/validators.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/services.php
Mon Feb 22 20:56:40 2021 [1645][-none-][DEBUG] Custom file is not exists: custom/application/Ext/Api/V8/beanAliases.php

Hey there RMN,

I assume that, if you’re seeing these errors in the log when you make a Call, that the 3CX functionality doesn’t work as expected?

Apologies, I haven’t used 3CX myself, so I’m not overly familiar with how it works
But, when you see these errors, what specifically is happening?

(Call not Made / not recorded in CRM / etc)



I’ve had a look for those error messages, and I’ve not found much:

This Github issue seems to refer to the same error messages, but isn’t regarding 3CX specifically.
It also seems to refer to slightly older versions of SuiteCRM:
https://github.com/salesagility/SuiteCRM/issues/6862

Which version of SuiteCRM are you on?
It might be worth upgrading if you’re on a version pre-7.11.18

There was also this forum post around the same error messages. Though, again, not related to 3CX:
https://community.suitecrm.com/t/custom-routes-file-is-not-exists-custom-application-ext-api-v8-config-routes-php/77621/2



There also seems to be a number of threads on 3CX’s forums regarding SuiteCRM, maybe some of them will be of assistance?:
https://www.3cx.com/community/threads/suitecrm-integration-problem.67026/
https://www.3cx.com/community/threads/suitecrm-integration-has-anybody-done.79661/



It looks like 3CX also have a logging system:https://www.3cx.com/docs/3cx-log-viewer/
It might be worth having a look in there too, to see if anything of note appears


Let us know if you need any help, or how things go :slight_smile:

3CX provides a tool called the 3CX Template Generator. It has a wizard for mating up the conditions with the correct API calls to the CRM. The Template Generator tool spits out an .xml file that you upload to your 3CX instance.

Part of the tool is a testing functionality. You input the ClientID and the Secret and you simulate a condition. The tool will tell what WOULD happen if the template was uploaded. The 3CX tool gives me the error below. All of the testing is with the tool, so there is no logging in 3CX, itself.

I’m running 7.10.29. On Ubuntu 18.04 LTS. I’m using Virtualmin (kind of like an open source equivalent of Plesk/CPanel). I’m using CGI so everything runs as virtual server user (instead of www-data).

I put keys in proper directory, as per this piece of documentation.

I chown’d crmuser (the user for this Virtualmin virtual server) and chmod 600 for the keys.

I then went into the CRM and made a “Client Credentials Client” I am using the “ID” of that client and the “Secret” I created to give to the Template Generator.

I am assuming all of that sounds correct, so far?

One thing that sticks out to me what the heck is “custom/application/Ext/Api/V8/controllers.php” and all of the other files mentioned?

That file doesn’t exist and I can’t figure out 1) if it’s supposed to exist and 2) what the heck those files are supposed to do…

System.Exception: Server returned a non successful status code - HTTPStatusCode=InternalServerError - Reason=Internal Server Error - Content=
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.ScenarioAuthHttpClientProvider.PerformScenarioIfNeeded(CancellationToken token)
at CrmIntegration.ScenarioAuthHttpClientProvider.Create(CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(String contactNumber, Boolean isInboundCall, String destinationEmail, Boolean createIfNotFound, CancellationToken token)

Try a “find in files” to see which file is referencing the missing file

Go to your main SuiteCRM directory and type

grep -irn beanAliases.php .

1 Like

As an update, I have created a completely new VPS and SuiteCRM install (this is making me miss using ZOHO).

I now seen the tokens used by the Template Generator in the SuiteCRM UI, which I didn’t before.

So… I guess that’s progress…

So, I’ve corrected part of the problem, but I am still not getting matching results.

API URL for a contact lookup is https://crm.com/Api/V8/module/Contacts?filter[phone_mobile][eq]=8420

Which apparently isn’t right…

I can’t make heads or tails of what it should be ,though …

Hey,

Hmmm, that API URL format should be correct, and would return any Contacts where the “phone_mobile” field is exactly “8420”

(note: It has to be an exact match, I’m not sure if the API currently supports “contains” conditions)

ie, it returns as such in Postman:
image


I assume you are getting no results?
Or are you getting any sort of error message returned?
If its something else, could you please clarify what “isnt right”?

Thanks!