Forum Discussion

jpierlot's avatar
6 years ago

Create a board through API

Hello,

 

I would like to create a board through API but I get an error message:

 

curl -X POST \
> 'https://domain.lithium.com/restapi/vc/categories/id/<category_id>/nodes/type/key/board/add?board.id=test&board.title=title' \
> -H 'content-type: application/json' \
> -H 'li-api-session-key:SESSION_KEY'


<response status="error">
<error code="100">
<message>
Une erreur inattendue s&apos;est produite.
</message>
</error>
</response>

 

When I do a get on /restapi/vc/categories/id/<category_id>/nodes/type/key/board/ it renders the list of boards but POST does not work. 

 

Could someone help me please? 

 

Thank you! 

 

  • jpierlot,

    You can use V2 API to create board and add description as well.

    Session Key
    curl -X POST \ https://[COMMUNITY DOMAIN]/api/2.0/boards \ -H 'content-type: application/json' \ -H 'li-api-session-key: [SESSION KEY]' \ -d '{ "data": { "type": "board", "id": "DeveloperDiscussion", "conversation_style": "forum", "title": "Developer Discussions", "parent_category": { "id": "DevNetwork" } } }'
  • jpierlot,

    Use below API to create board.

    /categories/id/<category_id>/boards/add?board.id=<board_id>&board.title=<board_title>
    • jpierlot's avatar
      jpierlot
      Guide

      Thanks it works great. If I want to add the description, I added &board.description=lorem%20ipsum but nothing is saved.

      /restapi/vc/categories/id/<id>/boards/add?board.id=id&board.title=title&board.description=lorem

       

      Do you have any idea on that part?

      • Parshant's avatar
        Parshant
        Boss

        jpierlot,

        You can use V2 API to create board and add description as well.

        Session Key
        curl -X POST \ https://[COMMUNITY DOMAIN]/api/2.0/boards \ -H 'content-type: application/json' \ -H 'li-api-session-key: [SESSION KEY]' \ -d '{ "data": { "type": "board", "id": "DeveloperDiscussion", "conversation_style": "forum", "title": "Developer Discussions", "parent_category": { "id": "DevNetwork" } } }'