Skip to content

Maybe we should always offer a "team_id" parameter? #16

@ricpol

Description

@ricpol

Several (Pygrister) apis don't expose a "team_id" parameter to allow changing the org/team id at runtime. Internally, they simply rely on "self.configurator.server" to construct the required url.
In fact, the equivalent Grist apis tend to be rather lenient: https://myteam.getgrist.com/api/profile/apikey will work, but https://bogus.getgrist.com/api/profile/apikey will work too :-/
However, Grist may become stricter in future and, even now, calling inspect() and finding out that we called a different url than expected may confuse the user.
For consistency, we should always expose a "team_id" argument, even if it is not necessary. Each function that now works like this:

def foo(self, ...):
    url = f'{self.configurator.server}/...'

should work like

def foo(self, ..., team_id=''):
    url = f'{self.configurator.make_server(team_id)}/...'

instead.

OR, all of this is actually wrong and we shouldn't offer a parameter that is not actually needed?

(besides, the opposite would be tricky too... removing the team_id parameter every time it's not actually needed in the underlying Grist api... ugh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions