获取特定职位的数据
获取特定职位的详细信息。 在API请求中指定职位的唯一ID从而获取特定职位的数据。
请求URL
https://www.zohoapis.com.cn/crm/v2/settings/roles/{role_id}
role_id - 指定职位的唯一ID。
请求方法
GET
范围
scope=ZohoCRM.settings.roles.{operation_type}
可能的操作类型 |
---|
ALL - 完全访问职位数据 READ - 获取职位数据 |
示例请求
curl "https://www.zohoapis.com.cn/crm/v2/settings/roles/2883756000000026005"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
{
"roles": [
{
"display_label": "CEO",
"name": "CEO",
"id": "2883756000000026005",
"reporting_to": null,
"admin_user": true
}
]
}
示例请求
def get_role(self):
try:
resp=ZCRMOrganization.get_instance().get_role(1386586000000026008)
roles=[resp.data]
print resp.status_code
for role in roles:
print role.name
print role.id
print role.display_label
print role.is_admin
if role.reporting_to is not None:
print role.reporting_to.id
print role.reporting_to.name
except ZCRMException as ex:
print ex.status_code
print ex.error_message
print ex.error_code
print ex.error_details
print ex.error_content
示例响应
{
"roles": [
{
"display_label": "CEO",
"name": "CEO",
"id": "2883756000000026005",
"reporting_to": null,
"admin_user": true
}
]
}
示例请求
ZCRMRestClient restClient = ZCRMRestClient.GetInstance();
APIResponse response = restClient.GetOrganizationInstance().GetRole(33721640000000); // 33721640000000 is role id
ZCRMRole role = (ZCRMRole)response.Data;
示例响应
{
"roles": [
{
"display_label": "CEO",
"name": "CEO",
"id": "2883756000000026005",
"reporting_to": null,
"admin_user": true
}
]
}