Skip to main content
All CollectionsPortal-X Pages
Design | Cloud Code | API Blocking
Design | Cloud Code | API Blocking

Allows developers to block specified client API calls - making these calls only available via cloud code scripts.

Jason Liang avatar
Written by Jason Liang
Updated over a week ago

brainCloud optionally allows developers to completely disable specific client APIs. This can be achieved by selecting the desired services + API calls to block from the UI directly, instead of using the Pre-hook to restrict these API calls, which results in additional API counts for the app.

Once a designated API is restricted, it will generate an error code 40346 when invoked from the client side as below.

{
"data": {},
"status": 403,
"statusMessage": "Processing exception (message): Call blocked from client.",
"reasonCode": 40346,
"stackTrace": "com.braincloud.common.ProcessingException: Call blocked from client.\n\tat com.braincloud.core.dispatcher.DispatchHandler.processMessage(DispatchHandler.java:211)\n\tat com.braincloud.core.dispatcher.LocalDispatcher.directCall(LocalDispatcher.java:332)\n\tat com.braincloud.core.dispatcher.DirectAPICallTask.run(DirectAPICallTask.java:88)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\n"
}

Note that certain calls, like the Award(), Consume() and Reset() currency calls, may already be blocked from the client depending based on the compatibility settings on the Design | Core App Info | Advanced Settings page.

Did this answer your question?