# Suara

## Mendapatkan data suara

<mark style="color:green;">`POST`</mark> `https://dao.octusbridge.io/v1/votes/search`

{% tabs %}
{% tab title="200: OK Successful request" %}

```
{
  "votes": [
    {
      "proposalId": 6,
      "voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
      "support": true,
      "reason": "",
      "votes": "5061664014",
      "locked": false,
      "messageHash": "0275dde58e1a456e6dbba65aba2f295e2d33812353f0632c9728c084843a3678",
      "transactionHash": "3024c7309609b69cf8ad0f6efc686fb3bf91ccc257261e9063c5cee35ac6f7cf",
      "createdAt": 1654530320
    }
  ],
  "totalCount": 1
}
```

{% endtab %}
{% endtabs %}

Fungsi ini mengembalikan detail pemungutan suara dari pengguna tertentu berdasarkan pengajuan tertentu.

Dapat digunakan untuk menampilkan informasi terperinci tentang suara pengguna seperti jumlah suara yang dikumpulkan untuk pengajuan tertentu, alasan pemungutan suara, apakah pengguna mendukung pengajuan atau tidak, waktu pemungutan suara, dll.

### Parameter permintaan

Parameter tubuh yang diperlukan:

| Nama       | Nilai contoh                                                       | Komentar                                                      |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------------------------- |
| limit      | 5                                                                  | Jumlah maksimum pengajuan yang akan diambil                   |
| locked     | false                                                              | Benar jika terkunci, salah jika tidak                         |
| offset     | 0                                                                  | Offset                                                        |
| ordering   |                                                                    | Set parameter berdasarkan pengajuan yang diambil akan dipesan |
| column     | createdAt                                                          | Urutan berdasarkan nama kolom yang diberikan (mis. CreatedAt) |
| direction  | ASC                                                                | Urutan berdasarkan arah yang diberikan (naik atau turun)      |
| proposalId | 6                                                                  | Id pengajuan                                                  |
| support    | true                                                               | Benar jika memilih, salah jika menentang pengajuan            |
| voter      | 0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd | Alamat pemilih                                                |

### Penjelasan bidang respons

| Nama            | Nilai contoh                                                       | Komentar                                                       |
| --------------- | ------------------------------------------------------------------ | -------------------------------------------------------------- |
| totalCount      |                                                                    | Total berapa kali pemilih memilih pengajuan tertentu           |
| votes           | 5061664014                                                         | Daftar semua suara dari pemilih tertentu ke pengajuan tertentu |
| createdAt       | 1654530320                                                         | Tanggal saat pemungutan suara dinaikkan                        |
| locked          | false                                                              | Benar jika suara dikunci, salah jika tidak                     |
| messageHash     | 0275dde58e1a456e6dbba65aba2f295e2d33812353f0632c9728c084843a3678   | Kode hash dari pesan                                           |
| proposalId      | 6                                                                  | Id pengajuan                                                   |
| reason          | ""string""                                                         | Alasan pemungutan suara                                        |
| support         | true                                                               | Benar jika pemilih memilih, salah jika menentang               |
| transactionHash | 3024c7309609b69cf8ad0f6efc686fb3bf91ccc257261e9063c5cee35ac6f7cf   | Kode hash transaksi                                            |
| voter           | 0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd | Alamat pemilih                                                 |
| votes           | 5061664014                                                         | Jumlah yang dipertaruhkan untuk pemungutan suara               |

### Contoh

```java
app.post('/votes/search', (req, res) => {
 
    axios({
        method: 'post',
        url: `${apiUrl}/votes/search`,
        data: {
            limit: req.body.limit,
            locked: req.body.locked,
            offset: req.body.offset,
            ordering: req.body.ordering,
            proposalId: req.body.proposalId,
            support: req.body.support,
            voter: req.body.voter
        }
    })
    .then(function(response){
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
  })
```


---

# 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.octusbridge.io/ob-id/integrate/octus-bridge-api/dao-api/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.
