Display Zendesk users
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize and forest-express-mongoose Node.js agents that will soon reach end-of-support.
forest-express-sequelize v9 and forest-express-mongoose v9 are replaced by @forestadmin/agent v1.
Please check your agent type and version and read on or switch to the right documentation.
This is still the latest Ruby on Rails documentation of the forest_liana agent, you’re at the right place, please read on.
This is the documentation of the django-forestadmin Django agent that will soon reach end-of-support.
If you’re using a Django agent, notice that django-forestadmin v1 is replaced by forestadmin-agent-django v1.
If you’re using a Flask agent, go to the forestadmin-agent-flask v1 documentation.
Please check your agent type and version and read on or switch to the right documentation.
This is the documentation of the forestadmin/laravel-forestadmin Laravel agent that will soon reach end-of-support.
If you’re using a Laravel agent, notice that forestadmin/laravel-forestadmin v1 is replaced by forestadmin/laravel-forestadmin v3.
If you’re using a Symfony agent, go to the forestadmin/symfony-forestadmin v1 documentation.
Please check your agent type and version and read on or switch to the right documentation.
Display Zendesk users
This section shows you how to create a smart collection to list the users of your Zendesk account.
Declare the Smart Collection Zendesk Users
Zendesk API allows to access different data:
Organizations and Groups
First, we need to declare the smart collection in your project based on the API documentation. As an example, here the smart collection definition for Users:
const { collection } = require('forest-express-sequelize');
// Search on users => https://support.zendesk.com/hc/en-us/articles/203663216-Searching-users-groups-and-organizations#topic_duj_sbb_vc
collection('zendesk_users', {
isSearchable: true,
actions: [],
fields: [
{
field: 'id',
type: 'String',
isFilterable: false, // Zendesk API does not provide such capacity with the API
},
{
field: 'name',
type: 'String',
isFilterable: true,
},
{
field: 'alias',
type: 'String',
},
{
field: 'email',
type: 'String',
isFilterable: true,
},
{
field: 'role',
type: 'Enum',
enums: ['end-user', 'agent', 'admin'],
isFilterable: true,
},
{
field: 'role_type',
type: 'Number',
},
{
field: 'phone',
type: 'String',
isFilterable: true,
},
{
field: 'whatsapp',
type: 'String',
isFilterable: true,
},
{
field: 'last_login_at',
type: 'Date',
},
{
field: 'verified',
type: 'Boolean',
},
{
field: 'active',
type: 'Boolean',
},
{
field: 'suspended',
type: 'Boolean',
isFilterable: true,
},
{
field: 'created_at',
type: 'Date',
isSortable: true,
},
{
field: 'updated_at',
type: 'Date',
isSortable: true,
},
{
field: 'last_login_at',
type: 'Date',
},
{
field: 'notes',
type: 'String',
isFilterable: true,
},
{
field: 'details',
type: 'String',
isFilterable: true,
},
{
field: 'tags',
type: ['String'],
isFilterable: true, // is it possible? => no arrays are not yet filterable
},
{
field: 'time_zone',
type: 'String',
},
{
field: 'moderator',
type: 'Boolean',
},
{
field: 'external_id',
type: 'String',
isFilterable: true,
},
{
field: 'only_private_comments',
type: 'Boolean',
},
{
field: 'photo_url',
type: 'File',
get: (user) => {
return user.photo ? user.photo.content_url : null;
},
},
],
segments: [],
});Implement the Smart Collection route
In the file routes/zendesk-users.js, we’ve created a new route to implement the API behind the Smart Collection.
The logic here is to list all the users of your Zendesk account.
Implement the get Route
The section above help you display the list of all Zendesk users. But you'll need to implement also the logic to display the information of a specific user.
We just need to implement a new endpoint to get an individual user from the Zendesk API.
Last updated
Was this helpful?