URL Construction¶
API base URL¶
All API endpoints are rooted at:
Example: https://interacta.example.it/portal/api/external/v2/core/auth/current-user-data
Normalization rules¶
build_api_base() applies these rules in order:
- Strip whitespace from
base_urlandbase_path. - Ensure
base_urlhas a scheme (defaults tohttps://if omitted). - Strip trailing
/frombase_url. - If
base_pathis empty, use""; otherwise ensure it starts with/and has no trailing/. - Join segments with a single
/.
All four of these inputs produce the same canonical base https://host/portal/api/external/v2:
build_api_base("https://host", "/portal", 2)
build_api_base("https://host/", "portal", 2)
build_api_base("host", "/portal/", 2)
build_api_base("https://host//", "//portal//", 2)
Web URL helper¶
InteractaClient.web_urls generates deep-link URLs for use in dashboards or notifications.
Note the trailing slash on the user URL — this matches the Interacta web app routing.
client.web_urls.post(21269)
# "https://interacta.example.it/portal/post/21269"
client.web_urls.user(5225)
# "https://interacta.example.it/portal/admin/user/5225/"
client.web_urls.community(79)
# "https://interacta.example.it/portal/community/79"
client.web_urls.group(201)
# "https://interacta.example.it/portal/admin/group/201"
These URLs are also available via the CLI --web-url flag: