Assigned topics via API

For reporting, I need to regularly receive a list of assigned topics for each user, for further processing.
This is easy to get if you go to the browser at:
https://example.com/latest?assigned=<USERNAME>
But this is an HTML page in the browser, not the data in the JSON that I can work with.

I tried this request through the API:
curl -H 'Accept: application/json' https://example.com/latest?assigned=<USERNAME>
But through the API, the request gives the entire list of the latest topics, both designated and not.

The amateurish excavations in the source code of the plugin brought the following address:
curl -H 'Accept: application/json' https://example.com/assign/assigned.json
But this request gives out generally all assigned topics in the entire history of the forum. I have to search by username in the result.

Can’t you somehow immediately get a list of recently assigned topics to the ыудусеув user, through the API?

1 Like

Do you have the assigns_public setting enabled? If not, you will need to add an API key to your request.

1 Like

I just omitted this part. ))))))) Of course, I add the API key to the request. I do through Postman.

curl -X GET \
  'https://example.com/assign/assigned.json' \
  -H 'Accept: application/json' \
  -H 'Api-Key: 7be7........199' \
  -H 'Cache-Control: no-cache'
2 Likes

:+1: and did you add the same Api key header when requesting the latest.json?assigned=username route?

4 Likes

A! Do you mean to add the API key to the first request?
curl -H 'Accept: application/json' https://example.com/latest?assigned=<USERNAME>

2 Likes

Wow! It’s works! Thanks! ))))

3 Likes

This topic was automatically closed after 5 hours. New replies are no longer allowed.