Getting discussion_href to sort by created_at and potentially to filter

Phillip Leslie's Avatar

Phillip Leslie

21 Mar, 2013 01:43 PM

Hello,

I've got a situation where multiple support reps need to each be served up "the oldest not-yet-replied-to discussion". Basically, what I'm aiming for, is:

  1. Sort discussions by created_at; oldest-to-newest
  2. Filter by only discussions that have 1 comment (i.e. just the initial comment from the customer, no replies from us)
  3. Then walk through the remaining list and apply one more internally-defined filter rule (the details of which are specific to our business + would be done locally on our server)
  4. Then, serve up the top discussion from the surviving list {the list after being sorted, filtered, internally-filtered} for the support rep to review and reply to

Steps 3 and 4 are obviously "on my end", but I'm hoping to find a clever way to get the TenderApp API to do 1 and 2 for me.

If I can't find a way to get TenderApp APIs to do 1 and 2, then it leaves me in a situation where I would be "polling" the entire set of open or new discussions, assembling the results of multiple paginated calls, and then doing all of the sorting and filtering on my end. Although I don't have any problem with server capacity for doing all of those operations, it's unpleasant because:

  • The latency of polling the entire set of open or new discussions is sure to be an aggravation to our support team
  • The server load to you would be abnoxious: our support workers need "the oldest not-yet-replied-to discussion" countless times during each day, and if each time results in a poll + assemble paginated results, that's surely an "unwelcome" amount of API calls

Can you give me any suggestions for doing steps 1 and 2 of my 4 step process, with the TenderApp APIs? I believe discussion_href currently lacks the ability to adjust per_page, and secondly I'm unclear about whether/not it supports any kind of sort-order changes (to sort on created_at instead of whatever the default sort order is).

Thanks in advance for your help. We're big fans of TenderApp (can you tell, by the fact that we're ready to get this dependent on it?).

  1. Support Staff 1 Posted by brandi on 21 Mar, 2013 06:41 PM

    brandi's Avatar

    Hi Phillip,

    We're so happy to hear that you're liking Tender! I'm going to pass you on to our API dev guru, Julien. He'll be in touch shortly.

    Thanks!
    Brandi

  2. 2 Posted by Julien on 21 Mar, 2013 07:08 PM

    Julien's Avatar

    Hi Phillip,

    You can get pretty close already by using the following parameters to your request:

    • state=new: this will return discussions that are open and which have not received any supporter response (though there might be more than one comment if they are all from users)

    • order=created: this will sort discussions by order of creation.

    Would that solve your use case?

  3. 3 Posted by Phillip Leslie on 21 Mar, 2013 09:52 PM

    Phillip Leslie's Avatar

    Julien,

    You've now opened my eyes to the distinction between new and open. Yes, that really helps. Secondly, I also did not know about the order arg, nor the created value for that arg.

    I think in one fell swoop you've basically solved this mystery for me. Thanks very much. Will let you know how it goes.

    -Phil

  4. Julien closed this discussion on 28 Mar, 2013 05:47 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac