Searching with the Zendesk API Follow

Comments

13 comments

  • Avatar
    Jehan

    Hi,


    I am having problem sorting the search result for Article. Sort_by and order_by are not working for help center search api. Here is the api request url.


    /api/v2/help_center/articles/search.json?section=115000143525,203213189&sort_by=created_at&sort_order=desc&include=sections&per_page=4


    I don't know how the results returned through search api are sorted. I want the latest articles to come first and then so on.


    Thanks,


    Jehan

  • Avatar
    Pankaj Moholkar

    Is there a way to post search string to ZenDesk search page from external application, so that we can display results on https://subdomain.zendesk.com/agent/search page?

  • Avatar
    Rebecca

    Hi Pankaj- 

    The url for in-product Support search is not modified to include the search parameters when a search occurs so it would not be possible to implement this type of behavior from an external tool. Our Search API would offer this functionality programmatically .../api/v2/search.json?query={search_string}. However, I am not sure I fully understand your use case so feel free to elaborate and I'd be happy to see what we can offer!

  • Avatar
    Pankaj Moholkar

    Hi Rebecca,


    If not url parameter, can I POST the search-text in JSON package (or something like that) to some URL, so that it opens ZenDesk search page with results?


    Basically, I want to execute the same action as the searchbox in ZenDesk UI and display results on the search page. But I want to be able to do it from my application. i.e. If I click on a link, it should redirect to ZenDesk search page with the link text and fetch results for that text. Can I use some json/action/page to POST the serach-text to the search page?


    Yes, I can fetch results using search APIs and display it on my own UI but that will be probably the last option.


    Thanks for your help.

  • Avatar
    Rebecca

    Thank you for the additonal context, Pankaj!


    After reading over what you're hoping to do, unfortunately I am not aware of any method to accomplish this workflow using an Zendesk App or an external application. The Search API is likely the best option we offer at this time. 

  • Avatar
    UserAdmin #55555

    Is there a way I can query for the json result of all my custom ticket field entries for "Custom field ID 2967xx97"?

     

  • Avatar
    Bryan Flynn

    No, not right now at least (Aug 2018). You can do a search against custom fields using the "fieldvalue" keyword but it searches across all custom fields. This is a known limitation that our team is looking into but no ETA on when field specific searches might become available.

  • Avatar
    Mike C

    I'm getting inconsistent results from the search API.   Tickets in our system have several custom files.  One of them is a group ID.  There is only one ticket with status < closed with a given group ID.  At one point in our workflow, an agent will set the ticket to the Solved status.  I have an app that finds the ticket in the Solved status and sets the status to Open using the Core API.  If I immediately search for that ticket in the search API only on the group ID, I find it with the Open status.  If I search for that ticket with the Group ID and  with "status<pending", nothing is returned.  After some period of time, this query will return ticket.  But if I query immediately after the update, nothing is found.  Is this expected behavior?  

  • Avatar
    Joseph May

    Hi Mike-

    Yes this is expected. As documented under our Core API:

    Note: It can take up to a few minutes for new tickets, users, and other resources to be indexed for search. If new resources don't appear in your search results, wait a few minutes and try again.

  • Avatar
    Mike C

    Thanks Joseph-

    Just to clarify, does this apply to updates as well as new tickets?

  • Avatar
    Joseph May (Edited )

    Sure Mike, and yes, it does - though I can see why you would need to ask this, as we specify only 'new'. We document it elsewhere, as new or modified. This has also been my experience.

  • Avatar
    Francisco Oirdobro (Edited )

    Hi,

    is there a way to search with the API using AJAX?

    Thanks

  • Avatar
    Bryan Flynn (Edited )

    Hi Francisco. Yes, Zendesk APIs can be called via AJAX. I'd check out the API Getting Started section of the docs and start with an overview. If you have follow-up questions, you can post to the online REST APIs community topic or reach us at support@zendesk.com.

    I just found this article, too, that gives an AJAX example: Adding KB search to your website with AJAX

Please sign in to leave a comment.

Powered by Zendesk