Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Add Mailbox API Endpoint Bug, "active must be a boolean"

    Support
    api mail
    2
    5
    345
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      ramiroro last edited by girish

      Hello there,

      Not sure if I'm doing something wrong but I am trying to create a Cloudron User and Mailbox programatically through the API. I have managed to create a user but when hitting the /mail/{domain}/mailboxes POST method, and sending the required body params (name, ownerId, and ownerType), I am always met with the message:

      "active must be a boolean"

      This is confusing because in the API spec / swagger it doesn't mention the active parameter. Also I have tried to send the active parameter in many forms in the hopes that the endpoint accept it but no luck.

      API Route POST: /api/v1/mail/{my domain}/mailboxes

      Am currently testing using Postman and an Auth session token from the login endpoint.

      Please advise.

      girish 1 Reply Last reply Reply Quote 0
      • girish
        girish Staff @ramiroro last edited by

        @ramiroro the API docs are most likely a bit out of date with the recent changes. Just pass an additional field active set to true in the request. The flag indicates whether the mailbox is enabled or not.

        R 1 Reply Last reply Reply Quote 0
        • R
          ramiroro @girish last edited by

          @girish That was the first thing I tried. The endpoint does not seem to accept the extra parameter no matter what I try.

          girish 1 Reply Last reply Reply Quote 0
          • girish
            girish Staff @ramiroro last edited by

            @ramiroro Do you have the curl request ? Note that you have to pass true as boolean and not as string.

            R 1 Reply Last reply Reply Quote 0
            • R
              ramiroro @girish last edited by

              @girish ah alright, that sent me down the right path. needed to switch from encoded body to raw JSON and that cleared it up. thank you!

              1 Reply Last reply Reply Quote 0
              • Deleted by  R ramiroro 
              • Restored by  girish girish 
              • First post
                Last post
              Powered by NodeBB