How to assign multiple teams via API POST

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Boris.Huelsmann
    Junior Member
    • Apr 2021
    • 2

    How to assign multiple teams via API POST

    Hello,

    I am trying to create some entries via the API. Its just for testing, so just ignore the names.
    I created an own base entity ( named: Test), where I can assign mutliple teams.

    When I call my POST "http://localhost/espocrm/api/v1/Test" I want to assign mutliple Teams. I tried 2 Payloads, but both didn't work.
    The entries were created, but the assignment to the teams failed.

    Here are the paylods I tried:

    Code:
    {
    "assignedUserId":"1",
    "name":"tempwd4hj",
    "teamsNames":["1","2"]
    }
    Code:
    {
    "assignedUserId":"1",
    "name":"tempwd4hj",
    "teamsNames":[{"name":"1"},{"name":"2"}]
    }
    best regards
  • DEN
    Senior Member
    • Apr 2021
    • 106

    #2
    Hello,

    I think maybe this is a wrong syntax call.
    Did you checked whether the call and the syntax of the call are correct?

    Comment

    • Boris.Huelsmann
      Junior Member
      • Apr 2021
      • 2

      #3
      Hello,

      this is my question.
      I don't know if my syntax is correct or not. I don't get an error or something.
      The new entries are created, but the fields with multiple values are ignored.

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        Hello,
        To assign mutliple Teams you need to send in request ther IDs. Example:
        Code:
        {
            "assignedUserId":"1",
            "name":"tempwd4hj",
            "teamsIds":["6092f3c47ae9f91c1","6092f3c8336f9ad84"]
        }

        Comment

        Working...