Creating a new post from an external link using a POST request rather than query parameters?

Right now I’m using the /new-topic?title=foo&body=bar URL to direct users to create a post that has pre-filled, generated content (that varies by user or post) from our application. But I’m limited by the maximum length of a query string so this isn’t useful for anything other than short messages.

Is there any way that this page can either:

A) Accept the fields as parameters in a POST message body
B) Otherwise let me specify the content that the title/body should have when they visit the page that allows for longer content?

2 Likes

Hm.

@CubeCoders: Was your question targeting “How do I provide a pre-filled ‘edit a new topic’ form to users, extending the limits possible with query parameters?”.

In this case, watching API calls would not help, since that way a topic would already be created.

If you are happy with the same pre-filled text for every user, you could use text in the category template.

3 Likes

@thoka It’s not static content. It will vary by user. The post body is supposed to contain system information which is generated by our application - so we’re having the user redirected to our support board with the information we need pre-filled.

Similarly, being able to include attachments in this way would also be incredibly useful to us.

Hm. In this case, I would try to create a draft for the user via API.

Allowed draft length is configurable.

Drafts answering a topic are accessible via URL /t/-/:topic-id/:draft-id/.

Unfortunately, drafts which create a new topic do not seem to have an obvious URL which could be sent to a user to open the draft.

This doesn’t solve the problem because the user may not have an account so no draft can be created. Using the current flow allows for registration/login while preserving the message once they have done that.

If you need to change the API, then consider creating a plugin?

1 Like