# Rewarding Votes

### Set up&#x20;

1. Click on your bot page
2. Click on **dashboard**
3. Visit the **API** section

At the bottom of the page, there will be a webhook section.

1. Enter your own **endpoint URL**, in which our POST requests will be made to. (This must be a publicly available endpoint listening for POST requests that Diffcord will make, if your language is supported by one of our libraries, we suggest you use a library since this is handled for you)
2. Enter an **authorization/verification** code. This can be whatever you would like and will be sent along with all our POST requests. This can be used by you to ensure that the requests are indeed coming us.

{% hint style="success" %}
**Remember** to "SAVE WEBHOOK CHANGES" once you are complete!
{% endhint %}

<figure><img src="https://2201773989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WUVdLH1ACbHlAlxOPFR%2Fuploads%2Fzb1GP2bFWUWBgN9QaxZw%2Fimage.png?alt=media&#x26;token=760564fb-e0a8-4251-a02d-6b8ecdbba73f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You should now be all ready to receive votes!
{% endhint %}

### Usage

Once you are able to receive votes, you must now handle them.

Each request we will make to the URL you provided to us will be a POST request.

We will send the verification code as a header under the **Authorization** key.

The body of the requests we send will contain a [user vote](https://docs.diffcord.com/diffcord-documentation/resources/vote).

With the request data we have provided, you are able to internally reward the user via the user\_id field in the body.

Finally, once you have rewarded your users you must acknowledge that you have rewarded them. \
To do this you must respond to the POST request with a **200 Status Code** response, which confirms you have rewarded the vote.

### Security

We suggest you use the **Webhook Authorization Code,** which can verify our requests.

If you would like to strengthen security, or are running into firewall issues, you can whitelist the following IP address range which will be used to send requests to your applications.

```
NO IP ADDRESS RANGE (WIP)
```
