# Belgeyi XML Olarak gönderir

## SKG Belgesini UBL-TR Xml formatında zipli yada açık halde (Xml) olarak gönderir.

> SKG Belgesini UBL-TR Xml formatında zipli yada açık halde (Xml) göndermek için bu uç kullanılır.

```json
{"openapi":"3.0.1","info":{"title":"E-Sigorta Komisyon Gider Belgesi API","version":"v1"},"servers":[{"url":"/einvoice"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API anahtar� giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"SendResponse":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"InsuranceNumber":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/Send/Xml":{"post":{"tags":["Send"],"summary":"SKG Belgesini UBL-TR Xml formatında zipli yada açık halde (Xml) olarak gönderir.","description":"SKG Belgesini UBL-TR Xml formatında zipli yada açık halde (Xml) göndermek için bu uç kullanılır.","parameters":[{"name":"TemplateUUID","in":"query","description":"Şablon UUID Bilgisi","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"SKG Belgesini XML (UBL) olarak gönderir.","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SendResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}}}},"400":{"description":"Geçersiz İstek | Gönderdiğiniz istekte geçersiz veriler bulunduğu anlamında gelmektedir | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#badrequest-400\">tıklayınız</a>"},"403":{"description":"Yetkisiz Erişim | Bu uca erişmek için gerekli yetkiye sahip olmadığınız durumda dönülür"},"404":{"description":"Parametrede belirtilen kayıt bulunamadığında dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#notfound-404\">tıklayınız</a>"},"409":{"description":"Gönderdiğiniz istek sistemde daha önce bulunduğunda dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#conflict-409\">tıklayınız</a>"},"422":{"description":"Gönderdiğiniz istek geçerli fakat iş kuralları gereği geçersiz değerler içerdiğinde dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#unprocessableentity-422\">tıklayınız</a>"}}}}}}
```

{% tabs %}
{% tab title="C#" %}

```csharp
var options = new RestClientOptions("//einsurance/Send/Xml?TemplateUUID=<uuid>")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "multipart/form-data");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "Bearer {{bearerToken}}");
request.AlwaysMultipartFormData = true;
request.AddFile("file", "/path/to/file");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '//einsurance/Send/Xml?TemplateUUID=%3Cuuid%3E',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/path/to/file')),
  CURLOPT_HTTPHEADER => array(
    'Content-Type: multipart/form-data',
    'Accept: text/plain',
    'Authorization: Bearer {{bearerToken}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('/path/to/file'));

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: '//einsurance/Send/Xml?TemplateUUID=<uuid>',
  headers: { 
    'Content-Type': 'multipart/form-data', 
    'Accept': 'text/plain', 
    'Authorization': 'Bearer {{bearerToken}}', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.nilvera.com/api/e-skgb-api/e-sgkb-gonderme/belgeyi-xml-olarak-gonderir.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
