2013-08-20 61 views
0

使用SugarCRM的REST API,我似乎無法找到從哪裏獲取用戶的時區信息。在SugarCRM API中,如何獲取用戶的時區信息?

試過get_entry('Users', 'id'),但它僅列:

[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'] 

回答

2

不幸的是,它不是可以通過REST API。爲了獲得它,你需要創建一個自定義的REST API方法來爲你獲取這些數據。有做這件事有好的寫了起來:http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/02_Application_Framework/Web_Services/06_Extending_Web_Services

一旦你的自定義方法,得到的數據返回給調用者是很容易的,你只需要做到以下幾點檢索用戶的時區:

<?php 
    // $user being a User Object 
    $timezone = TimeDate::userTimezone($user); 
相關問題