Discourse callback api


(Dejan Milosevic) #1

Do Discourse have callback api?

I need whenever someone create topic or post, to i can configure my api url where will discourse send request with data, user, title, date, etc.

I also need, if post contains specific hashtag, to append created link in post.

So, it is like this:

User postes with #recipe
Callback api sends request to other site to create link with that post and returns link url.
Discourse appends this url on post.

If this isnt implemented yet or ment to be implemented, can somebody help me or make me this for money.

Thank you very much.

offtopic: How that you have choose tags for this topic here and i am on latest discourse and dont have? Does i need to turn it on somewhere?


Where i can find list of javascript hooks?
I found easy way to create everything i want via javascript and without ruby at all in this plugin:

register_asset “javascripts/affiliate.js”, :server_side

and every changes it need it has done in javascript side.

#btw how can i disable this hashtag bold posting? I just need #hashtag without bolding.

i hope i am not violating any rules.

(Mittineague) #2

That’s part of what MarkDown does, I don’t think you really want to disable it.

The easiest way is to put a backslash escape before it.

\#id NOT bold!

(Dejan Milosevic) #3

but i need to inform users that hashtag in my forum is really #hashtag instead of #hashtag…

#hashtag (typed #hashtag) is very global feature, to have it broken like this

(Mittineague) #4

Perhaps elsewhere, but Discourse does not have hashtags.

(Dejan Milosevic) #5

I got your point, but they made id opensource and made plugin api, so discourse team is supporting discourse customization.

I am loving discourse, but also i would like to have some minor customizations which are not going off concept too much. I think that #hashtags are now some kind of standard in internet communications as emojis or smiles :smile:, so i thing that there must be some room for hashtags.

(Mittineague) #6

True enough. But AFAIK the use of MarkDown is very much tied into the post composer process.
So I don’t think this is something the Core Devs would be interested in spending time on. But I could very well be wrong,

That said, there is nothing stopping anyone from writing a plugin or even making a pull request if there is enough demand for it and it wouldn’t break anything.

As for the API, have you looked at

GitHub - discourse/discourse_api: Ruby API for Discourse

for anything that might be helpful?

Maybe you could use the existing @demil mention feature?

(Dejan Milosevic) #7

Is there any list of avilaible javascript callbak evetns?

For example, onCreatePost, onParsePost etc?


(Sam Saffron) #8

discussed here: Proposal for a (hash) tagging feature

(Dejan Milosevic) #9

@sam Can you give me some info on discourse javascript events api?

I am so intereseted for developing some discourse plugins but i cant find documentation for javascript events anywhere?

Thank you in advance.

(Sam Saffron) #10

At the moment, the documentation is the source code. You need to be comfortable with the Discourse code base to write plugins.