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

# Get Job Action By Id

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

## Get Job Action By Id

Belirtilen işe ait tek bir aksiyon kaydını, aksiyonun kimliğine (`jobActionId`) göre döner.

***

### Uç Nokta (Endpoint)

`GET {{baseUrl}}/api/offline/jobs/{jobId}/actions/{jobActionId}`

***

### Kullanım

`Get Job Actions` listesinden seçilen bir aksiyonun tekil kaydını okumak için kullanılır. Önerilen akış:

1. `Authentication Login` servisinden token alınır.

2. `Get Job Actions` çağrılarak işin aksiyon listesi alınır.

3. Listeden ilgilenilen kaydın `Id` değeri okunur.

4. Bu değer `jobActionId` olarak bu servise gönderilir.

> ⚠️ `jobActionId` **aynı iş içinde** aranır. Var olan ama başka bir işe ait bir aksiyon kimliği gönderildiğinde servis `OfflineAction.ActionNotFound` ile `404` döner.

> 💡 Bu servis tekil kaydı Platform mesaj servisinden zenginleştirmez. `Message` ve `Attachments` alanları her zaman boş döner; mesaj içeriği gerekiyorsa `Get Job Actions` listesindeki kayıt kullanılmalıdır.

***

### Kimlik Doğrulama

Bu uç nokta geçerli bir JWT erişim token'ı gerektirir. Token, `Authentication Login` servisinden alınır ve `Authorization` başlığında gönderilir.

| Başlık          | Tür    | Zorunlu | Açıklama                           |
| --------------- | ------ | ------- | ---------------------------------- |
| `Authorization` | string | ✅       | `Bearer` biçiminde erişim token'ı. |

Çağıranın aşağıdaki rollerden en az birine sahip olması gerekir:

| Rol                        | Erişim Kapsamı                                         |
| -------------------------- | ------------------------------------------------------ |
| `InsuranceCompanyAPIUser`  | Yalnızca kendisine ait işlerin aksiyonlarına erişir.   |
| `InsuranceCompanyAPIAdmin` | Token'daki sigorta şirketlerine ait tüm işlere erişir. |
| `Supervizor`               | Token'daki sigorta şirketlerine ait tüm işlere erişir. |

> ⚠️ İş, her hâlükârda token'daki sigorta şirketi kapsamıyla sınırlıdır. Kapsam dışındaki bir `jobId` için servis `403` değil **`404 Not Found`** döner.

***

### İstek Parametreleri

**Rota (Route) Parametreleri**

| Parametre     | Tür     | Zorunlu | Açıklama                                                                                                                          |
| ------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `jobId`       | integer | ✅       | Aksiyonun bağlı olduğu işin kimliği. `0`'dan büyük olmalıdır. Rotada `int` kısıtı vardır; sayısal olmayan bir değer `404` üretir. |
| `jobActionId` | integer | ✅       | İstenen aksiyonun kimliği. `0`'dan büyük olmalıdır. Rotada `int` kısıtı vardır; sayısal olmayan bir değer `404` üretir.           |

Bu uç nokta sorgu (query) parametresi almaz.

**Örnek İstek:**

```
GET {{baseUrl}}/api/offline/jobs/100931/actions/1234
Authorization: Bearer <token>

```

***

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

Yanıt gövdesi tek bir `JobActionDTO` nesnesidir.

> ⚠️ API `Newtonsoft.Json` `DefaultContractResolver` ile serileştirilir; alan adları C# property adlarıyla aynı, yani **PascalCase** döner (`Id`, `JobId`, `CreateDate` …). camelCase bekleyen bir istemci alanları `null` görür.

