2

Looking for an example of how to create a new user using the write API defined here: https://github.com/NodeBB/nodebb-plugin-write-api?files=1

Have tried: curl -H "Authorization: Bearer MASTER-TOKEN-HERE" --data "username=fredy&password=SomePassword123&email=fred@fredy.com&_uid=SOME-OTHER-TOKEN" http://localhost:4567/api/v1/users

I get unauthorized error. The MASTER TOKEN was generated using the Write API plugin. So was the SOME-OTHER-TOKEN (a user/token, generated when i clicked "create token button")

Any clues?

craig
  • 138
  • 2
  • 8

1 Answers1

2

Figured it out. The _uid is not a token. Its the user id. (obviously..) I just used _uid=1 (which was my admin id) and all worked fine!

craig
  • 138
  • 2
  • 8