• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Does a Pre-hook consume an extra API call?

Scheduled Pinned Locked Moved General
cloud code
7 Posts 4 Posters 443 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Travis Brown-John
    wrote on last edited by
    #1

    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.

    Thanks!

    1 Reply Last reply
    0
  • A Offline
    A Offline
    Ali Raza
    wrote on last edited by
    #2

    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.

    1 Reply Last reply
    0
  • T Offline
    T Offline
    Travis Brown-John
    wrote on last edited by Travis Brown-John
    #3

    OK. I don't see the extra api call being flagged in the api explorer though.

    For Example:
    94083baa-69c3-4566-8628-0ce47e381ab1-image.png

    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

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #4

    Hi Travis,

    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!

    Paul.

    T B 2 Replies Last reply
    0
  • T Offline
    T Offline
    Travis Brown-John
    replied to Paul Winterhalder on last edited by
    #5

    @Paul-Winterhalder @Ali-Raza Thanks for the help!

    1 Reply Last reply
    0
  • B Offline
    B Offline
    Ben Morris
    replied to Paul Winterhalder on last edited by
    #6

    @Paul-Winterhalder

    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?

    A 1 Reply Last reply
    0
  • A Offline
    A Offline
    Ali Raza
    replied to Ben Morris on last edited by
    #7

    @Ben-Morris unfortunately yes
    they promised to solve it in BC 5.0 though

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users