> 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.

# GetOutgoingLogPayload API

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

## Endpoint

| Alan         | Değer                    |
| ------------ | ------------------------ |
| HTTP Method  | `POST`                   |
| Path         | `/GetOutgoingLogPayload` |
| 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": {
    "LogID": 987654,
    "GwLogId": "6635f2c7c1d2b8a1f0a12b34",
    "IsResponse": false
  }
}
```

| Alan                 | Tip    | JSON Adı     | Açıklama                                                        |
| -------------------- | ------ | ------------ | --------------------------------------------------------------- |
| `ReferanceNo`        | string | —            | Bu çağrı için iş referans numarası.                             |
| `SubReferanceNo`     | string | —            | \~30 karakterlik benzersiz alt referans.                        |
| `RequestKeyValueSet` | —      | —            | Kullanılmaz.                                                    |
| `LogId`              | long?  | `LogID`      | Bildirim tipi `3` payload'ındaki `OutgoingRequestLogID` değeri. |
| `GwLogId`            | string | `GwLogId`    | Bildirim tipi `3` payload'ındaki `GwLogId` değeri.              |
| `IsResponse`         | bool?  | `IsResponse` | `false`: `DataSent`. `true`: `DataReceived`.                    |

> JSON alan adı **`LogID`** (büyük D) olarak gönderilir; parse sırasında dikkat edilmelidir.

---

## 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": {
    "LogID": 987654,
    "Payload": "<request veya response gövdesi>"
  }
}
```

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

---

## Tam Örnek

**İstek:**

```http
POST /insurgw/GetOutgoingLogPayload 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_2",
  "SubReferanceNo": "queryref-9f8e7d6c5b4a3210fedcba9876",
  "RequestKeyValueSet": null,
  "RequestObject": {
    "LogID": 987654,
    "GwLogId": "6635f2c7c1d2b8a1f0a12b34",
    "IsResponse": true
  }
}
```

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

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

{
  "ResultStatus": { "Status": "Success", "Explanation": null },
  "Result": {
    "LogID": 987654,
    "Payload": "<response><PolicyNo>123456</PolicyNo>...</response>"
  }
}
```

**Hata cevabı:**

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

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