简档API
在Zoho CRM中,管理员为每个用户分配一个角色,该角色决定用户访问Zoho CRM数据的级别。使用此API可以获得不同角色的详细信息。
获取角色
目的
通过API请求检索角色的数据。
请求URL
https://www.zohoapis.com.cn/crm/v2/settings/profiles
请求方法
GET
范围
scope=ZohoCRM.settings.profiles.{operation_type}
可能的操作类型 |
---|
ALL - 完全访问角色数据 READ - get profile data |
示例请求
curl "https://www.zohoapis.com.cn/crm/v2/settings/profiles"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
{
"profiles": [
{
"name": "Administrator",
"modified_by": null,
"description": """This profile will have all the permissions. Users with Administrator profile will be able to view and manage all the data within the organization account by default.",
"id": "2883756000000026011",
"category": false
},
{
"name": "Standard",
"modified_by": null,
"description": "This profile will have all the permissions except administrative privileges.",
"id": "2883756000000026014",
"category": false
}
]
}
示例请求
def get_profiles(self):
try:
resp=ZCRMOrganization.get_instance().get_all_profiles()
profiles=resp.data
print resp.status_code
for profile in profiles:
print "\n\n"
print profile.name
print profile.id
print profile.is_default
print profile.created_time
print profile.modified_time
print profile.modified_by
print profile.description
print profile.created_by
print profile.category
print profile.permissions
sections= profile.sections
if sections is not None:
for section in sections:
print section.name
print section.categories
except ZCRMException as ex:
print ex.status_code
print ex.error_message
print ex.error_code
print ex.error_details
print ex.error_content
示例响应
{
"profiles": [
{
"name": "Administrator",
"modified_by": null,
"description": """This profile will have all the permissions. Users with Administrator profile will be able to view and manage all the data within the organization account by default.",
"id": "2883756000000026011",
"category": false
},
{
"name": "Standard",
"modified_by": null,
"description": "This profile will have all the permissions except administrative privileges.",
"id": "2883756000000026014",
"category": false
}
]
}
示例请求
ZCRMRestClient restClient = ZCRMRestClient.GetInstance();
BulkAPIResponse<ZCRMProfile> response = restClient.GetOrganizationInstance().GetAllProfiles();
List<ZCRMProfile> profiles = response.BulkData; // profiles - ZCRMProfile实例的列表
示例响应
{
"profiles": [
{
"name": "Administrator",
"modified_by": null,
"description": """This profile will have all the permissions. Users with Administrator profile will be able to view and manage all the data within the organization account by default.",
"id": "2883756000000026011",
"category": false
},
{
"name": "Standard",
"modified_by": null,
"description": "This profile will have all the permissions except administrative privileges.",
"id": "2883756000000026014",
"category": false
}
]
}