Skip to content

Is search supported? #54

@pehrlich

Description

@pehrlich

From what I can figure out, it looks like methods correspond to URLs, with some intelligence/guessing:

# the query option is silently dropped
# https://github.com/zendesk/zendesk_api_client_rb/issues/47 maybe?
> $zendesk.ticket(query: 'moon').first
get https://juniper.zendesk.com/api/v2/tickets

# typos are passed to ZenDesk API
> $zendesk.tickts(query: 'moon').first
get https://juniper.zendesk.com/api/v2/tickts?query=moon
the server responded with status 404
{"error"=>"InvalidEndpoint", "description"=>"Not found"}

# notice that user becomes users:
 > $zendesk.user(query: 'moon').count
get https://juniper.zendesk.com/api/v2/users?query=moon

$zendesk.search(query: 'moon').first
NoMethodError: undefined method `superclass' for ZendeskAPI::Search:Module

How would I run a search, such as the following (which is a valid call)?

# simple
curl "https://juniper.zendesk.com/api/v2/search.json?query=type:moon" -v -u email:pasword
# typed:
 curl "https://juniper.zendesk.com/api/v2/search.json?query=type:ticket%20moon" -v -u email:pasword

Edit: #29 suggests client.users.search(:query => email). How would I find this user's tickets?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions