# XML Olarak Gönderilecek Faturayı Önizler

## Xml olarak Gönderilecek faturayı ön izler.

> Xml olarak gönderilecek faturayı ön izlemek için bu ucu kullanabilirsiniz.

```json
{"openapi":"3.0.1","info":{"title":"E-Invoice API","version":"v1"},"servers":[{"url":"/einvoice"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API Key Giriniz","scheme":"Bearer","bearerFormat":"JWT"}}},"paths":{"/Send/Xml/Preview":{"post":{"tags":["Send"],"summary":"Xml olarak Gönderilecek faturayı ön izler.","description":"Xml olarak gönderilecek faturayı ön izlemek için bu ucu kullanabilirsiniz.","parameters":[{"name":"Alias","in":"query","description":"Alıcı Etiketi","schema":{"type":"string"}},{"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","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"200":{"description":"Gönderilecek faturayı ön izler","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}},"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("https://apitest.nilvera.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/einvoice/Send/Xml/Preview?Alias=sdfs", Method.Post);
request.AddHeader("Content-Type", "application/xml");
request.AddHeader("Authorization", "Bearer <API KEY>");
request.AddParameter("application/xml", "<file contents here>", ParameterType.RequestBody);
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 => 'https://apitest.nilvera.com/einvoice/Send/Xml/Preview?Alias=sdfs',
  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 => "<file contents here>",
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/xml',
    'Authorization: Bearer <API KEY>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
const axios = require('axios');
let data = '<file contents here>';
let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://apitest.nilvera.com/einvoice/Send/Xml/Preview?Alias=sdfs',
  headers: { 
    'Content-Type': 'application/xml', 
    'Authorization': 'Bearer <API KEY>'
  },
  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-fatura-api/e-fatura-goenderme/xml-olarak-gonderilecek-faturayi-onizler.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.
