Fill in post for user?

I looked at the API, but I don’t think it will do what I want (for one thing it requires the user to create an API key which isn’t going to be practical).

What I want to do is have a way for my Mac application (Keyboard Maestro) to allow users to post content (from the application) to the forum. So the user selects a chunk of content, and clicks a button, and the forum opens up with the New Topic fields filled in (category, subject, content, including an uploaded file). The user can then edit the post as they desire before posting it.

Ideally, if the user is not logged in, they would be prompted to login/create an account first, but I could accept that they simply have to be logged in first.

Is there any way to accomplish something like this?

Aren’t you referring to the URL that pre-fills a topic, title, etc? @techapj worked on this, and it now exists.

2 Likes

Yep, that is close to what I am after. It would be good if it survived the login process if the user is not yet logged in, but it doesn’t currently

I don’t see how it can be extended to support a file (or image) upload though, so that may be a problem.

Can images/files be uploaded separately via the API? I (obviously) can’t store the master key in the application, but I could probably do something where the application uploaded the file to a web service I define, which in turn uploads it to the forum, and then have the topic body reference that uploaded file. A bit ugly, but perhaps doable. Does the API allow uploading files?

Any way we can get this to survive login, @techapj?

1 Like

Fixed via:

https://github.com/discourse/discourse/commit/d1632c1dbd256411bbb348f638bb7f5f61f05eae

3 Likes

Yep, sorry, that got dropped when I undid the previous patch.

Excellent, that all works perfectly now, including the upload of the images/files.

I’ll try to post a quick demo of how awesome this now is.

1 Like

OK, I can’t upload videos to this site, but here is a short video showing just how cool this integration is, combined with the synchronous uploading files (thanks @zogstrip!) from Using the Discourse API to post with uploaded files?. This link probably wont last forever, but I’ll keep it alive for a fair while.

2 Likes

There’s a website where you can upload videos and they’ll keep it around for a while :wink:

4 Likes