PHP (Extension) / Support API / List Custom Roles
Back to Collection Items
<?php
include("chilkat_9_5_0.php");
$http->put_BasicAuth(true);$http->put_Login('login');$http->put_Password('password');$success = $http->QuickGetSb('https://example.zendesk.com/api/v2/custom_roles',$sbResponseBody);$jResp->LoadSb($sbResponseBody);$jResp->put_EmitCompact(false);$jResp->put_I($i);$name = $jResp->stringOf('custom_roles[i].name');$role_type = $jResp->stringOf('custom_roles[i].role_type');$Assign_tickets_to_any_group = $jResp->stringOf('custom_roles[i].configuration.assign_tickets_to_any_group');$Chat_access = $jResp->stringOf('custom_roles[i].configuration.chat_access');$End_user_list_access = $jResp->stringOf('custom_roles[i].configuration.end_user_list_access');$End_user_profile_access = $jResp->stringOf('custom_roles[i].configuration.end_user_profile_access');$Explore_access = $jResp->stringOf('custom_roles[i].configuration.explore_access');$Forum_access = $jResp->stringOf('custom_roles[i].configuration.forum_access');$Forum_access_restricted_content = $jResp->stringOf('custom_roles[i].configuration.forum_access_restricted_content');$Group_access = $jResp->stringOf('custom_roles[i].configuration.group_access');$Light_agent = $jResp->stringOf('custom_roles[i].configuration.light_agent');$Macro_access = $jResp->stringOf('custom_roles[i].configuration.macro_access');$Manage_business_rules = $jResp->stringOf('custom_roles[i].configuration.manage_business_rules');$Manage_contextual_workspaces = $jResp->stringOf('custom_roles[i].configuration.manage_contextual_workspaces');$Manage_dynamic_content = $jResp->stringOf('custom_roles[i].configuration.manage_dynamic_content');$Manage_extensions_and_channels = $jResp->stringOf('custom_roles[i].configuration.manage_extensions_and_channels');$Manage_facebook = $jResp->stringOf('custom_roles[i].configuration.manage_facebook');$Manage_organization_fields = $jResp->stringOf('custom_roles[i].configuration.manage_organization_fields');$Manage_ticket_fields = $jResp->stringOf('custom_roles[i].configuration.manage_ticket_fields');$Manage_ticket_forms = $jResp->stringOf('custom_roles[i].configuration.manage_ticket_forms');$Manage_user_fields = $jResp->stringOf('custom_roles[i].configuration.manage_user_fields');$Moderate_forums = $jResp->stringOf('custom_roles[i].configuration.moderate_forums');$Organization_editing = $jResp->stringOf('custom_roles[i].configuration.organization_editing');$Organization_notes_editing = $jResp->stringOf('custom_roles[i].configuration.organization_notes_editing');$Report_access = $jResp->stringOf('custom_roles[i].configuration.report_access');$Side_conversation_create = $jResp->stringOf('custom_roles[i].configuration.side_conversation_create');$Ticket_access = $jResp->stringOf('custom_roles[i].configuration.ticket_access');$Ticket_comment_access = $jResp->stringOf('custom_roles[i].configuration.ticket_comment_access');$Ticket_deletion = $jResp->stringOf('custom_roles[i].configuration.ticket_deletion');$Ticket_editing = $jResp->stringOf('custom_roles[i].configuration.ticket_editing');$Ticket_merge = $jResp->stringOf('custom_roles[i].configuration.ticket_merge');$Ticket_tag_editing = $jResp->stringOf('custom_roles[i].configuration.ticket_tag_editing');$Twitter_search_access = $jResp->stringOf('custom_roles[i].configuration.twitter_search_access');$User_view_access = $jResp->stringOf('custom_roles[i].configuration.user_view_access');$View_access = $jResp->stringOf('custom_roles[i].configuration.view_access');$View_deleted_tickets = $jResp->stringOf('custom_roles[i].configuration.view_deleted_tickets');$Voice_access = $jResp->stringOf('custom_roles[i].configuration.voice_access');$Voice_dashboard_access = $jResp->stringOf('custom_roles[i].configuration.voice_dashboard_access');$created_at = $jResp->stringOf('custom_roles[i].created_at');$description = $jResp->stringOf('custom_roles[i].description');$id = $jResp->stringOf('custom_roles[i].id');$team_member_count = $jResp->stringOf('custom_roles[i].team_member_count');$updated_at = $jResp->stringOf('custom_roles[i].updated_at');$i = $i + 1;
?>
Curl Command
curl -u login:password -X GET
-H "Accept: application/json"
https://example.zendesk.com/api/v2/custom_roles
Postman Collection Item JSON
{
"name": "List Custom Roles",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/custom_roles",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"custom_roles"
]
},
"description": "#### Availability\n\n* Accounts on the Enterprise plan or above\n\n#### Allowed For\n\n* Agents\n"
},
"response": [
{
"name": "Success response",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/custom_roles",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"custom_roles"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"custom_roles\": [\n {\n \"name\": \"<string>\",\n \"role_type\": \"<integer>\",\n \"configuration\": {\n \"assign_tickets_to_any_group\": \"<boolean>\",\n \"chat_access\": \"<boolean>\",\n \"end_user_list_access\": \"<string>\",\n \"end_user_profile_access\": \"<string>\",\n \"explore_access\": \"<string>\",\n \"forum_access\": \"<string>\",\n \"forum_access_restricted_content\": \"<boolean>\",\n \"group_access\": \"<boolean>\",\n \"light_agent\": \"<boolean>\",\n \"macro_access\": \"<string>\",\n \"manage_business_rules\": \"<boolean>\",\n \"manage_contextual_workspaces\": \"<boolean>\",\n \"manage_dynamic_content\": \"<boolean>\",\n \"manage_extensions_and_channels\": \"<boolean>\",\n \"manage_facebook\": \"<boolean>\",\n \"manage_organization_fields\": \"<boolean>\",\n \"manage_ticket_fields\": \"<boolean>\",\n \"manage_ticket_forms\": \"<boolean>\",\n \"manage_user_fields\": \"<boolean>\",\n \"moderate_forums\": \"<boolean>\",\n \"organization_editing\": \"<boolean>\",\n \"organization_notes_editing\": \"<boolean>\",\n \"report_access\": \"<string>\",\n \"side_conversation_create\": \"<boolean>\",\n \"ticket_access\": \"<string>\",\n \"ticket_comment_access\": \"<string>\",\n \"ticket_deletion\": \"<boolean>\",\n \"ticket_editing\": \"<boolean>\",\n \"ticket_merge\": \"<boolean>\",\n \"ticket_tag_editing\": \"<boolean>\",\n \"twitter_search_access\": \"<boolean>\",\n \"user_view_access\": \"<string>\",\n \"view_access\": \"<string>\",\n \"view_deleted_tickets\": \"<boolean>\",\n \"voice_access\": \"<boolean>\",\n \"voice_dashboard_access\": \"<boolean>\"\n },\n \"created_at\": \"<dateTime>\",\n \"description\": \"<string>\",\n \"id\": \"<integer>\",\n \"team_member_count\": \"<integer>\",\n \"updated_at\": \"<dateTime>\"\n },\n {\n \"name\": \"<string>\",\n \"role_type\": \"<integer>\",\n \"configuration\": {\n \"assign_tickets_to_any_group\": \"<boolean>\",\n \"chat_access\": \"<boolean>\",\n \"end_user_list_access\": \"<string>\",\n \"end_user_profile_access\": \"<string>\",\n \"explore_access\": \"<string>\",\n \"forum_access\": \"<string>\",\n \"forum_access_restricted_content\": \"<boolean>\",\n \"group_access\": \"<boolean>\",\n \"light_agent\": \"<boolean>\",\n \"macro_access\": \"<string>\",\n \"manage_business_rules\": \"<boolean>\",\n \"manage_contextual_workspaces\": \"<boolean>\",\n \"manage_dynamic_content\": \"<boolean>\",\n \"manage_extensions_and_channels\": \"<boolean>\",\n \"manage_facebook\": \"<boolean>\",\n \"manage_organization_fields\": \"<boolean>\",\n \"manage_ticket_fields\": \"<boolean>\",\n \"manage_ticket_forms\": \"<boolean>\",\n \"manage_user_fields\": \"<boolean>\",\n \"moderate_forums\": \"<boolean>\",\n \"organization_editing\": \"<boolean>\",\n \"organization_notes_editing\": \"<boolean>\",\n \"report_access\": \"<string>\",\n \"side_conversation_create\": \"<boolean>\",\n \"ticket_access\": \"<string>\",\n \"ticket_comment_access\": \"<string>\",\n \"ticket_deletion\": \"<boolean>\",\n \"ticket_editing\": \"<boolean>\",\n \"ticket_merge\": \"<boolean>\",\n \"ticket_tag_editing\": \"<boolean>\",\n \"twitter_search_access\": \"<boolean>\",\n \"user_view_access\": \"<string>\",\n \"view_access\": \"<string>\",\n \"view_deleted_tickets\": \"<boolean>\",\n \"voice_access\": \"<boolean>\",\n \"voice_dashboard_access\": \"<boolean>\"\n },\n \"created_at\": \"<dateTime>\",\n \"description\": \"<string>\",\n \"id\": \"<integer>\",\n \"team_member_count\": \"<integer>\",\n \"updated_at\": \"<dateTime>\"\n }\n ]\n}"
}
]
}