Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • 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
  1. Home
  2. APIs
  3. Simple S2S call via nodejs server

Simple S2S call via nodejs server

Scheduled Pinned Locked Moved APIs
node.js
2 Posts 1 Posters 1.0k 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.
  • R Offline
    R Offline
    Raymond Pendergraph
    wrote on last edited by
    #1

    I'm trying to follow the basic structure of an S2S call via node as demonstrated here but I get back rafts of Java stack with this at the top:

    "status_message":"Processing exception: com.braincloud.common.ProcessingException: Invalid app ID.\
    

    and as far as I can tell I have set these values appropriately. I even tried using a numeric type for the ID. Any idea what I'm doing incorrectly?

    Code:

    const brainclouds2s = require("brainclouds2s");
    
    const appId = "1***1";
    const serverSecret = "e2******27";
    const url = "internal.braincloudservers.com";
    const serverName = "*****"
    
    const groupData = {
        name: 'TestGroup',
        groupType: 'StudentGroup',
        isOpenGroup: false,
        acl: {
            member: 1,
            other: 0
        },
        jsonOwnerAttributes: {},
        jsonDefaultMemberAttributes: {},
        jsonData: {}
    }
    global.s2sContext = brainclouds2s.init(appId, serverName, serverSecret, url);
    brainclouds2s.setLogEnabled(global.s2sContext, true);
    brainclouds2s.request(global.s2sContext,{
        appId,
        serverName,
        serverSecret,
        service:'group',
        operation:'CREATE_GROUP',
        data: groupData})
    
    
    1 Reply Last reply
    0
    • R Offline
      R Offline
      Raymond Pendergraph
      wrote on last edited by
      #2

      This seems to be working now, the error is a wee misleading. The code was correct. The URL was incorrect and was changed to (or leave blank):

      const url = "sharedprod.braincloudservers.com";
      ...
      brainclouds2s.request(global.s2sContext, {
          service: "group",
          operation: "SYS_CREATE_GROUP",
          data: groupData,
        });
      })
      
      
      1 Reply Last reply
      0
      • Paul WinterhalderP Paul Winterhalder moved this topic from S2S APIs on

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

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