> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.insurgateway.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.insurgateway.com/_mcp/server.

# GetIncomingLogPayload API

InsurGateway, bildirim tipi `4` ile platforma ilettiği incoming log gövdelerini ileride bu endpoint üzerinden geri ister.

## Endpoint

| Alan         | Değer                    |
| ------------ | ------------------------ |
| HTTP Method  | `POST`                   |
| Path         | `/GetIncomingLogPayload` |
| Content-Type | `application/json`       |

---

## Header'lar

```
Content-Type: application/json
x-api-key: <platform tarafından üretilen API key>
Authorization: <opsiyonel; platform tarafından bildirildiyse>
```

---

## Request Yapısı

```json
{
  "ReferanceNo": "string",
  "SubReferanceNo": "string",
  "RequestKeyValueSet": null,
  "RequestObject": {
    "ReferenceNo": "0_12345_20260504120500999_7",
    "IsResponse": false
  }
}
```

| Alan                        | Tip         | Açıklama                                                                       |
| --------------------------- | ----------- | ------------------------------------------------------------------------------ |
| `ReferanceNo`               | string      | Bu çağrı için iş referans numarası.                                            |
| `SubReferanceNo`            | string      | Bu çağrıya özel \~30 karakterlik benzersiz alt referans.                       |
| `RequestKeyValueSet`        | array\|null | Kullanılmaz.                                                                   |
| `RequestObject.ReferenceNo` | string      | Daha önce bildirim tipi `4` ile gönderilen log kaydının `ReferanceNo` değeri.  |
| `RequestObject.IsResponse`  | bool        | `false`: gönderilen istek (`DataSent`). `true`: alınan cevap (`DataReceived`). |

> Dış zarftaki `ReferanceNo` (Türkçe yazım) ile içteki `ReferenceNo` (İngilizce yazım) yazımları kasıtlı olarak farklıdır.

---

## Response Yapısı

Platformun döneceği cevap, HTTP `200 OK` ile aşağıdaki yapıda olmalıdır:

```json
{
  "ResultStatus": {
    "Status": "Success",
    "Explanation": null
  },
  "Result": {
    "ReferenceNo": "0_12345_20260504120500999_7",
    "Payload": "<request veya response gövdesi>"
  }
}
```

| Alan                       | Açıklama                                                    |
| -------------------------- | ----------------------------------------------------------- |
| `ResultStatus.Status`      | Yalnızca `"Success"` başarılı kabul edilir; diğerleri hata. |
| `ResultStatus.Explanation` | Hata açıklaması.                                            |
| `Result.ReferenceNo`       | İstekteki `ReferenceNo` değerinin aynısı döndürülür.        |
| `Result.Payload`           | `IsResponse=false` → `DataSent`; `true` → `DataReceived`.   |

Hata durumunda `Result` `null` veya boş olabilir.

---

## Tam Örnek

**İstek:**

```http
POST /insurgw/GetIncomingLogPayload HTTP/1.1
Host: platform.ornek.com.tr
Content-Type: application/json
x-api-key: 9f3c1e8a-2b4d-1234-5678-deadbeefcafe

{
  "ReferanceNo": "0_12345_QUERY_20260510153000_1",
  "SubReferanceNo": "queryref-9f8e7d6c5b4a3210fedcba9876",
  "RequestKeyValueSet": null,
  "RequestObject": {
    "ReferenceNo": "0_12345_20260504120500999_7",
    "IsResponse": false
  }
}
```

**Başarılı cevap:**

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "ResultStatus": { "Status": "Success", "Explanation": null },
  "Result": {
    "ReferenceNo": "0_12345_20260504120500999_7",
    "Payload": "<request><Method>GetProposal</Method>...</request>"
  }
}
```

**Hata cevabı (log bulunamadı):**

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "ResultStatus": { "Status": "Error", "Explanation": "Log bulunamadı" },
  "Result": null
}
```