Write-enabled API (Brainstorming)

NodeBB Development

Suggested Topics


  • 0 Votes
    3 Posts
    1k Views

    I already have the array of topic IDs. I want to retrieve all of those topics by their IDs.

    My current solution is to just loop through the array and do a fetch on the api for each ID individually, and then use a Promise.all to return the finished batch to my client middleware. Making separate http requests for each one is less desirable though, and I would prefer to get them all in a single fetch if possible.

  • 0 Votes
    2 Posts
    731 Views

    The API route doesn't render a template. It just outputs the JSON that is passed into render.

    You can test this by prepending /api on any route, you'll see JSON output.

    The purpose of this is for the AJAX loading of the next page.

  • 0 Votes
    2 Posts
    2k Views

    Went ahead and made the changes already 😆

  • 0 Votes
    2 Posts
    1k Views

    https://community.nodebb.org/api/users gives you the latest registered users.

  • Add PHP API

    NodeBB Development
    0 Votes
    32 Posts
    17k Views
    <?php class nodebb { function category_add ($params='name=Default category name', $token='e9de6fb6-1234-5678-8bbc-b5073fd1edef'){ shell_exec('/usr/bin/curl -H "Authorization: Bearer '.$token.'" --data "'.$params.'" http://localhost:4567/forum/api/v1/categories'); } } $nodebb = new nodebb; $nodebb->category_add(); return false;

    Now it's much easier 🙂