zendesk / zendesk_api_client_rb

Official Ruby Zendesk API Client
http://developer.zendesk.com/
Apache License 2.0
387 stars 183 forks source link

How to access the User related information? #364

Closed mike663 closed 4 years ago

mike663 commented 6 years ago

The Zendesk API documentation describes user-related information at https://developer.zendesk.com/rest_api/docs/core/users#user-related-information that consists of "assigned_tickets", "requested_tickets", "ccd_tickets" and other data. The call they describe is:

GET /api/v2/users/{id}/related.json

How does one make the call to fetch that data using zendesk_api_client_rb? Thanks.

nogates commented 4 years ago

Hello @mike663 ! We are sorry for the delay!

We have just pushed a new version (1.24.0) that includes support to retrieve the user-related information... Here is how you can use it:


# find a user
user = client.users.search(:query => "user@example.org").first
# get the user related info 
user.related 
# returns a `ZendeskAPI::UserRelated` object

I am gonna close this, but do not hesitate to add a comment if you have any other question!