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


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Cannot do create_invite nor send_invite via API

Scheduled Pinned Locked Moved Solved Support
inviteapi
6 Posts 2 Posters 221 Views
    • 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.
  • andres.moyaA Offline
    andres.moyaA Offline
    andres.moya
    wrote on last edited by girish
    #1

    Hello. I've been using the API for some time to manage users in my Cloudron instance through a different application (our association members management app).

    But now I find that cannot use the "create_invite" and "send_invite" calls, to generate a link for the users to log in after creation (as explained here https://docs.cloudron.io/api.html#tag/Users/paths/~1users~1{userId}~1create_invite/post).

    The API call, even I use json format, replies with a html text like this:

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
    	<meta charset="utf-8">
    	<title>Error</title>
    </head>
    
    <body>
    	<pre>Cannot POST /api/v1/users/uid-13f7fac9-131e-4452-93c3-6d7762615e8c/create_invite</pre>
    </body>
    
    </html>
    

    Sorry, no idea of what's happening here. This was working before, although I couldn't say when exactly it broke. I think the call we are making is correct.

    Any clue? Thanks.

    1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #2

    Actually the API has changed with v7, since the whole impersonation/invite/password reset area was reworked. Sorry we haven't updated the docs yet.

    Will do this in a bit. For the meantime, essentially the routes are now:

    GET '/api/v1/users/:userId/invite_link' -> 200 { inviteLink }
    POST '/api/v1/users/:userId/send_invite_email' with body { email: 'send@invite.to' } -> 202 {}
    
    andres.moyaA 1 Reply Last reply
    1
  • andres.moyaA Offline
    andres.moyaA Offline
    andres.moya
    replied to nebulon on last edited by
    #3

    @nebulon thanks! I've been able to do it now, with these routes.

    One question: I see that the send_invite_email has now a parameter to specify the email address to send the link. Is this mandatory? Or can I omit it, and have cloudron to use the primary email address of the user?

    nebulonN 1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    replied to andres.moya on last edited by
    #4

    @andres-moya currently the email is mandatory. I don't quite remember right now if this was on purpose or just because the route was implemented mainly with the dashboard in mind.

    I think it makes sense to have it optional and falling back to the user's email address then.

    Also please note, that a user now mostly only has one email and optionally a password reset email address set.

    andres.moyaA 1 Reply Last reply
    0
  • andres.moyaA Offline
    andres.moyaA Offline
    andres.moya
    replied to nebulon on last edited by
    #5

    @nebulon All clear now. Thanks very much.

    1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #6

    The API docs are now also updated for the invite routes.

    1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.