Skip to content

Latest commit

 

History

History
471 lines (315 loc) · 12.5 KB

GoalsApi.md

File metadata and controls

471 lines (315 loc) · 12.5 KB

toggl.GoalsApi

All URIs are relative to https://localhost:8080/api/v9

Method HTTP request Description
goals_cadences_get GET /goals/cadences Get a list of goal cadences
goals_get GET /goals Get a list of goals
goals_goal_id_delete DELETE /goals/{goal_id} Delete one goal
goals_goal_id_get GET /goals/{goal_id} Get one goal
goals_goal_id_patch PATCH /goals/{goal_id} Update a Goal
goals_goal_id_stats_get GET /goals/{goal_id}/stats Get stats for a goal
goals_insight_post POST /goals/insight Get a insight
goals_post POST /goals Create a Goal

goals_cadences_get

list[GoalsCadenceResponse] goals_cadences_get(amount=amount, archived=archived, goal=goal, offset=offset)

Get a list of goal cadences

Gets all cadences for the goals requested for the asking user.

Example

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.GoalsApi(toggl.ApiClient(configuration))
amount = 56 # int |  (optional)
archived = 'archived_example' # str |  (optional)
goal = [56] # list[int] |  (optional)
offset = 56 # int |  (optional)

try:
    # Get a list of goal cadences
    api_response = api_instance.goals_cadences_get(amount=amount, archived=archived, goal=goal, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_cadences_get: %s\n" % e)

Parameters

Name Type Description Notes
amount int [optional]
archived str [optional]
goal list[int] [optional]
offset int [optional]

Return type

list[GoalsCadenceResponse]

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_get

list[ModelsPlainGoal] goals_get(archived=archived, workspace_id=workspace_id)

Get a list of goals

Gets all goals for the requesting user. The returned Goal will have only one type, but may have multiple on the same type, like 3 projects, or more than one task. Billable will always be one.

Example

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.GoalsApi(toggl.ApiClient(configuration))
archived = 'false' # str |  (optional) (default to false)
workspace_id = 56 # int |  (optional)

try:
    # Get a list of goals
    api_response = api_instance.goals_get(archived=archived, workspace_id=workspace_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_get: %s\n" % e)

Parameters

Name Type Description Notes
archived str [optional] [default to false]
workspace_id int [optional]

Return type

list[ModelsPlainGoal]

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_goal_id_delete

goals_goal_id_delete(goal_id)

Delete one goal

Delete a goal that belongs to the calling user

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal_id = 56 # int | Goal ID

try:
    # Delete one goal
    api_instance.goals_goal_id_delete(goal_id)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_goal_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
goal_id int Goal ID

Return type

void (empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_goal_id_get

ModelsPlainGoal goals_goal_id_get(goal_id)

Get one goal

Gets a goal that belongs to the calling user

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal_id = 56 # int | Goal ID

try:
    # Get one goal
    api_response = api_instance.goals_goal_id_get(goal_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_goal_id_get: %s\n" % e)

Parameters

Name Type Description Notes
goal_id int Goal ID

Return type

ModelsPlainGoal

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_goal_id_patch

ModelsGoal goals_goal_id_patch(goal)

Update a Goal

Update a goal with the updateable parameters given by UpdateParams

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal = toggl.GoalsUpdateParams() # GoalsUpdateParams | Goal details

try:
    # Update a Goal
    api_response = api_instance.goals_goal_id_patch(goal)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_goal_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
goal GoalsUpdateParams Goal details

Return type

ModelsGoal

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_goal_id_stats_get

ModelsGoalStats goals_goal_id_stats_get(goal_id)

Get stats for a goal

Gets stats for a given goal that must belong to the calling user

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal_id = 56 # int | Goal ID

try:
    # Get stats for a goal
    api_response = api_instance.goals_goal_id_stats_get(goal_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_goal_id_stats_get: %s\n" % e)

Parameters

Name Type Description Notes
goal_id int Goal ID

Return type

ModelsGoalStats

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_insight_post

GoalsInsightResponse goals_insight_post(goal)

Get a insight

Get data insight for user simulating how much the user would accomplish for a given Goal

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal = toggl.GoalsParamsInsight() # GoalsParamsInsight | Insight details

try:
    # Get a insight
    api_response = api_instance.goals_insight_post(goal)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_insight_post: %s\n" % e)

Parameters

Name Type Description Notes
goal GoalsParamsInsight Insight details

Return type

GoalsInsightResponse

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

goals_post

GoalsParamsCreate goals_post(goal)

Create a Goal

Create a Goal object with its parameters. goal_type field must contain either projects or billable object, not both, or null if the goal has workspace type.

Example

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.GoalsApi(toggl.ApiClient(configuration))
goal = toggl.ModelsPlainGoal() # ModelsPlainGoal | Goal details

try:
    # Create a Goal
    api_response = api_instance.goals_post(goal)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GoalsApi->goals_post: %s\n" % e)

Parameters

Name Type Description Notes
goal ModelsPlainGoal Goal details

Return type

GoalsParamsCreate

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]