Hello Piyush Sagar!
It would be helpful to see the manner in which you called the function osapi.jive.corev3.people.update(), as well as the error you received. It would be difficult to debug the issue otherwise.
I called update function in following two ways :
But in both the ways above I was getting the error Uncaught TypeError: osapi.jive.corev3.people.update is not a function(…) and Uncaught TypeError: osapi.jive.corev3.people.Person(...).update is not a function(…) respectively.
Please tell me correct way to use this function.
1 person found this helpful
Looks like you might not be in the right scope to use that code. Is this code running in the browser (as opposed to a node server)? Does this code even have access to osapi or osapi.jive? I would work backwards from "osapi.jive.corev3.people.update" to see what you are missing. Or better yet, debug this in your browser and see if you have access to osapi (put a breakpoint at the error and then type the object names into console).
Is this code in a tile, widget, or app? You may want to read https://community.jivesoftware.com/thread/173142 and https://community.jivesoftware.com/thread/196596, where it is said that "OSAPI is only valid in an OpenSocial container context. An HTML widget is outside of this context, similar to the way some of Google's services are only consumable inside their Google container or an encapsulated gadget." But that was 4 years ago.
2 people found this helpful
You need to get the person object first and then call the method on it.
something like this