# Authentication Login POST https://gatewayapi.insurapps.net/api/Authentication/login Content-Type: application/json ## Kimlik Doğrulama - Giriş Kullanıcıyı doğrular ve bir JWT erişim token'ı, yenileme token'ı (refresh token) ve token'ın son kullanma tarihini döndürür. ### Uç Nokta (Endpoint) `POST {{baseUrl}}/api/Authentication/login` --- ### İstek Gövdesi (Request Body) | Alan | Tür | Zorunlu | Açıklama | | --- | --- | --- | --- | | `UserName` | string | ✅ | Hesaba ait kullanıcı adı. | | `Password` | string | ✅ | Hesaba ait şifre. | | `WebApiKey` | string | ✅ | Uygulama için Web API anahtarı. Varsayılan erişim için `"-"` kullanılır. | **Örnek İstek Gövdesi:** ``` json { "UserName": "", "Password": "", "WebApiKey": "-" } ``` --- ### Başarılı Yanıt (200 OK) Başarılı bir istekte HTTP `200 OK` durum kodu ile aşağıdaki JSON gövdesi döner: | Alan | Tür | Açıklama | | --- | --- | --- | | `Token` | string | Sonraki kimlik doğrulamalı isteklerde kullanılacak JWT erişim token'ı. | | `RefreshToken` | string | Mevcut erişim token'ı süresi dolduğunda yeni bir token almak için kullanılan yenileme token'ı. | | `Expiration` | string (ISO 8601) | Erişim token'ının süresinin dolacağı UTC tarih ve saat bilgisi. | **Örnek Başarılı Yanıt:** ``` json { "Token": "", "RefreshToken": "", "Expiration": "2026-03-13T12:01:11Z" } ``` --- ### Hatalı Yanıt (400 Bad Request) Giriş bilgileri yanlış olduğunda (kullanıcı adı veya şifre hatalı) HTTP `400 Bad Request` durum kodu ile aşağıdaki metin döner: **Örnek Hatalı Yanıt:** ``` Giriş bilgileri hatalı. Lütfen tekrar deneyin. ``` > ⚠️ Bu hata genellikle yanlış kullanıcı adı, hatalı şifre veya geçersiz API anahtarı gönderildiğinde oluşur. --- ### Kullanım Başarılı bir giriş işleminden sonra, dönen `Token` değerini `Expiration` zamanına kadar istek atabilirsiniz. Reference: https://docs.insurgateway.com/offline-api/authentication/authentication-login ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /api/Authentication/login: post: operationId: authentication-login summary: Authentication Login description: >- ## Kimlik Doğrulama - Giriş Kullanıcıyı doğrular ve bir JWT erişim token'ı, yenileme token'ı (refresh token) ve token'ın son kullanma tarihini döndürür. ### Uç Nokta (Endpoint) `POST {{baseUrl}}/api/Authentication/login` --- ### İstek Gövdesi (Request Body) | Alan | Tür | Zorunlu | Açıklama | | --- | --- | --- | --- | | `UserName` | string | ✅ | Hesaba ait kullanıcı adı. | | `Password` | string | ✅ | Hesaba ait şifre. | | `WebApiKey` | string | ✅ | Uygulama için Web API anahtarı. Varsayılan erişim için `"-"` kullanılır. | **Örnek İstek Gövdesi:** ``` json { "UserName": "", "Password": "", "WebApiKey": "-" } ``` --- ### Başarılı Yanıt (200 OK) Başarılı bir istekte HTTP `200 OK` durum kodu ile aşağıdaki JSON gövdesi döner: | Alan | Tür | Açıklama | | --- | --- | --- | | `Token` | string | Sonraki kimlik doğrulamalı isteklerde kullanılacak JWT erişim token'ı. | | `RefreshToken` | string | Mevcut erişim token'ı süresi dolduğunda yeni bir token almak için kullanılan yenileme token'ı. | | `Expiration` | string (ISO 8601) | Erişim token'ının süresinin dolacağı UTC tarih ve saat bilgisi. | **Örnek Başarılı Yanıt:** ``` json { "Token": "", "RefreshToken": "", "Expiration": "2026-03-13T12:01:11Z" } ``` --- ### Hatalı Yanıt (400 Bad Request) Giriş bilgileri yanlış olduğunda (kullanıcı adı veya şifre hatalı) HTTP `400 Bad Request` durum kodu ile aşağıdaki metin döner: **Örnek Hatalı Yanıt:** ``` Giriş bilgileri hatalı. Lütfen tekrar deneyin. ``` > ⚠️ Bu hata genellikle yanlış kullanıcı adı, hatalı şifre veya geçersiz API anahtarı gönderildiğinde oluşur. --- ### Kullanım Başarılı bir giriş işleminden sonra, dönen `Token` değerini `Expiration` zamanına kadar istek atabilirsiniz. tags: - subpackage_authentication parameters: - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: >- #/components/schemas/Authentication_Authentication Login_Response_200 requestBody: content: application/json: schema: type: object properties: UserName: type: string Password: type: string WebApiKey: type: string required: - UserName - Password - WebApiKey servers: - url: https://gatewayapi.insurapps.net components: schemas: Authentication_Authentication Login_Response_200: type: object properties: Token: type: string RefreshToken: type: string Expiration: type: string format: date-time required: - Token - RefreshToken - Expiration title: Authentication_Authentication Login_Response_200 securitySchemes: bearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python Authentication_Authentication Login_example import requests url = "https://gatewayapi.insurapps.net/api/Authentication/login" payload = { "UserName": "", "Password": "", "WebApiKey": "-" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Authentication_Authentication Login_example const url = 'https://gatewayapi.insurapps.net/api/Authentication/login'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"UserName":"","Password":"","WebApiKey":"-"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Authentication_Authentication Login_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gatewayapi.insurapps.net/api/Authentication/login" payload := strings.NewReader("{\n \"UserName\": \"\",\n \"Password\": \"\",\n \"WebApiKey\": \"-\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Authentication_Authentication Login_example require 'uri' require 'net/http' url = URI("https://gatewayapi.insurapps.net/api/Authentication/login") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"UserName\": \"\",\n \"Password\": \"\",\n \"WebApiKey\": \"-\"\n}" response = http.request(request) puts response.read_body ``` ```java Authentication_Authentication Login_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://gatewayapi.insurapps.net/api/Authentication/login") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"UserName\": \"\",\n \"Password\": \"\",\n \"WebApiKey\": \"-\"\n}") .asString(); ``` ```php Authentication_Authentication Login_example request('POST', 'https://gatewayapi.insurapps.net/api/Authentication/login', [ 'body' => '{ "UserName": "", "Password": "", "WebApiKey": "-" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Authentication_Authentication Login_example using RestSharp; var client = new RestClient("https://gatewayapi.insurapps.net/api/Authentication/login"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"UserName\": \"\",\n \"Password\": \"\",\n \"WebApiKey\": \"-\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Authentication_Authentication Login_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "UserName": "", "Password": "", "WebApiKey": "-" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://gatewayapi.insurapps.net/api/Authentication/login")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```