3 Replies Latest reply on Feb 25, 2016 8:04 AM by Ryan Rutan

    how to diagnose People URI is crashing to some users

    danilogarduce

      Hi Guys,

      Hope all is well. I would like to ask for .Net issue with API, for some reason, there are records in our database that when API loads the username in .Net, it crashes. When I use the API directly, it returns a result which I thought is normal except that the name is empty: "name" : { }

       

       

       

      .Net Code:

      string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(xxx + ":" + xxx));

      client.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;

      client.Headers[HttpRequestHeader.Accept] = ConfigurationSettings.AppSettings["HttpRequestHeaderAccept"];

       

      jiveResponse = client.DownloadString(http://xxx/api/core/v3/people/username/xxx);

      jiveResponse = jiveResponse.Replace("throw 'allowIllegalResourceCall is false.';", String.Empty);

      var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

       

      deserialPerson = (JivePersonObject)serializer.Deserialize<JivePersonObject>(jiveResponse);

       

       

      Thanks in advance for help.

       

      Danny

        • Re: how to diagnose People URI is crashing to some users

          Who are you connecting as?  Yourself or an admin?  If yourself, then it could very well be privacy settings on the user.  To confirm, load the Admin Console > Users and find the person's record.  It should have name visibility setting displayed there.  If it is set to "just me" or "private" (forget the term), and you are connecting as a non-full admin...then this could explain the data.

           

          Chances are that if you are using the .NET SDK that it assumes that the name will always be there, and depending how you are deserializing the JSON ... you may need to annotate the "name" field with an "optional" argument.  In Java, you can do this with Jackson with a simple attribute...depending on how your deserialization routine works..this is what I'd probably look into.

           

          and/or connect as an Admin (if you are not already) where privacy settings are bypassed. 

           

          Hope that helps.

          • Re: how to diagnose People URI is crashing to some users
            danilogarduce

            Hi Ryan,

            Thank you for responding. Name visibility is set to "everyone (including guest)"

              • Re: how to diagnose People URI is crashing to some users

                Do you have a sample output you can share in the thread? (picture of the user's profile page or admin console lookup with name visible) and then the output from the API? 

                 

                Is it always that record? 

                 

                When was the last time the record was updated?  Have you tried making an arbitrary update to the profile to see if this corrects the issue? (i.e. setting name to "Joe2" or something similar).

                 

                Seems very odd indeed.  Lastly what version of Jive are you using?