Obtaining discussions assigned to current user via API
Hi all,
I'm looking at /discussions/pending in the API, but
user_current=1 returns all discussions visible to that
user. Is there a way to get all discussions assigned to the current
(API token owner) user?
Thanks,
Troy
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

1 Posted by Nicole on 18 Sep, 2013 02:31 PM
Troy -
You'll see in the User section of the API docs how to get a specific single user - https://help.tenderapp.com/kb/api/users - and within those results, how to get all discussions for that user under the
discussions_hrefvariable. Let us know if you have any questions.Thanks,
Nicole
Nicole closed this discussion on 18 Sep, 2013 02:31 PM.
Troy re-opened this discussion on 18 Sep, 2013 03:22 PM
2 Posted by Troy on 18 Sep, 2013 03:22 PM
Hi Nicole,
Thanks for the prompt reply. Is that discussions assigned to the user in
question, or discussions visible to them? The users API doc page you linked
to says "by this user," so I'm not sure whether that's opened by them,
visible to them, or assigned to them (what I'm after).
If it helps, the users API doc page links to the discussions doc, and the
discussions doc has a similar problem but with a different word:
"Discussions For User." :-)
If it's easier than explaining to me, feel free to change either or both
pages to explain which of the 3 the 2 calls returns and I'll re-RTFM.
Thanks,
Troy
3 Posted by Nicole on 18 Sep, 2013 03:52 PM
Troy -
The way I'm reading the docs, it's all the discussion by the user, ie, the same tickets you'd see when you're on their profile page.
If you're looking for all discussions assigned to a support user, then that is just a queue - https://help.tenderapp.com/kb/api/queues - where the name would be whatever the user's name is.
Thanks,
Nicole
4 Posted by Troy on 18 Sep, 2013 04:06 PM
Hi Nicole,
I don't think it's what you described. I'm looking at the profile page for the token owner, with "Open" checked (https://my.tenderapp.com/profile?pending=1), and I'm seeing a far larger set of tickets than
discussions/pending?user_current=1returns.I see hundreds of tickets on the token owner's profile page, and 30 via the API.
All 3 of the links at the top of that page (Unread, Open, All) return far more tickets than the API target.
Just from looking around and the fact that the count matches, I'm fairly sure that
discussions/pendingreturns the same as what's on https://my.tenderapp.com/dashboard (the "Pending" sidebar link). For clarity, I'm hittingdiscussions/pending?auth=abc123&per_page=100&user_current=1.The thing I don't understand is what
user_current=1is doing. I get the 30 pending tickets regardless.It feels like we're all guessing at what the docs mean. Can you check the source and update the docs so they're clear?
Thanks,
Troy
5 Posted by Julien on 18 Sep, 2013 06:53 PM
Hey Troy,
So:
https://api.tenderapp.com/yoursite/users/12345/discussionsreturns all the discussions created by this user.discussions/pending?user_current=1wouldn't work as those can't be mixed. It's the same call asdiscussions/pending.discussions?user_current=1anddiscussions?user_id=Xreturn discussions created by the user. I clarified the docs. To make it even clearer,users/X/discussions == discussions?user_id=XWhat you see on your profile page is all the discussions you are watching, which in effect is all the discussions you have access to. There isn't a simple way to obtain that information through the API right now.
Assigning a discussion to a user is really just assigning it to this user's queue. So if you want all the discussions assigned to user X, you need to do:
/queuesto get all the queues. You can then filter that list to find the queue Y that hasuser_id == X./queues/Y/discussionsto get all the discussions assigned to this user.Getting the assigned discussions is definitely much harder than it needs to be. I need, at the very least, to provide the queue ID/href when you query the user. That alone would go a long way. It's really not that difficult so I hope I'll get to it in the next few days, but that should get you started.
If you have any question, let me know.
6 Posted by Troy on 18 Sep, 2013 10:50 PM
Thanks, both of you. That's exactly what I needed to know. No problem at all, and if no changes come of it, at least I can figure out what's happening now :)
In utopia, the one call I'd want is a symbolic
/queues/minewhich does the lookup for me. I don't want it to save the second API call as much as because I don't have the user's ID and don't see a way of getting it (knowing just their API token, not email address). Best case, there's a way to turn token into user ID, worst case, the token alone isn't enough to navigate to the owner's queue.In that utopia, everything else I'd need is handled by the existing API, and I'd end up hitting
/queues/mine/discussions/pending.Cheers,
Troy
7 Posted by Troy on 18 Sep, 2013 10:50 PM
PS, thanks for thinking through this so thoroughly with me. I know some of these questions get into the weeds.
Troy
8 Posted by Julien on 18 Sep, 2013 11:50 PM
Hey Troy,
You can get the current user at
/profile. I'll add it to the KB.9 Posted by Julien on 25 Sep, 2013 07:05 PM
Hey Troy,
I just deployed a small change to the API: you can now use
mineinstead of a queue ID. I updated the docs as well.Let me know how it goes.
Cheers!
10 Posted by Julien on 25 Sep, 2013 07:10 PM
On the subject of tricks, I regularly use Echo to play with APIs and keep track of example requests. I wish it had
curlexport, but it's still practical as is. And it's only 4 bucks, so what's not to love :)11 Posted by Troy on 25 Sep, 2013 09:37 PM
Julien closed this discussion on 25 Sep, 2013 09:51 PM.
Troy re-opened this discussion on 14 Oct, 2013 04:53 PM
12 Posted by Troy on 14 Oct, 2013 04:53 PM
Hey Julien, one more tiny related question. Is there a way to obtain the set of pending discussions in the API token owner's queue? If not, no problem, I just wanted to check. Right now I'm using
/queues/mineand it works great, but still picks up resolved discussions. If the equivalent to/discussions/pendingexisted and was specific to/queues/mine, I'd use it instead.And thanks, too!
Troy
13 Posted by Julien on 14 Oct, 2013 05:02 PM
Try
/discusssions/pending?queue_id=mine. That should work.Julien closed this discussion on 18 Oct, 2013 10:59 PM.