Skip to content
  • Webhook routes

    Solved Cloud Code webhook cloud code s2s
    12
    0 Votes
    12 Posts
    4k Views
    Paul WinterhalderP
    Cool. Thanks for sharing the solution here @devsleeper !
  • 0 Votes
    5 Posts
    2k Views
    Paul WinterhalderP
    There is a global list of reason codes here - https://docs.braincloudservers.com/api/appendix/reasonCodes
  • Cloud code retries, error handling question

    Unsolved Cloud Code cloud code error
    2
    0 Votes
    2 Posts
    1k Views
    P
    A good way to handle failure besides retrying in code, is to schedule another script to run 1 minute later that will basically repeat the same action.
  • 0 Votes
    4 Posts
    2k Views
    K
    @Paul-Winterhalder Amazing! This is perfect for my needs-- thanks so much Paul.
  • 0 Votes
    1 Posts
    962 Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    H
    I posted this almost 13 days ago with zero answers, so I took some time to look through a bunch of documentation and did a ton of trial and error. Please Braincloud for the love of god add this to your API. Rhino does not handle Arrays the way that other coding languages do. I figured it out, unlike most arrays that return an array after you call push- Rhino returns the new length. So if you call push, don't set it's value. var copyArray = []; //I assume this line tells it to be an array for (var i = 0; i < postResult.data..length; i++) { copyArray[i] = postResult.data[i]; //arrays do not behave like .Net arrays, you can change length without initializing, so you just set each index to the index of the array you're copying } copyArray.push(variableToAdd); //Do NOT set this as the value of your array, the push method returns an int (length of array) NOT an array! //you probably dont need to call push at all to add to the array as shown in the for loop above if you already know your length or want a specific length Then just set your value to the variable, like this var entityData = { "variableName": copyArray }; //No need to call Array(copyArray) or any of the prototype. slice stuff. If you call Array() you'll just nest the array a second time. Use this page for further info on functions you can do with arrays.
  • Using numbers as JSON key.

    Cloud Code cloud code
    5
    1
    0 Votes
    5 Posts
    2k Views
    D
    @JasonL Thank you!!
  • Tournament Questions

    General portal api hook tournament cloud code
    2
    0 Votes
    2 Posts
    1k Views
    J
    (Post the answer from brainCloud chat channel) Actually, there is a workaround that you can perform the tournament rewards adjustments, Turn off the auto claim Add a post-hook to Authenticate instead <- where auto-claim would normally run And in the post-hook look to see if they have tournament rewards, and if they do, claim them there - performing any award adjustments that need to be made.
  • Unique field for a Custom Entity

    Cloud Code cloud code script cus cloud code
    3
    0 Votes
    3 Posts
    2k Views
    J
    Hi Reza, a simple workaround I would recommend is using our atomic methods, such as IncrementGlobalStats, to form the field values with the returned value of that method and some other characters you selected. (defined a global statistic ahead of time, call IncrementGlobalStats() get the returned current value of the global statistic, e.g. 123, then combine with the name you selected to a unique name, such as name_123)
  • 2 Votes
    6 Posts
    3k Views
    Paul WinterhalderP
    Well - the new release isn't out yet - it's just a Release Candidate. https://github.com/mozilla/rhino/releases That said - we are very happy to see the progress - since it has been over a year since 1.7.13 was released! Hopefully soon!
  • Does a Pre-hook consume an extra API call?

    General cloud code
    7
    0 Votes
    7 Posts
    2k Views
    A
    @Ben-Morris unfortunately yes they promised to solve it in BC 5.0 though
  • 0 Votes
    8 Posts
    3k Views
    Paul WinterhalderP
    @Travis-Brown-John You can create them manually from the Monitoring menu. Monitoring | Global Monitoring | Global Entities. Note - if your app is live, you need to unlock it first. You'll see a bit [+] button to the right of the Bulk actions drop-down. Good luck! Paul.