Announcement

Collapse
No announcement yet.

Creating a Knowledgebase Category via API - how to assign a team

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

  • Creating a Knowledgebase Category via API - how to assign a team

    I am trying to create a category in the knowledge base with a specific team assignment. However, I can't figure out how to do the team assignment. Creating the category works as expected, but the team field is empty. I don't see the relationship in the database and I have not been able to figure it out by inspecting the code. Any help would be greatly appreciated.

    Also, what is the childList field in the KB category? I am using the following JSON to create a category and it seems to work fine, but there are a lot more fields in the GET request for the category list:

    Code:
    body = {
      "name": "Test".
      "order": 10,
      "parentId": 123...,
    }

  • #2
    I figured out which table is being updated by printing every insert/update sql statement from application/Espo/ORM/DB/Mapper.php. I added the team and this showed up in the log:

    Code:
    INSERT INTO `entity_team` (entity_id, team_id, entity_type) VALUES ('5e8219a00abb3aba2', '59d1a33398d9c96b4', 'KnowledgeBaseCategory')
    However, I still don't know how to assign a team to the new category via API call.
    Last edited by bandtank; 03-30-2020, 05:04 PM.

    Comment


    • #3
      I found an old post: https://forum.espocrm.com/forum/deve...m-via-api-post

      In short, add a teamsId array:
      Code:
      body = {  
        "name": "Test".
        "order": 10,
        "parentId": 123...,
        "teamsIds": ["123...", "456..."],
      }

      Comment

      Working...
      X