Write API v3 - Changing category permissions

Technical Support

Suggested Topics


  • 0 Votes
    24 Posts
    401 Views

    @julian Thanks !

  • /api/search

    Technical Support
    0 Votes
    1 Posts
    151 Views

    new nodebb user here, running v1.16.1 locally with redis. I can't figure out how to use the search api, keep getting denied:

    using the /admin/settings/api token i get 401 "A valid login session was not found.": curl -v -H 'Authentication: Bearer 633d1f38-8576-4ce1-bd2c-c799a474b763' -H 'Authorization: Bearer 633d1f38-8576-4ce1-bd2c-c799a474b763' 'localhost:4567/api/search?term=restless&in=categories&uid=2' using the write-api token i get 403 forbidden 'You are not authorised to make this call": curl -v -H 'Authentication: Bearer 053b0157-04b4-4bfa-b502-211be5a61e7d' -H 'Authorization: Bearer 053b0157-04b4-4bfa-b502-211be5a61e7d' 'localhost:4567/api/search?term=restless&in=categories&uid=1'

    interestingly without the 'in=categories' it return 200 but no search results: curl -v -H 'Authentication: Bearer 053b0157-04b4-4bfa-b502-211be5a61e7d' -H 'Authorization: Bearer 053b0157-04b4-4bfa-b502-211be5a61e7d' 'localhost:4567/api/search?term=restless&uid=1'

    So what's the correct way to use the search api? and why does it require a token at all? Is it possible to open the search api for non authenticated users and then search just the public categories?

  • 1 Votes
    15 Posts
    865 Views

    @mickola well yes, the second hook should also work, but either one should work for what you're doing.

  • 0 Votes
    1 Posts
    394 Views

    hi guys, I want to know how do I have to complete these:

    RL used to access this NodeBB (http://localhost:4567) : ¿my domain or my droplet ip? ¿which port? Host IP or address of your MongoDB instance (127.0.0.1): ¿my droplet ip? Host port of your MongoDB instance (27017): ¿and here?

    ps. I have an ubuntu droplet in digital ocean + domain.

  • 0 Votes
    2 Posts
    2k Views

    If you go into the ACP and change the behaviour of teaser to "first", then the API will return data for the original post only.