-
Re: Update Jive_Labels via API PUT
maxime.duval@lacapitale.com Apr 21, 2015 10:49 AM (in response to dbgilbert)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 Apr 21, 2015 10:59 AM (in response to maxime.duval@lacapitale.com)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 Apr 21, 2015 11:04 AM (in response to dbgilbert)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 Apr 21, 2015 11:08 AM (in response to maxime.duval@lacapitale.com)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
maxime.duval@lacapitale.com Apr 21, 2015 11:16 AM (in response to dbgilbert)Good! Just keep in mind that if you dont put a fiel in your JSON for the update, that field will be "blanked" in the profile of the user you update. So, lets say your profiles have 15 fields completed for every user and you only want to update one of them, you have to create your JSON with your updated field with its new value, and the 14 others with their olds. If you dont, your users will only have the one field you updated.
So thats why its better to GET a user first and then update the fields of this JSON for the PUT. Less chance of losing user's profile data.
-
Re: Update Jive_Labels via API PUT
dbgilbert Apr 21, 2015 11:23 AM (in response to maxime.duval@lacapitale.com)That's definitely not the case. I left out all sorts of fields, and they were not blanked at all. I still am getting that 500 error if I use the GET first and update with a modified version of it. Do I need to strip certain fields (I already strip that first line) to make it work?
-
Re: Update Jive_Labels via API PUT
maxime.duval@lacapitale.com Apr 21, 2015 11:29 AM (in response to dbgilbert)Ok, what version of Jive are you on?
I'm currently On Premise 6.0.4.2.
At first, the behavior we had was as you described (no blanking of fields) but that something that changed around 6.0.3 if I remember correctly. We had to adapt our scripts at the time to fully update each profile with the current information to make sure not to delete profile info.
Again, we are not up to date, so I dont know if this behavior changed in 7 or 8. This is something that we will have to figure out as we prepare to migrate to Jive 8.
-
Re: Update Jive_Labels via API PUT
dbgilbert Apr 21, 2015 11:39 AM (in response to maxime.duval@lacapitale.com)We've got Jive on the Cloud, I believe version 8.
On closer inspection it may have nuked certain fields, I'll check again.
-
Re: Update Jive_Labels via API PUT
dbgilbert Apr 21, 2015 11:48 AM (in response to dbgilbert)How strange. It does eliminate some fields. My phone number is being wiped. But my tags are not. Custom fields are left untouched as well. My Status persists.
It just wipes my phone number.
-
-
-
-
-
-
-
-
Re: Update Jive_Labels via API PUT
pawans Apr 21, 2015 8:59 PM (in response to maxime.duval@lacapitale.com)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 Apr 27, 2017 2:50 PM (in response to dbgilbert)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