11 Replies Latest reply on Apr 27, 2017 2:50 PM by mbrybag

    Update Jive_Labels via API PUT

    dbgilbert

      I'm trying to prepare a mass-update for all profiles in our cloud-based instance of Jive. I've had success making updates to user profile images, but now I've moved onto handling update for some of our custom profile fields. These fields are found in the Person object under the "jive" property in the "profile" object (which is not always present. According to the docs Jive REST Rest API v3.10 → Jive entity, the fields are read-only. Does this mean that I cannot update them with a PUSH call to the API? Is there some other method I should be using to mass update these fields?

        • Re: Update Jive_Labels via API PUT
          maxime.duval@lacapitale.com

          We use the REST API to mass update the profiles of our users everyday (to keep them in synch with another system). We automated everything and it works fine (custom fields and Jive fields). It works well but it takes some time. So if you have a large number of update to do, plan for it.

           

          Also, you should start by fetching the profiles of every users you plan to update (this you can do massively). And then, you update their profile one by one. If there is a better way of doing this please let me know!

           

          Maxime

            • Re: Update Jive_Labels via API PUT
              dbgilbert

              Well if it works it works, though that seems counter to what the Documentation says. Your plan to grab everyone, then run individual updates was our plan as well. I can't even get a single update to go through, though. I've tried created the person object from scratch, but only ever get a 400 error despite being sure that I've got valid JSON and am changing nothing but the status field. If I use the Person object acquired from the GET (as recommended), I get a 500 error with the status "Protocol Error", which is even less helpful.

                • Re: Update Jive_Labels via API PUT
                  maxime.duval@lacapitale.com

                  The best is to use the exact same JSON returned from a GET, but you have to remove the first line in order for the PUT to work :

                   

                  throw 'allowIllegalResourceCall is false.';

                  {

                    "name" : {

                      "givenName" : "Test",

                      "familyName" : "User",

                      "formatted" : "Test User"

                    },

                  ...

                   

                  Other than that I dont see, what the problem might be if your return the same JSON that you got from your GET. Are you putting your credentials in the header of the request?

                    • Re: Update Jive_Labels via API PUT
                      dbgilbert

                      Of course, moments after complaining I get the updates working. And it did, as you believed, let me update the custom fields. Thanks for giving me enough hope to get that far.

                       

                      I had to build the Person from scratch to avoid that 500 error, though (I'm fairly certain I was removing that first line), and it took me a while to discover I needed to include quite a few fields in that object even if they aren't changing; where was that documented?

                  • Re: Update Jive_Labels via API PUT
                    pawans

                    We have a setup similar to what Maxime has mentioned.

                    An automated setup which runs once a day to sync this data for all users.


                    We have one more automated setup through jive's directory services option which syncs some AD fields to some jive fields.

                    As we have multiple systems holding user data, this kind of setup helped getting more data to jive, making it a hub.

                  • Re: Update Jive_Labels via API PUT
                    mbrybag

                    Has anyone here had success updating custom profile fields that are blank? The PUT request to the person service works great for updating my custom profile fields if they already have a value. For some reason if it is blank it doesn't work for me.

                     

                    For example, i created a custom profile field called "Jive share community". I then do a GET request, modify the Jive share community field in the JSON response, then use that updated person entity in my PUT command.

                    Updating a user from jive share community = 'Finance' to jive share community = 'HR' works great.

                    But if Jive share community field is blank, I cannot update it to any other value. The error returned is "Invalid field name Jive Share Community"

                     

                    I think this is because the GET JSON response doesn't include blank fields as part of the JSON response if this field is blank. In this case, I tried adding the field value to the JSON string and then use that in the PUT. But I receive the above error.

                     

                    Here are more details should anyone be interested

                     

                    Unable to add values to custom profile fields using the api Person service if the field is blank