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(\n\tat com.braincloud.core.dispatcher.LocalDispatcher.directCall(\n\tat\n\tat java.base/java.util.concurrent.Executors$\n\tat java.base/\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$\n\tat java.base/\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?