Announcement

Collapse
No announcement yet.

API - Adding a task

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • API - Adding a task

    Hi,

    I'v managed to create a task through the API. However, which 'keys' do I need to configure the assigned team and the account?


    Code:
    # Task data
    task_data = {
    "name": "New Task Title",
    "status": "00 - Ready to start",
    "description": "This is a new task created via API.",
    "assignedUserId": "1", # Replace with actual user ID
    "startDate": "2024-10-11T09:00:00",
    "dueDate": "2024-10-12T17:00:00",
    "priority": "Normal",
    "account": "Algemeen",
    "assignedTeam": "200 - Coordinatie"

    the last one: "assignedTeam" doesn't work and neither does "account"

  • #2
    Hi rfrancocantero,

    In this case, you need to use both the account and team IDs (keep in mind that the team ID will be in the array), as follows:
    Code:
    task_data = {
    "name": "New Task",
    "accountId": "account-id",
    "teamsIds": ["team-id"​]
    }

    Comment


    • #3
      Thanks! Is there an easy way to get the ID's of accounts?

      Comment


      • #4
        rfrancocantero,

        You can make a GET request with an account search by name before the POST request, and write the response in the variable $answer, for example. Keep in mind that in the response we will receive all the information about the account, so then you will need to get the found account ID and write it in another variable, for example, $accountID. After that, you can easily use the variable in the payload of the POST request.

        Comment

        Working...
        X