How to access the user's ExtendedAttributes after a GET REST API request

Former Member
Former Member

How do you access the extendedattributes after a GET REST API request as shown below:

            jQuery.telligent.evolution.get({
	            url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/users/{id}.json',
	            data: {
    				Id: context.userId
    			},
	            success: function(response) {
                    
	            }

Parents
  • Like all REST requests, you can use the response object in your success handler. I'd recommend using a debugger to inspect what it contains. As an example, here's your code outputting properties of the response object including the User and the User's ExtendedAttributes to the browser console.

    jQuery.telligent.evolution.get({
    	url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/users/{id}.json',
    	data: {
    		Id: context.userId
    	},
    	success: function(response) {
    		// render user
    		console.log('User object:')
    		console.log(response.User);
    
    		// render user's extended attributes
    		if (response.User.ExtendedAttributes && response.User.ExtendedAttributes.length > 0) {
    			console.log('Extended attributes:');
    			console.log(response.User.ExtendedAttributes);
    		} else {
    			console.log('No extended attributes.');
    		}
    	}
    });

Reply
  • Like all REST requests, you can use the response object in your success handler. I'd recommend using a debugger to inspect what it contains. As an example, here's your code outputting properties of the response object including the User and the User's ExtendedAttributes to the browser console.

    jQuery.telligent.evolution.get({
    	url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/users/{id}.json',
    	data: {
    		Id: context.userId
    	},
    	success: function(response) {
    		// render user
    		console.log('User object:')
    		console.log(response.User);
    
    		// render user's extended attributes
    		if (response.User.ExtendedAttributes && response.User.ExtendedAttributes.length > 0) {
    			console.log('Extended attributes:');
    			console.log(response.User.ExtendedAttributes);
    		} else {
    			console.log('No extended attributes.');
    		}
    	}
    });

Children
No Data