Swift3 / EDS API / Izveidot dokumentu "Sezonas laukstrādnieku ienākuma nodokļa maksātāju ziņojums".
Back to Collection Items
func chilkatTest() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = CkoHttp()!
var success: Bool
let req = CkoHttpRequest()!
req.addParam("Epasts", value: "in in")
req.addParam("ParskGads", value: "83772881")
let jsonParam3 = CkoJsonObject()!
jsonParam3.update("NsKods", value: "")
jsonParam3.update("NsVardsUzvards", value: "Ut et adipisicing")
jsonParam3.updateNumber("NsDarbIenakumi", numericStr: "79738068.53705549")
jsonParam3.updateNumber("NsAprDarbIenNod", numericStr: "99230447.92977914")
jsonParam3.updateNumber("NsAprDarbIenNodVsaa", numericStr: "95483030.49111432")
jsonParam3.updateNumber("NsAprDarbIenNodIin", numericStr: "87126083.0950822")
jsonParam3.update("NsNodPerSakums", value: "2000-01-31T00:00:00")
jsonParam3.update("NsNodPerBeigas", value: "2000-01-31T00:00:00")
req.addParam("Rows", value: jsonParam3.emit())
let jsonParam4 = CkoJsonObject()!
jsonParam4.update("NsKods", value: "in mollit")
jsonParam4.update("NsVardsUzvards", value: "Excepteur")
jsonParam4.updateNumber("NsDarbIenakumi", numericStr: "32892900.47157398")
jsonParam4.updateNumber("NsAprDarbIenNod", numericStr: "-59277302.18656078")
jsonParam4.updateNumber("NsAprDarbIenNodVsaa", numericStr: "-1755538.9136055112")
jsonParam4.updateNumber("NsAprDarbIenNodIin", numericStr: "-92412649.47660497")
jsonParam4.update("NsNodPerSakums", value: "2000-01-31T00:00:00")
jsonParam4.update("NsNodPerBeigas", value: "2000-01-31T00:00:00")
req.addParam("Rows", value: jsonParam4.emit())
req.addParam("Talrunis", value: "nostrud elit")
req.addParam("Sagatavotajs", value: "commodo")
req.addParam("ParskMen", value: "est occaecat")
req.addParam("NmrKods", value: "d")
req.addParam("Precizejums", value: "false")
req.addParam("PrecizejamaisDokuments", value: "-43493159")
req.addParam("PrecizejumaPamatojums", value: "aute exercitation")
req.addHeader("Accept", value: "application/json")
var resp: CkoHttpResponse? = http.postUrlEncoded("https://eds.vid.gov.lv/api/doc/zslv1", req: req)
if http.lastMethodSuccess == false {
print("\(http.lastErrorText!)")
return
}
let sbResponseBody = CkoStringBuilder()!
resp!.getBodySb(sbResponseBody)
let jResp = CkoJsonObject()!
jResp.loadSb(sbResponseBody)
jResp.emitCompact = false
print("Response Body:")
print("\(jResp.emit()!)")
var respStatusCode: Int = resp!.statusCode.intValue
print("Response Status Code = \(respStatusCode)")
if respStatusCode >= 400 {
print("Response Header:")
print("\(resp!.header!)")
print("Failed.")
resp = nil
return
}
resp = nil
}
Curl Command
curl -X POST
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
--data-urlencode 'Epasts=in in'
--data-urlencode 'ParskGads=83772881'
--data-urlencode 'Rows={"NsKods":"","NsVardsUzvards":"Ut et adipisicing","NsDarbIenakumi":79738068.53705549,"NsAprDarbIenNod":99230447.92977914,"NsAprDarbIenNodVsaa":95483030.49111432,"NsAprDarbIenNodIin":87126083.0950822,"NsNodPerSakums":"2000-01-31T00:00:00","NsNodPerBeigas":"2000-01-31T00:00:00"}'
--data-urlencode 'Rows={"NsKods":"in mollit","NsVardsUzvards":"Excepteur","NsDarbIenakumi":32892900.47157398,"NsAprDarbIenNod":-59277302.18656078,"NsAprDarbIenNodVsaa":-1755538.9136055112,"NsAprDarbIenNodIin":-92412649.47660497,"NsNodPerSakums":"2000-01-31T00:00:00","NsNodPerBeigas":"2000-01-31T00:00:00"}'
--data-urlencode 'Talrunis=nostrud elit'
--data-urlencode 'Sagatavotajs=commodo'
--data-urlencode 'ParskMen=est occaecat'
--data-urlencode 'NmrKods=d'
--data-urlencode 'Precizejums=false'
--data-urlencode 'PrecizejamaisDokuments=-43493159'
--data-urlencode 'PrecizejumaPamatojums=aute exercitation'
https://eds.vid.gov.lv/api/doc/zslv1
Postman Collection Item JSON
{
"name": "Izveidot dokumentu \"Sezonas laukstrādnieku ienākuma nodokļa maksātāju ziņojums\".",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "in in",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83772881",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"\",\"NsVardsUzvards\":\"Ut et adipisicing\",\"NsDarbIenakumi\":79738068.53705549,\"NsAprDarbIenNod\":99230447.92977914,\"NsAprDarbIenNodVsaa\":95483030.49111432,\"NsAprDarbIenNodIin\":87126083.0950822,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"in mollit\",\"NsVardsUzvards\":\"Excepteur\",\"NsDarbIenakumi\":32892900.47157398,\"NsAprDarbIenNod\":-59277302.18656078,\"NsAprDarbIenNodVsaa\":-1755538.9136055112,\"NsAprDarbIenNodIin\":-92412649.47660497,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "nostrud elit",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "commodo",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "est occaecat",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "d",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-43493159",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "aute exercitation",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"response": [
{
"name": "Izveidotā dokumenta numurs.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "25210683"
},
{
"name": "Pieprasījuma dati ir kļūdaini.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Lietotājs nav autentificēts.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Lietotājam nav tiesību veikt šo darbību.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Dokumenta unikalitātes ierobežojums. Dokuments par norādīto periodu jau izveidots. Lai izveidotu atkārtoti, izmantojiet jaunu drošības talonu.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Conflict",
"code": 409,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Pārsniegts izsaukumu skaita ierobežojums.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "Epasts",
"value": "mollit adipisicing par",
"description": "(Required) Epasta adrese."
},
{
"key": "ParskGads",
"value": "83874150",
"description": "(Required) Taksācijas gads."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ad ulla\",\"NsVardsUzvards\":\"mollit minim Ut\",\"NsDarbIenakumi\":61525570.349401355,\"NsAprDarbIenNod\":-66988745.410857305,\"NsAprDarbIenNodVsaa\":79966060.38369602,\"NsAprDarbIenNodIin\":-59221283.098910995,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Rows",
"value": "{\"NsKods\":\"ea q\",\"NsVardsUzvards\":\"cillum sunt\",\"NsDarbIenakumi\":-49442409.92055273,\"NsAprDarbIenNod\":-93591068.7565555,\"NsAprDarbIenNodVsaa\":27644731.465948164,\"NsAprDarbIenNodIin\":47123246.07144591,\"NsNodPerSakums\":\"2000-01-31T00:00:00\",\"NsNodPerBeigas\":\"2000-01-31T00:00:00\"}",
"description": "Iegūst vai uzstāda dokumenta rindas."
},
{
"key": "Talrunis",
"value": "inc",
"description": "Iesniedzēja tālrunis."
},
{
"key": "Sagatavotajs",
"value": "sunt adipisicing minim nostrud fugiat",
"description": "Sagatavotāja vārds, uzvārds."
},
{
"key": "ParskMen",
"value": "culpa id",
"description": "Taksācijas mēneša kods (01-12)."
},
{
"key": "NmrKods",
"value": "co",
"description": "Nodokļu maksātāja kods."
},
{
"key": "Precizejums",
"value": "false",
"description": "Vai dokuments ir precizējums."
},
{
"key": "PrecizejamaisDokuments",
"value": "-60976858",
"description": "Precizējamā dokumenta numurs."
},
{
"key": "PrecizejumaPamatojums",
"value": "do elit",
"description": "Precizējuma pamatojums."
}
]
},
"url": {
"raw": "{{baseUrl}}/api/doc/zslv1",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zslv1"
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}