Assigned teams with API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • enricorossa
    Senior Member
    • Jul 2018
    • 125

    Assigned teams with API


    Hi all, I am using API Client Implementation in PHP to update accounts from other software but I am getting this error

    Code:
    Uncaught exception 'Exception' with message 'Not valid data. Field: teams, validation type: required

    my code is

    Code:
    $response = $client->request('POST', 'Account', [ 'name' => 'Test', 'assignedUserId' => '603cc16ca3349fd59', 'teamsIds' => '5d138a5a072c161fc', ]);
    ids coincide with existing user and team


    on another entity where the team is not required it works by passing only assigneduserids



    thank you
  • AgentT
    Member
    • Aug 2021
    • 77

    #2
    I think "teamsIds" must be an array so it should be something like 'teamsIds' => ['5d138a5a072c161fc'].

    Cheers!

    Comment

    • enricorossa
      Senior Member
      • Jul 2018
      • 125

      #3


      I have already tried even so, I can't figure out what to pass, if the teams or teamsIds field, I assume it should work like the assignedUser field, where passing assignedUserId works but with teams, teamsIds, teamsId it doesn't work



      Do you know if there is a list or manual that indicates which fields to use with API for the various entities?

      Comment


      • AgentT
        AgentT commented
        Editing a comment
        Sorry I am not entirely familiar with the API Client Implementation of ESPO.
    • enricorossa
      Senior Member
      • Jul 2018
      • 125

      #4

      I get it, he wants double quotes ["5d138a5a072c161fc"]

      Comment

      Working...