Support Topics Documentation Slack YouTube Blog

Calling custom API service results in Error 14002: Service method not found

I have an Event Handler that calls a custom API service but it is throwing an error:

400 (Bad Request) {"code":14002,"message":"Service method not found","errorData":{}}

The Service method exists and functions as expected… but trying to call it from this Event Handler throws the error. Any ideas as to what is wrong?

Could you please show what the ccreateCustomer method declaration looks like?

Tested and works as expected:

Thanks. I’d like to see the PARAMETERS tab if possible. That would show how Backendless recognizes the method:

I think I know why it happens. The reason is you provides a custom REST route /create-customer. II just tried invoking such method and it fails to find it. Could you try renaming the route to /createCustomer ? I have it a feeling it will work then.

Hm, I’ve found a bug. At some point earlier on, I renamed this method name but the Code view shows that the old name is persisting. I don’t think I am able to correct this myself…

Is this in the code where you invoke the service or in the code of the service itself?

That is what shows in the Event Handler, where I reference the service.

What if you remove the block which calls the service and re-add it again?

The old name persists.

So that we can reproduce the problem, could you please describe when exactly you renamed the service? Was it after you deployed it to the server?
Have you tried to redeploy the service after you changed the name?

The service was originally named assignCustomer and was renamed to createCustomer. I cannot recall if the original was deployed or not. It has since been deployed several times.

Please let me know your application ID. I’ll check if we can change the route from our side.

It is B9941993-E38E-A647-FF0F-626E69BF9900

Thank you. Looks like a bug, huh?

Strange. Even though you manually changed that service name, it’s still throwing the error on the Event Handler.

HI @Stephen_Peasley, I have not made any changes yet. Just logging in…

Now it is fixed. Could you please check?

1 Like

Thank you, that works as expected!

Related to this bug, when you delete a custom API method a reference to it persists somewhere. If I delete a method, then try to recreate it: