获取特定角色的数据

获取任何特定角色的详细信息。 在API请求中指定角色的唯一ID,从而获取特定角色的数据。

请求URL

https://www.zohoapis.com.cn/crm/v2/settings/profiles/{profile_id}

profile_id - 指定角色的唯一ID。

请求方法

GET

范围

scope=ZohoCRM.settings.profiles.{operation_type}

可能的操作类型
ALL - 完全访问角色数据
READ - 获取角色数据

示例请求


				curl "https://www.zohoapis.com.cn/crm/v2/settings/profiles/2883756000000026011"
-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
        }
    ]
}			

示例请求


				def get_profile(self):
    try:
        resp=ZCRMOrganization.get_instance().get_profile(1386586000000026014)
        profiles=[resp.data]
        print resp.status_code
        for profile in profiles:
            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
            permissions= profile.permissions
            if permissions is not None:
                print ":::PERMISSIONS:::"
                for permission in permissions:
                    print permission.name
                    print permission.id
                    print permission.display_label
                    print permission.module
                    print permission.is_enabled
            sections= profile.sections
            if sections is not None:
            for section in sections:
                print section.name
                categories=section.categories
                if categories is not None:
                    print "::::CATEGORIES:::"
                    for category in categories:
                        print category.name
                        print category.display_label
                        print category.permission_ids
                        print category.module
        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
        }
    ]
}			

示例请求


				ZCRMRestClient restClient = ZCRMRestClient.GetInstance();
APIResponse response = restClient.GetOrganizationInstance().GetProfile(33721640000000); // 33721640000000是角色ID
ZCRMProfile profile = (ZCRMProfile)response.Data;			

示例响应


				{
    "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
        }
    ]
}