Does a Pre-hook consume an extra API call?
For example if I set up a pre hook as outlined here: https://getbraincloud.com/apidocs/cloud-code-central/handy-cloud-code-scripts/restrictclientcalls-script/
Will it consume an extra API call for each API call made from the client? From my testing in the API Explorer, I don't see it registering the pre hook as an extra API call, but there was a discussion on discord that suggested that a whitelist prehook would create an extra api call per invocation.
Yes, it will be an extra api call.
However as its part of cloud script, so if im not mistaken you get 2 more apis calls free so this one shouldnt cost extra.
OK. I don't see the extra api call being flagged in the api explorer though.
you get 2 more apis calls free so this one shouldnt cost extra.
If I need to make 3 or more api calls in my custom Cloud Code then I will, in effect, be paying for this call
I can confirm that indeed there is an API call count for calling a pre/post hook script - we'll look to see if we can make that clearer in the docs.
That said, Ali is very correct, like all scripts, the next 3 API calls are free, and scripts after that are 1/2 count each.
Hope that clarifies things!
Apologies for reviving this thread, but does this mean that an operation with a pre hook and a post hook that don't make any API calls of their own count as one API call (pre-hook counts as API call, then operation and post-hook are free). Or does an operation with a pre-hook and a post-hook cost 3 API calls?
@Ben-Morris unfortunately yes
they promised to solve it in BC 5.0 though