var oae = require('oae-rest/lib/oae'); oae.api.groupAPI.getGroupMembers('groupId', null, null, function(err, members) { if (!err) { for(var i=0; i
In this example, the library is used to fetch a list of all users in a group with the ID ‘groupId’. The function then loops through the response and outputs the display name of each user.
Package library: ‘oae-rest/lib/oae’
Example 2: Upload a new documentvar oae = require('oae-rest/lib/oae'); var file = new Blob(["File contents"], {type: "text/plain"}); oae.api.content.createFile(file, 'displayName', null, null, {'Visibility': 'public'}, function(err, content) { if (!err) { console.log(content.profile.displayName + ' has been created.'); } });This example shows how to use the library to upload a new document to the OAE platform. The ‘createFile’ function takes in a file object, display name, privacy settings, and any other custom attributes. The function then creates the content and outputs a success message. Package library: ‘oae-rest/lib/oae’