0

Using SugarCRM's REST API, I can't seem to find where to get a user's timezone info.

Tried get_entry ('Users', 'id'), but it only listed:

[u'employee_status', u'last_name', u'picture', u'created_by_name', u'show_on_employee
s', u'team_id', u'accept_status_name', u'phone_fax', u'full_name', u'address_state',
u'team_name', u'messenger_id', u'address_country', 'id', u'email1', u'first_name', u'
date_entered', u'title', u'address_street', u'receive_notifications', u'reports_to_id
', u'phone_work', u'created_by', u'name', u'reports_to_name', u'UserType', u'external
_auth_only', u'authenticate_id', u'modified_by_name', u'department', u'sugar_login',
u'user_name', u'email', u'user_hash', u'status', u'm_accept_status_fields', u'pwd_las
t_changed', u'description', u'deleted', u'is_group', u'phone_other', u'is_admin', u'c
_accept_status_fields', u'messenger_type', u'accept_status_id', u'address_city', u'mo
dified_user_id', u'team_set_id', u'preferred_language', u'date_modified', u'phone_hom
e', u'address_postalcode', u'phone_mobile', u'system_generated_password', u'email_lin
k_type', u'default_team', u'portal_only']
Jsdodgers
  • 5,253
  • 2
  • 20
  • 36
john2x
  • 22,546
  • 16
  • 57
  • 95

2 Answers2

2

Unfortunately, it's not available through the REST API. To get it, you'll need to create a custom REST API method to get that data for you. There's a good write up for doing that here: http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/02_Application_Framework/Web_Services/06_Extending_Web_Services

Once you have the custom method, getting the data to return to the caller is pretty easy, you just need to do the following to retrieve a user's timezone:

<?php
    // $user being a User Object
    $timezone = TimeDate::userTimezone($user); 
Chad Hutchins
  • 474
  • 3
  • 9
0

Check out this blog to see how to do this with the new REST API in Sugar 7...

http://developers.sugarcrm.com/wordpress/2013/08/29/getting-the-timezone-of-a-user-via-web-services/

jmertic
  • 2,208
  • 1
  • 13
  • 8