| Alan                 | Tür      | Açıklama                                                                                                                         |
| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Id`                 | long     | Aksiyonun benzersiz kimliği.                                                                                                     |
| `JobId`              | integer  | Aksiyonun bağlı olduğu işin kimliği.                                                                                             |
| `AgentId`            | integer  | Aksiyonun ilişkili olduğu acentenin kimliği.                                                                                     |
| `CreateDate`         | datetime | Aksiyonun oluşturulma tarihi (`yyyy-MM-ddTHH:mm:ss`).                                                                            |
| `Message`            | string   | null                                                                                                                             |
| `ToFullName`         | string   | null                                                                                                                             |
| `FromFullName`       | string   | null                                                                                                                             |
| `MessageFrom`        | integer  | Gönderen taraf. `MessageSentBy` değeri.                                                                                          |
| `MessageTo`          | integer  | Alıcı taraf. `MessageSentBy` değeri. Alıcı kullanıcı tanımlı değilse `-1` (Tanımsız) döner.                                      |
| `Attachments`        | array    | Bu uç noktada doldurulmaz; daima boş dizi döner.                                                                                 |
| `PlatformProposalId` | string   | null                                                                                                                             |
| `ActionType`         | integer  | Aksiyonun stage'i. `Stage` değeri — tam liste için [bknz.](https://docs.insurgateway.com/offline-constants#offline-stage-action) |

**`MessageFrom`** **/** **`MessageTo`** **değerleri (****`MessageSentBy`****):**

| Değer | Ad                 | Açıklama                                             |
| ----- | ------------------ | ---------------------------------------------------- |
| `-1`  | `Undefined`        | Taraf çözümlenemedi (ör. alıcı kullanıcı atanmamış). |
| `0`   | `InsuranceCompany` | Sigorta şirketi kullanıcısı.                         |
| `1`   | `Platform`         | Platform (acente) tarafı.                            |

**Örnek Başarılı Yanıt:**

```json
{
  "Id": 1234,
  "JobId": 100931,
  "AgentId": 42,
  "CreateDate": "2026-05-13T10:30:00",
  "Message": null,
  "ToFullName": "Ahmet Yılmaz",
  "FromFullName": "InsurCo API User",
  "MessageFrom": 0,
  "MessageTo": 1,
  "Attachments": [],
  "PlatformProposalId": "PROP-001",
  "ActionType": 2
}

```

***

### Hatalı Yanıt (400 Bad Request)

Doğrulama hatalarında gövde standart hata zarfıdır ve `Response` alanı alan bazlı detayları taşır:

```json
{
  "Status": false,
  "Code": "Validation.General",
  "Message": "One or more validation errors occurred",
  "Response": [
    { "Field": "JobActionId", "Message": "JobActionId must be greater than 0." }
  ]
}

