Need a list of all users

Hello,

I’ve been asked to get a list of all our users, with emails and affiliations. I thought this would be a good use for the web api, so I’ve pip installed indico-client (version 6.8.0) and I’m trying one of the examples.

I’ve generated an api token for an admin account and saved it locally. The start of the script is:

#!/usr/bin/python3
from datetime import datetime, timedelta
from indico import IndicoClient, IndicoConfig
from indico.queries import JobStatus, RetrieveStorageObject
from indico.queries.usermetrics import (
    GetUserSummary,
    GetUserSnapshots,
    GenerateChangelogReport,
    GetUserChangelog,
)
from indico.types.user_metrics import UserSummary
config = IndicoConfig(
    host='indico.esa.int', # or your custom app location
    api_token_path='/home/cro/.config/indico.token' # path to your API token
    )
client = IndicoClient(config=config)

However, here it fails, trying to access “/auth/users/refresh_token”. Indeed this suburl does not exist.

Can someone please tell me what I have missed?

Alternatively, would I be better to use an sql quey on the database itself? In this case, is the database schema available?

Thanks for any help.

Chris

That sounds like a problem with your client. It seems to try to do OAuth when all it needs to do is passing the token as a bearer token (Authorization: Bearer indp_....).

Also, there is no API for what you are trying to do so I assume you have some custom plugin that exposes this?

The easiest way to do it if you have access to the Indico server is to just run a script there that can access the Indico models directly (more convenient than querying the database itself directly).

PS: I think indico is a really bad package name for this, since at first I was “wth is this, none of those things exist in the indico core”. Maybe call it indico_client or indico_api?

Thanks for the reply. I assumed the client was also from the indico team. I saw it on Getting Started with Indico's Python Client

Is there some documentation on the indico models? I do have access to the server.

Thanks,

Chris

indicodata.ai has NOTHING to do with Indico. they just “stole” our name …

there’s some autogenerated documentation on https://docs.getindico.io that includes that models