# Webhook Yönetimi

Webhook servisimiz ile banka hesaplarını belirli aralıklar ile sürekli dinlemek zorunda değilsiniz. Dilerseniz sadece para girişi, dilerseniz sadece para çıkışlarını dinleyebilirsiniz.&#x20;

**Örnek Webhook POST içeriği**

```http
dc: Credit
code: EFT
amount: 100.00
balance: 18100.00
currency: TRY
description: SN:276689 TEST BANKA HAREKETİ AÇIKLAMASI ARALIK/2019
account_id: 69
account: Kadıköy İşbank TL Hesabı
bank: Türkiye İş Bankası A.Ş.
opponent_id: 1234567890
opponent_iban: TR5600000111000022200023456
hash: NmYwMGMzMDM2ZjI1Njg5MmE3ODk5NzE4ZjEzMWI4NTg2MDRmZDA3MmYwN2Q1NjVmNDMwMjZmNmUzYmViNDEwOA==
```

Gönderilen POST içeriğinin Banksocket'ten geldiğinden emin olmak için hash parametresi hesabını doğrulayabilirsiniz. Apisecret değerini hesap ayarları API bölümünden edinebilirsiniz.&#x20;

Örnek hash hesabı

```php
base64(sha256(dc + code + amount + balance + currency + description + secret))
```

## Webhook oluştur

<mark style="color:green;">`POST`</mark> `https://api.banksocket.com/v1/webhooks`

Sisteme yeni webhook görevi oluşturmak için kullanılır.&#x20;

#### Headers

| Name           | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| Authentication | string | Kimlik denetimi başlığıdır. |

#### Request Body

| Name     | Type   | Description                                                                                                                                                                 |
| -------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title    | string | Webhook adıdır.                                                                                                                                                             |
| endpoint | string | Yeni işlem olduğunda POST gönderilecek adrestir.                                                                                                                            |
| event    | string | Görevin hangi işlemlerde tetikleneceğini belirtir. Tüm hareketler için NEW\_TRANSACTION, sadece para çıkışı  için NEW\_DEBIT, yeni para girişi için NEW\_CREDIT gönderilir. |
| account  | string | Tüm hesaplar için all gönderiniz. Sadece bir hesap dinlemek için account\_id değeri gönderiniz.                                                                             |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "webhook": {
        "id": 1233,
        "endpoint": "http://test",
        "title": "TR işbank api test"
    }
}
```

{% endtab %}
{% endtabs %}

## Webhook sil

<mark style="color:red;">`DELETE`</mark> `https://api.banksocket.com/v1/webhooks/:id`

#### Path Parameters

| Name | Type    | Description                               |
| ---- | ------- | ----------------------------------------- |
| id   | integer | Silinecek webhook görevinin ID değeridir. |

#### Headers

| Name           | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| Authentication | string | Kimlik denetimi başlığıdır. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "status" : "success"
}
```

{% endtab %}
{% endtabs %}


---

# 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.banksocket.com/webhook-yoenetimi.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.
