I’m guessing it’s failing on is_api?. Looking at the code, it’s not obvious to me why that would fail with the request from Zapier, but I can’t see anywhere else it would fail.
I’m interested in this because someone was asking me about the same issue with creating users via Zapier a few weeks ago.
Yup. I am surprised this is not working but at least now I know it’s not just me.
I am looking at this approach of using an external DB and an automation tool like Zapier or Make (I was getting similar errors on make) as a POC for a pilot program.
I can get away without using one of these tools in the short term pilot phase but longer term Discourse will be one part of a larger platform and I definitely need to manage members in an external DB in a separate back end with member management and other services.
That’s working for me. If it’s not working, the other thing to check is to make sure the invite only setting isn’t enabled on your Discourse site.
To see if it would work, I also just made a custom integration with the Zapier CLI that creates new users. If Discourse want, that action could be added to the official Discourse Zap. I’m not sure that adding an action to create users is a priority though. I don’t think it’s been requested as often as things like creating an invite or suspending a user.
Notes from further testing:
the Payload Type can be set to either “json” or “form”. To set custom fields with the request, the payload type needs to be set to “form”.
Multiselect custom fields are a bit of an issue. Zapier won’t allow duplicate key names in the Data section. It should be possible to set Multiselect custom fields with the Zapier “Custom Request” action.
the values of the active and approved parameters do not need to be wrapped in quotation marks.
@simon Thanks! I got it to work! Your screenshot helped me sort out the issues with the way Zapier is creating the data fields. It was doing some wonky stuff but I was basically not understanding how to format / map the data to airtable. I need to get the end to end automation working but the create user definitely worked.
Hi @simon - thanks again for the help on the formatting. Now I am trying to add some custom fields to the user profile and see if I can get Zapier to populate them in a new Discourse user. It seems to be causing the whole request to fail and I am getting a message “you have not completed all the user fields”
I found this post so I tried switching it to form from json but that didn’t work
Any advice on how to format custom profile fields? Thanks!
Except that approach won’t work with multiselect dropdown fields. For that type of field I think you’ll have to use the “Custom Request” action. Might take a bit of fiddling around to get it to work.
Wow - you are truly the grand wizard of zapier + discourse. Changing the red arrow and it worked first try. I had it as the name of the field but of course that makes no sense given would not know that upstream. So for every new field I create I just use the [#] and it will automatically map them in order? I am planning a bunch - maybe 10 or so. Also, it seemed to work fine even though my test field is a drop down - maybe because it’s just pulling it from Airtable?
Yes, just put the field’s id in the []. You can get the id of the field by loading the JSON version of your Admin / Customize / User Fields page (/admin/customize/user_fields.json)
(It’s easier to read if you have a browser extension that formats JSON.)
Drop down fields should be fine. It’s just Multi-select fields that will have issues. For example, the “hobbies” field in the screenshot I posted above.
Wonder whether it’s ok to open this one up again and ask about creating groups?
I can create users from Zapier without an issue (even when invite only is turned on)
The Zapier interface allows for individual API headers but when it asks for an object (which creating a group appears to require) … I get this, even if I edit the body manually to be formatted like the API docs ask:
Failed to create a custom actions in Discourse
Raw request failed. Problem executing your request: Error code 400: param is missing or the value is empty: group
Is there a way I can send that initial object group { and close it again using Zaiper?
Any insight would be amazing and much appreciated!