# How can I call third party apis in discourse

**URL:** https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782
**Category:** Development
**Created:** [August 26, 2021, 11:06am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782 "2021-08-26T11:06:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rajeev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rajeev/32/231379_2.png) [@Rajeev](https://meta.discourse.org/u/Rajeev)
#### Post date: [August 26, 2021, 11:06am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782/1 "2021-08-26T11:06:01Z")

</div>

Hi,  
I am wondering that is there any way by which we can call third-party custom API created in node.js in discourse?

feedback appreciated

Thanks

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 26, 2021, 11:26am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782/2 "2021-08-26T11:26:51Z")

</div>

Shouldn’t matter what the API is written in, if all interaction happens over http.

You will probably need to write some javascript ajax calls in a Theme Component, or if appropriate, make http calls in some new Plugin code you write in Ruby using a suitable Ruby gem like Excon or Httparty.

---

<div class="post-metadata">

### Author: ![Rajeev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rajeev/32/231379_2.png) [@Rajeev](https://meta.discourse.org/u/Rajeev)
#### Post date: [August 26, 2021, 11:36am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782/3 "2021-08-26T11:36:24Z")

</div>

Thanks for the reply @merefield I appreciate your feedback.  
I am new to discourse development. Previously, I have done work on nodebb community CMS belongs to Nodejs. There, I have done a lot of customization ( created custom API to call Zoho tickets data, fetching the list of Vimeo videos a lot more). So I want to perform the same or need to create the same API(s) in it and render response data in some static pages to the user.

Thanks

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 26, 2021, 11:42am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782/4 "2021-08-26T11:42:08Z")

</div>

Use the backend to make the call:

- if you need this to be secure,
- if you need the backend to process the result
- if the call(s) may be long running

If long running put it in a Job.

That will require some Ruby in a Plugin and one of the above mentioned gems.

It’s not necessarily all that easy to get into Discourse plugin development, it’s a big complex, opinionated platform, but there are [good official guides](https://meta.discourse.org/tag/plugin-guides) on here and LOTS of existing open source plugins to look through (see #Customization > Plugin and links to github). Try to find one that does something similar and look at how it is solved in code.

If it’s superficial consider a Theme Component. Look at the [Theme Development guides](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648) on here.

Look at examples, like this one: [discourse-tc-quote-of-the-day/get-quote.js.es6 at master · merefield/discourse-tc-quote-of-the-day (github.com)](https://github.com/merefield/discourse-tc-quote-of-the-day/blob/master/javascripts/discourse/lib/get-quote.js.es6)

---

<div class="post-metadata">

### Author: ![Rajeev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rajeev/32/231379_2.png) [@Rajeev](https://meta.discourse.org/u/Rajeev)
#### Post date: [August 26, 2021, 11:45am UTC](https://meta.discourse.org/t/how-can-i-call-third-party-apis-in-discourse/201782/5 "2021-08-26T11:45:00Z")

</div>

okay @merefield I am looking into it. Appreciate your feedback.
