How can I retrieve a list of all teams? #124
-
Hi. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @LukasCBossert. If you want to do it via the command line, you can get a list of teams with just from elapi.api import GETRequest
session = GETRequest() # Define a HTTP session
teams = session("teams", endpoint_id=None) # First argument is the endpoint name. This line is when the GET request is actually sent.
# You don't necessarily have to pass endpoint_id=None, that's already the default.
# Replace None with a team ID, if you want information about that team only.
print(teams.json()) # Prints list of all teams as a list of Python dictionaries (each dictionary contains one team) Hope that helps. The following is not longer necessary since elAPI version
|
Beta Was this translation helpful? Give feedback.
Hi @LukasCBossert. If you want to do it via the command line, you can get a list of teams with just
elapi get teams
, or export it to a file withelapi get teams --format csv --export
. If you want to do it with Python, then the following: