# 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="/files/E44HiDRQKuj3vrXb8qpM" 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](/diffcord-documentation/resources/vote.md).

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)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diffcord.com/diffcord-documentation/rewarding-votes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
