# How to create a 'follow' button for a topic and post it on an external website?

**URL:** https://meta.discourse.org/t/how-to-create-a-follow-button-for-a-topic-and-post-it-on-an-external-website/91266
**Category:** WordPress
**Created:** [30.Июнь.2018 14:17:25 UTC](https://meta.discourse.org/t/how-to-create-a-follow-button-for-a-topic-and-post-it-on-an-external-website/91266 "2018-06-30T14:17:25Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [30.Июнь.2018 15:40:01 UTC](https://meta.discourse.org/t/how-to-create-a-follow-button-for-a-topic-and-post-it-on-an-external-website/91266/2 "2018-06-30T15:40:01Z")

</div>

You can set a user’s notification level for a topic through the API. You’ll need to generate an API key for the user first, and then make a POST request to `/t/$topic_id/notifications` with the user’s `api_key`, `api_username`, and the `notification_level` in the body of the request. To avoid exposing the API key, the request will have to be made from the server, not the client.

> [@Andy02](#):
>
> (or redirects them to the login page if they aren’t logged in)

The easiest way to deal with this would be to only show the Follow button to logged in users.

---

_[View the full topic](https://meta.discourse.org/t/how-to-create-a-follow-button-for-a-topic-and-post-it-on-an-external-website/91266)._
