How to create users while registering with different roles via API?

Hi,
I am getting error on this line var userObject = platform.api.get(‘system/user/’+platform.session.user.id+’?related=user_to_app_to_role_by_user_id’);

api error says command return with error code 1, any idea what that means ?