İlçe oluştur
curl --request POST \
--url https://api.noyax.com/api/v1/definitions/districts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"City": "İSTANBUL",
"Name": "KADIKÖY"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/definitions/districts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"City\": \"İSTANBUL\",\n \"Name\": \"KADIKÖY\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({City: 'İSTANBUL', Name: 'KADIKÖY'})
};
fetch('https://api.noyax.com/api/v1/definitions/districts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/definitions/districts"
payload = {
"City": "İSTANBUL",
"Name": "KADIKÖY"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"City": "İSTANBUL",
"Country": "TÜRKİYE",
"Name": "KADIKÖY"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "0523",
"Message": "City is required.",
"Errors": [
{
"Code": "0523",
"Message": "City is required."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}İlçeler
İlçe oluştur
Yeni ilçe ekler.
POST
/
api
/
v1
/
definitions
/
districts
İlçe oluştur
curl --request POST \
--url https://api.noyax.com/api/v1/definitions/districts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-CompanyID: <x-companyid>' \
--header 'X-UserID: <x-userid>' \
--data '
{
"City": "İSTANBUL",
"Name": "KADIKÖY"
}
'using RestSharp;
var options = new RestClientOptions("https://api.noyax.com/api/v1/definitions/districts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-UserID", "<x-userid>");
request.AddHeader("X-CompanyID", "<x-companyid>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"City\": \"İSTANBUL\",\n \"Name\": \"KADIKÖY\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {
'X-UserID': '<x-userid>',
'X-CompanyID': '<x-companyid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({City: 'İSTANBUL', Name: 'KADIKÖY'})
};
fetch('https://api.noyax.com/api/v1/definitions/districts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.noyax.com/api/v1/definitions/districts"
payload = {
"City": "İSTANBUL",
"Name": "KADIKÖY"
}
headers = {
"X-UserID": "<x-userid>",
"X-CompanyID": "<x-companyid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"Success": true,
"ResultCode": "0000",
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"CityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"City": "İSTANBUL",
"Country": "TÜRKİYE",
"Name": "KADIKÖY"
},
"Message": "<string>"
}{
"Success": false,
"ResultCode": "0523",
"Message": "City is required.",
"Errors": [
{
"Code": "0523",
"Message": "City is required."
}
]
}{
"Success": false,
"ResultCode": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token.",
"Errors": [
{
"Code": "0102",
"Message": "Token has expired. Obtain a new token using the refresh token."
}
]
}{
"Success": false,
"ResultCode": "0110",
"Message": "You do not have permission for this operation.",
"Errors": [
{
"Code": "0110",
"Message": "You do not have permission for this operation."
}
]
}{
"Success": false,
"ResultCode": "0120",
"Message": "Daily request limit (10000) exceeded.",
"Errors": [
{
"Code": "0120",
"Message": "Daily request limit (10000) exceeded."
}
]
}Cityzorunludur ve şirketteki bir ile ait olmalıdır.Namezorunludur ve aynı il içinde benzersiz olmalıdır.
Hata kodları
Bu endpoint’in dönebileceği kodlar. Her endpoint için geçerli olan genel hatalar (kimlik doğrulama, yetki, istek header’ları, istek limitleri) burada tekrarlanmaz.| Kod | HTTP | Anlamı |
|---|---|---|
0002 | 400 | İstek gövdesi okunamadı (bozuk JSON, alan tipi uyumsuz) ya da endpoint’te olmayan bir alan içeriyor |
0003 | 400 | Alan azami uzunluğu aşıyor (mesajda alan adı ve sınır yazar) |
0521 | 400 | İlçe Name zorunlu |
0522 | 400 | İlçe adı aynı ilde başka bir ilçede kullanılıyor; yanıtta var olan kaydın ID’si ExistingId olarak döner |
0523 | 400 | City zorunlu |
0524 | 400 | City ile il bulunamadı |
0580 | 400 | Metinle verilen değer (kod ya da ad) birden fazla kayıtla eşleşiyor; hangisi olduğunu ayırt edecek bilgiyi ekleyin (ör. ilçe için City, il için Country) |
Yetkilendirmeler
Başlıklar
Gövde
application/jsontext/jsonapplication/*+json
Yanıt
Created