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. Global Entities retrieval issues and questions

Global Entities retrieval issues and questions

Scheduled Pinned Locked Moved Unsolved APIs
5 Posts 3 Posters 1.6k Views 3 Watching
  • 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.
  • W Offline
    W Offline
    wjurica
    wrote on last edited by
    #1

    I'm able to get GlobalEntities using:

    _bc.GlobalEntityService.ReadEntity(entityId, successCallback, failureCallback);
    

    But only when using the "Entity ID" (ie long string of letters and numbers). When I use the "Entity Indexed ID" ("mainsettings" in this case), the response is:

    {"packetId":1,"responses":[{"status_message":"Processing exception (message): Missing record - global entity not found","reason_code":40345,"status":202}]}
    

    So, is the indexed ID not used for that? Is it only used for GetListByIndexedId? In that case I suppose it is not unique?

    My overarching question is related to the responses retrieved using any of these sorts of methods.
    How do I parse these json objects once I receive them? I've seen

    using BrainCloud.JSONHelper;
    

    and

    using BrainCloud.JsonFx.Json;
    

    And some other stuff like BCEntity.ReadFromJson and BCEntityFactory. Should I be able to have those responses be converted into classes and access any of the data like mainSettingsGlobalEntity.data, mainSettingsGlobalEntity.version, etc?

    Thanks

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

      Hi @wjurica ,

      Yes - if you want to use the entityIndexedId (which we recommend) - you should be calling GetListByIndexedId().

      And yes - brainCloud returns the JSON to the client - but it's up to the client app to handle it in a way that makes sense for their app. Our client libs <unfortunately> do not automatically de-serialize it into native classes.

      <Forum folks may have some suggestions on that.>

      I hope that helps!

      Paul.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wjurica
        wrote on last edited by wjurica
        #3

        Thanks Paul, I appreciate the quick response.

        That really is unfortunate. I understand that making data structures for each and every response is a lot of work for your team but that is work that each and every user of BrainCloud is going to have to do themselves. That's a big ask when considering, as a new user, I'm not even sure which requests I'm going to be making yet and just trying things out is going to be a headache. I'll have to rethink this.

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

          Hi @wjurica ,

          I do appreciate the perspective (for sure).

          That said - 99% of entities are custom JSON - and most of our API objects have extensible JSON components. And of course - there are competing JSON libraries and approaches that devs use. Plus the complications of the capabilities of the different client+library platforms (Unity/C# vs. Unreal/C++ vs. JavaScript vs. Java, etc).

          So - we've tried to have our libs take a light approach and focus on the networking + error handling + security

          • overall communications with the server - allowing our customers to develop their own approach for handling the JSON itself (and it is all just JSON after-all - most of the responses hardly need custom data structures).

          Your feedback is heard though! brainCloud is an ever-evolving platform. Never say never!

          Paul.

          1 Reply Last reply
          0
          • W wjurica

            Thanks Paul, I appreciate the quick response.

            That really is unfortunate. I understand that making data structures for each and every response is a lot of work for your team but that is work that each and every user of BrainCloud is going to have to do themselves. That's a big ask when considering, as a new user, I'm not even sure which requests I'm going to be making yet and just trying things out is going to be a headache. I'll have to rethink this.

            P Offline
            P Offline
            Panagiotis Milios
            wrote on last edited by
            #5

            @wjurica Assuming you're using c#, consider Newtonsoft for the deserialization & mapping process. It's two lines of code to map your data to a class.

            https://www.newtonsoft.com/json

            1 Reply Last reply
            0

            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