Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

Wekan

Wekan is an open-source kanban board (Trello like) which allows a card-based task and to-do management.

Wekan / General

POST api user to board

POST api user to board

Wekan / General · January 13, 2020 at 8:41pm

If, through the api, I the create boards with lists and cards, in order for users to see those boards, I need to post the users to a board. I seem to have the syntax correct but am not getting a payload back from node.js . I get no error in the api and the boards, lists and cards get created but only the admin user whose token I am using can see them, just an empty data return (specifically a single empty object (is that the correct response)? When I look up the user I am trying to add to the board, I do not see the board I was trying to add them to. Is there an endpoint that shows either all the users for a board or all the boards for a user?

Is there any way to determine what its doing if I am not getting an error back? If I post the boards with lists and cards the lead admin can see it. If they invite an existing user (in the GUI) (the other user (the only other user in the system) is chosable, then that user indicates they failed to get an e-mail but it says they joined and when you switch logins and login in as the other user you see the board with an accept deny prompt super imposed. But when you look up that user you do not see board accepted.

How do I get error messages? How do I see board a user has accepted? What else can I do to troubleshoot this. the body I am user is isadmin false, commentsonly false, no comments false. url is api/boards/h3F93g2YviwC3J7KJ/members/SXLP3KJme9d4uCo5q/add

What else can I do to troubleshoot this? where is the log file that show the error? Thanks again

Load previous messages

January 14, 2020 at 7:43am

You can change that REST API code to return correct result, by providing pull request. I don't even know how many different Wekan contributors have participated to creating current API. Someone added some per-user non-admin API. Improvements welcome.

    • reply
    • like

    sudo snap set wekan debug='true' && sudo snap logs wekan.wekan

      • reply
      • like

      January 14, 2020 at 1:15pm

      Thank you again, sir. I appreciate the info. Rather than me asking another question, is there any chance a map exists on where to find stuff in a ubuntu snap distribution of wekan ;) I turned on the logs now I start searching for the logs. I look under /var and the /snap links and then under common, the number folder and current ..... :) With regard to my issue is I have not been able to get the api to add any user to any board. Board creation, lists, cards No problem. Each return info on what was created (as you need the ids return to manipulate things further.) With user to a board I get back an empty object and I do not turn on in any way the new user to the new board.The root admin sees the board but not the one I am api creating/adding to the board. When I add that user in the GUI is does as I described it supers an accept or deny over the new board, so I know you can attach a user to a board GUI wise, but so far not through the api. Not getting an error or anything, its just returning an empty object. That is where the logging question came from, so I can see what its doing when I get that empty object back. Thanks again for you advice and info.

        • reply
        • like

        January 14, 2020 at 5:05pm

        You need to add some member to board with some role https://github.com/wekan/wekan/wiki/REST-API-Role

          • reply
          • like

          doing that. That is what is returning an empty object and not adding anything that works to the board for a new user. Seriously. Where are those logs? :) :) :)

            • reply
            • like

            I would presume you did login as admin to Wekan API to get bearer token, and then used that bearer token at that role API call https://github.com/wekan/wekan/wiki/REST-API#example-call---as-form-data

              • reply
              • like

              yes I have and it creates boards and lists and cards fine. But I just noticed two things 1) that I am not including an action parameter in the body (just on the command on the query parameters 2) I only saw three parameters I listed (admin, comments only, no comments), I see a worker in this description. Does either change anything? Not to be a pest but where do I look to get logs? I have spend alot of time searching for them. Where are the logs? Pretty sure that 10 minutes with logs will remove most of the fog about why this is happening. Maybe not, thanks again for your help :)

                Edited
                • reply
                • like

                To get logs, you should build Wekan from source

                  • reply
                  • like

                  and run with meteor command

                    • reply
                    • like

                    Snap has logging disabled mostly, because Snap generates a lot of logs and fills disk space

                      • reply
                      • like

                      Wekan logs are at bash console or browser/inspect/console

                        • reply
                        • like

                        ok no logs with snap. Got it thanks

                          • reply
                          • like

                          ok found it

                            • reply
                            • like

                            you have to include "add" on commandline (query parameter

                              • reply
                              • like

                              AND

                                • reply
                                • like

                                you have to define action in body as "add"

                                  • reply
                                  • like

                                  then it works

                                    • reply
                                    • like

                                    thanks again

                                      • reply
                                      • like

                                      :)

                                        • reply
                                        • like

                                        and BTW

                                          • reply
                                          • like

                                          when it works it still returns an empty object

                                            • reply
                                            • like

                                            but it works - Cool

                                              • reply
                                              • like

                                              What kind of query works? I could add it to wiki.

                                                • reply
                                                • like

                                                /api/boards/{boardid}/members/{MEMBERID/add Body{ "action" : add, "isadmin" : false ...........

                                                  • reply
                                                  • like

                                                  you have to have the "add" one the query line but more importantly you also have to have "action" : "add" in the body.

                                                    Edited
                                                    • reply
                                                    • like