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

# Histories

GET https://testgatewayapi.insurapps.net/api/offline/jobs/{jobId}/histories

## İş Geçmişi Getir (Histories)

Belirtilen offline iş kaydına ait geçmiş (history) bilgilerini getirir. Bu endpoint, bir işin oluşturulmasından itibaren geçirdiği yönlendirme geçmişini kronolojik olarak listeler.

### Endpoint

`GET /api/offline/jobs/:jobId/histories`

### Kimlik Doğrulama

Bu istek, üst koleksiyondan miras alınan **Bearer Token** kimlik doğrulamasını kullanır. Token, `{{authToken}}` ortam değişkeninden çözümlenir.

### Yol Parametreleri (Path Variables)

| Parametre | Tip     | Zorunlu | Açıklama                                                     |
| --------- | ------- | ------- | ------------------------------------------------------------ |
| `jobId`   | integer | ✅       | Geçmiş kayıtları getirilecek offline işin benzersiz kimliği. |

### Örnek İstek

```
GET https://gatewayapi.insurapps.net/api/offline/jobs/24532234/histories

```

### Yanıt Yapısı

#### Başarılı Yanıt (200 OK)

İş kaydına ait yönlendirme geçmişi bir JSON dizisi olarak döner.

```json
[
    {
        "Message": "İş kendisine yönlendirildi.",
        "ForwardDate": "2025-01-10T11:46:05.4980981",
        "FromUserId": null,
        "ToUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c",
        "AssignerUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c"
    },
    {
        "Message": null,
        "ForwardDate": "2025-01-10T11:46:21.0530294",
        "FromUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c",
        "ToUserId": "97aa0081-8ca5-4acb-b757-15efd1bba944",
        "AssignerUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c"
    },
    {
        "Message": "İş kendisine yönlendirildi.",
        "ForwardDate": "2026-02-04T13:54:28.7929678",
        "FromUserId": "97aa0081-8ca5-4acb-b757-15efd1bba944",
        "ToUserId": "ae116cd4-a26e-47ab-8b0f-07d5ac9cb79c",
        "AssignerUserId": "ae116cd4-a26e-47ab-8b0f-07d5ac9cb79c"
    }
]

```

**Dizi Elemanları:**

| Alan             | Tip                  | Açıklama                                                                           |
| ---------------- | -------------------- | ---------------------------------------------------------------------------------- |
| `Message`        | string / null        | Yönlendirme ile ilgili açıklama mesajı. Otomatik yönlendirmelerde `null` olabilir. |
| `ForwardDate`    | string (datetime)    | Yönlendirmenin gerçekleştirildiği tarih ve saat.                                   |
| `FromUserId`     | string (GUID) / null | Yönlendirmeyi yapan (kaynak) kullanıcının kimliği. İlk atamada `null` olabilir.    |
| `ToUserId`       | string (GUID)        | Yönlendirmenin hedef kullanıcısının kimliği.                                       |
| `AssignerUserId` | string (GUID)        | Yönlendirme işlemini gerçekleştiren kullanıcının kimliği.                          |

#### İş Bulunamadı Hatası (404 - Status: false)

Belirtilen `jobId` ile eşleşen bir iş kaydı bulunamadığında döner.

```json
{
    "Status": false,
    "Code": "OfflineJobs.JobNotFound",
    "Message": "No job found for the requested JobId: :jobId:",
    "Response": null
}

```

| Alan       | Tip     | Açıklama                            |
| ---------- | ------- | ----------------------------------- |
| `Status`   | boolean | İşlem durumu (`false` = başarısız). |
| `Code`     | string  | Hata kodu.                          |
| `Message`  | string  | Hata mesajı.                        |
| `Response` | null    | Hata durumunda `null` döner.        |

#### Yetkilendirme Hataları

| Durum Kodu         | Açıklama                                                    |
| ------------------ | ----------------------------------------------------------- |
| `401 Unauthorized` | Token geçersiz veya süresi dolmuş. Body dönmez.             |
| `403 Forbidden`    | Kullanıcının bu endpoint'e erişim yetkisi yok. Body dönmez. |

### Notlar

* İstek göndermeden önce aktif ortamda geçerli bir `authToken` değişkeninin ayarlandığından emin olun. Token almak için **Authentication Login** isteğini kullanabilirsiniz.

* Token süresi dolmuşsa, yeni bir token almak için **Refresh Token** isteğini kullanın.

* `jobId` değeri, **Jobs** endpoint'inden dönen `Id` alanına karşılık gelir. Önce Jobs endpoint'ini kullanarak geçerli iş kimliklerini listeleyebilirsiniz.

Reference: https://docs.insurgateway.com/insurgateway-api/offline/histories

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://testgatewayapi.insurapps.net` (https://testgatewayapi.insurapps.net, default)
- `https://gatewayapi.insurapps.net` (https://gatewayapi.insurapps.net)

## Request

### Path parameters

- `jobId` (integer, required)

## Response

### 200

OK

## Errors

### 400 Bad Request Error

Bad Request

### 404 Not Found Error

Not Found

## Examples

**Response**

```json
[
  {
    "Message": "İş kendisine yönlendirildi.",
    "ForwardDate": "2025-01-10T11:46:05.4980981",
    "FromUserId": null,
    "ToUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c",
    "AssignerUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c"
  },
  {
    "Message": null,
    "ForwardDate": "2025-01-10T11:46:21.0530294",
    "FromUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c",
    "ToUserId": "97aa0081-8ca5-4acb-b757-15efd1bba944",
    "AssignerUserId": "4c31d679-b285-4040-9b57-5ce49e9f604c"
  },
  {
    "Message": "İş kendisine yönlendirildi.",
    "ForwardDate": "2026-02-04T13:54:28.7929678",
    "FromUserId": "97aa0081-8ca5-4acb-b757-15efd1bba944",
    "ToUserId": "ae116cd4-a26e-47ab-8b0f-07d5ac9cb79c",
    "AssignerUserId": "ae116cd4-a26e-47ab-8b0f-07d5ac9cb79c"
  }
]
```

**SDK Code**

```python Offline_histories_example
import requests

url = "https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Offline_histories_example
const url = 'https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Offline_histories_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Offline_histories_example
require 'uri'
require 'net/http'

url = URI("https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Offline_histories_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Offline_histories_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Offline_histories_example
using RestSharp;

var client = new RestClient("https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Offline_histories_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://testgatewayapi.insurapps.net/api/offline/jobs/24532234/histories")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```