All URIs are relative to https://localhost:8080/api/v9
Method | HTTP request | Description |
---|---|---|
delete_workspace_sso | DELETE /workspaces/{workspace_id}/sso | Erase a workspace SSO configuration |
get_saml2_login_url | GET /auth/saml2/login | SAML2 Identity Provider URL |
get_workspace_sso | GET /workspaces/{workspace_id}/sso | Workspace SSO configuration |
me_sessions_delete | DELETE /me/sessions | Delete session |
me_sessions_post | POST /me/sessions | Create session |
patch_workspace_sso | PATCH /workspaces/{workspace_id}/sso | Enable/disable the Workspace SSO configuration |
post_enable_sso | POST /me/enable_sso | Confirm SSO enabling for user account |
post_reset_token | POST /me/reset_token | ResetToken |
post_saml2_callback | POST /auth/saml2/login/{workspace_id} | SAML2 Identity Provider Callback |
post_signup | POST /signup | Signup |
post_workspace_sso | POST /workspaces/{workspace_id}/sso | Workspace SSO configuration |
str delete_workspace_sso(workspace_id)
Erase a workspace SSO configuration
Remove the SSO configuration for a workspace.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
workspace_id = 56 # int | Numeric ID of the workspace
try:
# Erase a workspace SSO configuration
api_response = api_instance.delete_workspace_sso(workspace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->delete_workspace_sso: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
workspace_id | int | Numeric ID of the workspace |
str
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Saml2LoginResponse get_saml2_login_url(email, client=client, state=state)
SAML2 Identity Provider URL
Returns the SSO URL given an email address for authenticating in an Identity Provider.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
email = 'email_example' # str | User email
client = 'client_example' # str | Client identification (webapp/toggl-button/client) TODO: add desktop identification (optional)
state = 'state_example' # str | State to be preserved when redirecting to Accounts API (optional)
try:
# SAML2 Identity Provider URL
api_response = api_instance.get_saml2_login_url(email, client=client, state=state)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->get_saml2_login_url: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
str | User email | ||
client | str | Client identification (webapp/toggl-button/client) TODO: add desktop identification | [optional] |
state | str | State to be preserved when redirecting to Accounts API | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SsoConfigResult get_workspace_sso(workspace_id)
Workspace SSO configuration
Returns the SSO configuration for a workspace.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
workspace_id = 56 # int | Numeric ID of the workspace
try:
# Workspace SSO configuration
api_response = api_instance.get_workspace_sso(workspace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->get_workspace_sso: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
workspace_id | int | Numeric ID of the workspace |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
me_sessions_delete()
Delete session
Deletes a session used for authenticating the current request
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
try:
# Delete session
api_instance.me_sessions_delete()
except ApiException as e:
print("Exception when calling AuthenticationApi->me_sessions_delete: %s\n" % e)
This endpoint does not need any parameter.
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ModelsUser me_sessions_post(session_post=session_post)
Create session
Creates a session and sets a cookie in the response header which can be used for authentication in API requests
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
session_post = toggl.MePostSessionHandlerRequestBody() # MePostSessionHandlerRequestBody | Session preferences (optional)
try:
# Create session
api_response = api_instance.me_sessions_post(session_post=session_post)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->me_sessions_post: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
session_post | MePostSessionHandlerRequestBody | Session preferences | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SsoState patch_workspace_sso(workspace_id, settings)
Enable/disable the Workspace SSO configuration
Enable/Disable the SSO configuration for a workspace.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
workspace_id = 56 # int | Numeric ID of the workspace
settings = toggl.SsoState() # SsoState | SAML2 enable flag
try:
# Enable/disable the Workspace SSO configuration
api_response = api_instance.patch_workspace_sso(workspace_id, settings)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->patch_workspace_sso: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
workspace_id | int | Numeric ID of the workspace | |
settings | SsoState | SAML2 enable flag |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str post_enable_sso(enable_sso_post)
Confirm SSO enabling for user account
Confirm SSO enabling in existing Toggl account after successful SSO
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: BasicAuth
configuration = toggl.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = toggl.AuthenticationApi(toggl.ApiClient(configuration))
enable_sso_post = toggl.SsoConfirmation() # SsoConfirmation | SSO enabling confirmation data
try:
# Confirm SSO enabling for user account
api_response = api_instance.post_enable_sso(enable_sso_post)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->post_enable_sso: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
enable_sso_post | SsoConfirmation | SSO enabling confirmation data |
str
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str post_reset_token()
ResetToken
Resets API token for the current user.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: BasicAuth
configuration = toggl.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = toggl.AuthenticationApi(toggl.ApiClient(configuration))
try:
# ResetToken
api_response = api_instance.post_reset_token()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->post_reset_token: %s\n" % e)
This endpoint does not need any parameter.
str
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_saml2_callback(workspace_id, saml_response, relay_state=relay_state)
SAML2 Identity Provider Callback
Receives the IdP Callback containing the SAML2 assertion with response of user authentication in the IdP.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
workspace_id = 56 # int | Numeric ID of the workspace
saml_response = 'saml_response_example' # str | SAML2 assertion with authentication response
relay_state = 'relay_state_example' # str | Encoded string containing client and host which originated the requests (optional)
try:
# SAML2 Identity Provider Callback
api_instance.post_saml2_callback(workspace_id, saml_response, relay_state=relay_state)
except ApiException as e:
print("Exception when calling AuthenticationApi->post_saml2_callback: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
workspace_id | int | Numeric ID of the workspace | |
saml_response | str | SAML2 assertion with authentication response | |
relay_state | str | Encoded string containing client and host which originated the requests | [optional] |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ModelsTogglUser post_signup(post_user)
Signup
Sign up as a new user.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
post_user = toggl.MePostUser() # MePostUser | authorization data
try:
# Signup
api_response = api_instance.post_signup(post_user)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->post_signup: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
post_user | MePostUser | authorization data |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ModelsSSOConfig post_workspace_sso(workspace_id, settings)
Workspace SSO configuration
Save the SSO configuration for a workspace.
from __future__ import print_function
import time
import toggl
from toggl.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = toggl.AuthenticationApi()
workspace_id = 56 # int | Numeric ID of the workspace
settings = toggl.ModelsSSOConfig() # ModelsSSOConfig | SAML2 config parameters
try:
# Workspace SSO configuration
api_response = api_instance.post_workspace_sso(workspace_id, settings)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->post_workspace_sso: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
workspace_id | int | Numeric ID of the workspace | |
settings | ModelsSSOConfig | SAML2 config parameters |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]