Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. Tags
    3. write-api
    Log in to post
    • dogs

      Write-API post as a Guest?
      NodeBB Plugins • api nodebb plugin request write-api • • dogs

      1
      0
      Votes
      1
      Posts
      41
      Views

      dogs

      Hey!

      Is it possible to post as Guest via the write API?

      I tried to reply to a topic via:

      const bodyParameters = { _uid: 0, content: "It works!" };

      But it does not work. Is it possible to post as a Guest and set a username with the request or is it only possible to use the write api with a existing uid?

      Looking forward to your answers.

    • Giggiux

      SOLVED extends nodebb write-api?
      NodeBB Plugins • plugindevelopment write-api • • Giggiux

      7
      0
      Votes
      7
      Posts
      2802
      Views

      Giggiux

      To anyone searching the same thing, I resolved the problem using the custom write-api hooks, I wasn't aware of:

      https://github.com/NodeBB/nodebb-plugin-write-api/blob/master/routes/v1/index.js#L45

      filter:plugin.write-api.routes

      that gives you data, I used it in this way:

      function(data, callback) { var app = data.router; var apiMiddleware = data.apiMiddleware; var middleware = data.middleware; var errorHandler = data.errorHandler; app.post('/route', apiMiddleware.requireUser, function(req, res) { // do stuff }); callback(null, { router: app }); };

      Obviously you should have nodebb-plugin-write-api installed.

    • Tilen Štraus

      Nodebb shuts down(502 bad gateway)
      NodeBB Development • google apps script javascript write-api • • Tilen Štraus

      3
      0
      Votes
      3
      Posts
      1648
      Views

      EnDylan

      Bad gateway might occur due to an incorrect setting in your Proxy.

      It is recommended by me to use Nginx as it is easy to setup and apparently automatically recovers after a bad gateway.

      What Operating System Are you using?

    • Tilen Štraus

      Write api inserting/updating tags doesn't work
      NodeBB Development • google apps script javascript tags write-api • • Tilen Štraus

      6
      0
      Votes
      6
      Posts
      2242
      Views

      julian

      @Tilen-Štraus Glad you got it working, and thank you for sharing your solution for others who may run into the same trouble 😄

    • Tanguy Bodin-Hullin

      [nodebb-plugin-write-api] Trouble when trying to add new user using the Write-API Plugin and CURL
      Technical Support • api curl token write-api • • Tanguy Bodin-Hullin

      14
      0
      Votes
      14
      Posts
      5548
      Views

      Tanguy Bodin-Hullin

      Thank you.
      I did disable the option in the API-write module, and now it's working in a shell terminal when I send the above CURL command.
      But when I try to use CURL in HTTPS within my PHP program,
      I get this message (401) : A valid login session was not found. Please log in and try again.
      I don't understand why I get this message, because :

      I'm sending the Master token in the Header by calling the PHP function curl_setopt with the option CURLOPT_HTTPHEADER I try to send the credentials (login/password) by calling the PHP function curl_setopt with the option CURLOPT_USERPWD and login/password.
    • Coman Cosmin

      Write API not working
      Technical Support • api write-api • • Coman Cosmin

      11
      0
      Votes
      11
      Posts
      3087
      Views

      Coman Cosmin

      @pitaj said:

      npm install

      It works now. Thanks a lot for your help. Would have never figured out by myself:)

      Awesome idea with this API btw, i almost gave up because i'm not familiar with nodejs, but when i found this plugin i realised that this is no longer an issue:)

      Great work guys

    • M

      Bulk upload plugin requested - bounty offered
      Plugin Requests • upload write-api • • mooreanswers

      5
      0
      Votes
      5
      Posts
      2803
      Views

      M

      Jonny
      Don't ever apologies for providing advice, that after all is why we are all here 👍 and the great thing about advice is that the user can choose what to do with it. In this case I shall be applying it to the letter.

      D

    • julian

      Write-enabled API (Brainstorming)
      NodeBB Development • brainstorm nodebb write-api • • Julian Lam

      23
      3
      Votes
      23
      Posts
      11225
      Views

      zaasmi

      @baris Please help
      nothing happened after save changes again at same screen.

      3e9f330e-3679-4261-a0ff-e37362fb5134-image.png