```

| Alan       | Tür     | Açıklama                                                            |
| ---------- | ------- | ------------------------------------------------------------------- |
| `Status`   | boolean | Hatalı yanıtlarda daima `false`.                                    |
| `Code`     | string  | Hata kodu (`Validation.General`, `OfflineAction.ActionNotFound` …). |
| `Message`  | string  | Hatanın açıklaması.                                                 |
| `Response` | array   | null                                                                |

Olası doğrulama mesajları:

| Alan          | Mesaj                                 |
| ------------- | ------------------------------------- |
| `JobId`       | `JobId must be greater than 0.`       |
| `JobActionId` | `JobActionId must be greater than 0.` |

> ⚠️ `400` yanıtı **üç farklı gövde biçiminde** gelebilir: (1) yukarıdaki JSON zarfı — iş kuralı doğrulaması; (2) düz metin — model binding hatası; (3) düz metin (`İşlem sırasında bir hata oluştu! RequestId: …`) — beklenmeyen sunucu hatası `[HandleException]` filtresi tarafından `400`'e çevrildiğinde. İstemcide gövdeyi JSON olarak ayrıştırmadan önce `Content-Type` kontrol edilmelidir.

***

### Hatalı Yanıt (401 Unauthorized)

Token gönderilmediğinde, geçersiz olduğunda veya süresi dolduğunda `401 Unauthorized` döner. Yanıt gövdesi boştur; bilgi `WWW-Authenticate` başlığındadır.

> 💡 Token'ın süresi dolduğunda yanıta `Token-Expired: true` başlığı eklenir. İstemci bu başlığı görürse `Refresh Token` servisiyle token'ı yenileyip isteği tekrarlamalıdır.

***

### Hatalı Yanıt (403 Forbidden)

İki farklı nedenden dolayı oluşur:

**1. Rol yetersizliği** — çağıranın `InsuranceCompanyAPIUser`, `InsuranceCompanyAPIAdmin` veya `Supervizor` rollerinden hiçbiri yoksa. Gövde boştur.

**2. Token/erişim kontrolü** — gövde standart hata zarfıdır:

| Kod                                     | Mesaj                                                   | Ne zaman                                                                                |
| --------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `OfflineUsers.InsuranceCompanyNotFound` | `No valid insurance company assignment found in token.` | Token'da sigorta şirketi bilgisi yok.                                                   |
| `OfflineUsers.UserIdentityNotResolved`  | `User identity could not be resolved from token.`       | Token'dan kullanıcı kimliği çözümlenemedi.                                              |
| `OfflineJobs.JobOwnershipDenied`        | `You do not have permission to access this job.`        | `InsuranceCompanyAPIUser` rolündeki kullanıcı, kendisine ait olmayan bir işi sorguladı. |

```json
{
  "Status": false,
  "Code": "OfflineJobs.JobOwnershipDenied",
  "Message": "You do not have permission to access this job.",
  "Response": null
}

```

***

### Hatalı Yanıt (404 Not Found)

İki farklı durumda döner:

| Kod                            | Mesaj                                            | Ne zaman                                                          |
| ------------------------------ | ------------------------------------------------ | ----------------------------------------------------------------- |
| `OfflineJobs.JobNotFound`      | `No job found for the requested JobId: {jobId}.` | İş yok veya token'daki sigorta şirketi kapsamı dışında.           |
| `OfflineAction.ActionNotFound` | `Job action with id {jobActionId} not found.`    | İş erişilebilir, ancak bu iş içinde verilen kimlikte aksiyon yok. |

```json
{
  "Status": false,
  "Code": "OfflineAction.ActionNotFound",
  "Message": "Job action with id 999999 not found.",
  "Response": null
}https://docs.insurgateway.com/offline-constants#offline-stage-action

```

Reference: https://docs.insurgateway.com/insurgateway-api/offline/get-job-action-by-id

## 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)
- `jobActionId` (integer, required)

### Headers

- `Authorization` (string, optional)

## Response

### 200

OK

## Errors

### 400 Bad Request Error

Bad Request

### 403 Forbidden Error

Forbidden

### 404 Not Found Error

Not Found

## Examples

**Response**

```json
{
  "Id": 1234,
  "JobId": 100931,
  "AgentId": 42,
  "CreateDate": "2026-05-13T10:30:00",
  "Message": null,
  "ToFullName": "Ahmet Yılmaz",
  "FromFullName": "InsurCo API User",
  "MessageFrom": 0,
  "MessageTo": 1,
  "Attachments": [],
  "PlatformProposalId": "PROP-001",
  "ActionType": 2
}
```

**SDK Code**

```python Offline_getJobActionById_example
import requests

url = "https://testgatewayapi.insurapps.net/api/offline/jobs/1/actions/1"

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

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

print(response.json())
```

```javascript Offline_getJobActionById_example
const url = 'https://testgatewayapi.insurapps.net/api/offline/jobs/1/actions/1';
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_getJobActionById_example
package main

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

func main() {

	url := "https://testgatewayapi.insurapps.net/api/offline/jobs/1/actions/1"

	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_getJobActionById_example
require 'uri'
require 'net/http'

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

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_getJobActionById_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/1/actions/1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Offline_getJobActionById_example
using RestSharp;

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

```swift Offline_getJobActionById_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://testgatewayapi.insurapps.net/api/offline/jobs/1/actions/1")! 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()
```