SQL Server / EDS API / Dokuments "Ziņojums par pārrobežu shēmu".
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Accept', 'application/json'
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://eds.vid.gov.lv/api/doc/zpsv1/:id', @sbResponseBody
IF @success = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
-- Sample JSON response:
-- (Sample code for parsing the JSON response is shown below)
-- {
-- "Epasts": "sunt esse",
-- "Talrunis": "cillum do nul",
-- "IesniegumaVeids": "consectetur",
-- "Sagatavotajs": "amet eiusmod et",
-- "NMNosaukums": "aliqua ad et tempor",
-- "Vards": "sed incididunt",
-- "Uzvards": "quis",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasVieta": "commodo voluptate",
-- "Tips": "amet",
-- "Adrese": {
-- "Iela": "et Excepteur",
-- "Maja": "Excepteur amet occaecat",
-- "Dzivoklis": "Excepteur ea esse laboris",
-- "Ciems": "consequat reprehenderit",
-- "PilsPag": "eiusmod aute",
-- "PastaInd": "nisi dolore irure do",
-- "Valsts": "id dolore"
-- },
-- "RezidencesValstis": "dolor laborum",
-- "Loma": "ea",
-- "Statuss": "nulla nisi reprehenderit",
-- "IesniedzejaLoma": "laboris sint in occaecat",
-- "Atbrivojums": {
-- "ShemasId": "pariatur nisi Ut",
-- "Pamatojums": "ex veniam"
-- },
-- "Pamatinformacija": {
-- "ShemasId": "id nisi",
-- "TirgojamaShema": true,
-- "SakotnejaisZinojums": false,
-- "ZinojumaValoda": "cupidatat sed anim"
-- },
-- "C1": [
-- {
-- "Tips": "ex Duis reprehenderit",
-- "PilsPag": "cons",
-- "Valsts": "do",
-- "NMNosaukums": "labore elit cillum nisi",
-- "Vards": "labore",
-- "VardsNezinams": true,
-- "Uzvards": "dolor aliquip exercitation",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": true,
-- "DzimsanasVieta": "in irure dolore consectetur",
-- "DzimsanasVietaNezinama": true,
-- "NmrKods": "esse aliquip amet dolore",
-- "NmrKodsNezinams": true,
-- "NMValsts": "ipsum ex pariatur cillum",
-- "UzsaksanasDatums": "2000-01-31T00:00:00",
-- "UzsaksanasDatumsNezinams": true,
-- "Iela": "consequat ut anim pariatur",
-- "Maja": "aute laborum incididunt Ut",
-- "Dzivoklis": "magna fugiat dolor",
-- "Ciems": "dolore irure eu minim Lorem",
-- "PastaInd": "in qui fugiat",
-- "Epasts": "nisi aliquip ullamco sit",
-- "RezidencesValstis": "Duis laborum exercitation",
-- "RezidencesValstisNezinams": true,
-- "AssociatedEnterprise": [
-- {
-- "value": "<Error: Too many levels of nesting to fake this schema>"
-- },
-- {
-- "value": "<Error: Too many levels of nesting to fake this schema>"
-- }
-- ]
-- },
-- {
-- "Tips": "sed",
-- "PilsPag": "anim ut",
-- "Valsts": "magna nostrud",
-- "NMNosaukums": "enim laboris eu",
-- "Vards": "qui dolor Duis",
-- "VardsNezinams": false,
-- "Uzvards": "dolor aliquip in non irure",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": false,
-- "DzimsanasVieta": "proident",
-- "DzimsanasVietaNezinama": true,
-- "NmrKods": "enim eu laborum in labore",
-- "NmrKodsNezinams": false,
-- "NMValsts": "laborum consequat nisi quis",
-- "UzsaksanasDatums": "2000-01-31T00:00:00",
-- "UzsaksanasDatumsNezinams": false,
-- "Iela": "dolor do enim voluptate",
-- "Maja": "in et laborum elit",
-- "Dzivoklis": "velit in occaecat quis est",
-- "Ciems": "ut nisi",
-- "PastaInd": "voluptate minim qui tempor",
-- "Epasts": "ex ullamco velit nisi",
-- "RezidencesValstis": "esse d",
-- "RezidencesValstisNezinams": true,
-- "AssociatedEnterprise": [
-- {
-- "value": "<Error: Too many levels of nesting to fake this schema>"
-- },
-- {
-- "value": "<Error: Too many levels of nesting to fake this schema>"
-- }
-- ]
-- }
-- ],
-- "D1": [
-- {
-- "Tips": "labore esse cillum",
-- "PilsPag": "velit consectetur sit",
-- "Valsts": "laboris Lorem",
-- "NMNosaukums": "adipisicing dolore voluptate",
-- "Vards": "est elit laboris nostrud",
-- "VardsNezinams": true,
-- "Uzvards": "in non minim esse",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": true,
-- "DzimsanasVieta": "et adipisicing commodo minim",
-- "DzimsanasVietaNezinama": false,
-- "NmrKods": "aliqua tempor esse",
-- "NmrKodsNezinams": false,
-- "NMValsts": "ea voluptate ipsum aute proident",
-- "Iela": "elit aute amet eiusmod",
-- "Maja": "labore ",
-- "Dzivoklis": "ut commodo",
-- "Ciems": "cupidatat proident",
-- "PastaInd": "dolore ad nostrud",
-- "Epasts": "Duis veniam incididunt esse exercitation",
-- "RezidencesValstis": "dolor dolor aliquip quis",
-- "RezidencesValstisNezinams": false,
-- "StarpniekaLoma": "elit do",
-- "Atbrivojums": false,
-- "Dalibvalstis": "magna in"
-- },
-- {
-- "Tips": "ut aliquip",
-- "PilsPag": "aliqua esse fugiat",
-- "Valsts": "est anim nostrud",
-- "NMNosaukums": "aute amet",
-- "Vards": "cillum nulla in",
-- "VardsNezinams": false,
-- "Uzvards": "sit nisi officia",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": false,
-- "DzimsanasVieta": "culpa laborum",
-- "DzimsanasVietaNezinama": true,
-- "NmrKods": "aliqua minim sint",
-- "NmrKodsNezinams": true,
-- "NMValsts": "Lorem est ullamco",
-- "Iela": "reprehenderit laborum veniam pariatur",
-- "Maja": "officia veniam",
-- "Dzivoklis": "anim quis deserunt pariatur",
-- "Ciems": "aliqua ex veniam fugiat",
-- "PastaInd": "voluptate",
-- "Epasts": "cillum laboris Lorem veniam mollit",
-- "RezidencesValstis": "est aliquip labore et",
-- "RezidencesValstisNezinams": false,
-- "StarpniekaLoma": "inc",
-- "Atbrivojums": true,
-- "Dalibvalstis": "laboris nostrud ut"
-- }
-- ],
-- "E1": [
-- {
-- "Tips": "non sunt ea velit in",
-- "PilsPag": "non cupidatat ipsum",
-- "Valsts": "consectetur dolore enim dolor",
-- "NMNosaukums": "esse",
-- "Vards": "sint elit reprehenderit ut",
-- "VardsNezinams": false,
-- "Uzvards": "laboris tempor labore anim",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": false,
-- "DzimsanasVieta": "voluptate labore in",
-- "DzimsanasVietaNezinama": false,
-- "NmrKods": "aliquip pariatur dolor nulla ipsum",
-- "NmrKodsNezinams": true,
-- "NMValsts": "irure dolore ullamco",
-- "Iela": "et enim anim",
-- "Maja": "in quis dolore ea esse",
-- "Dzivoklis": "culpa esse",
-- "Ciems": "aliquip",
-- "PastaInd": "consequat eu deserunt commodo",
-- "Epasts": "commodo nulla",
-- "RezidencesValstis": "quis id",
-- "RezidencesValstisNezinams": true
-- },
-- {
-- "Tips": "nulla non proident minim",
-- "PilsPag": "ut velit proident incididunt pariatur",
-- "Valsts": "esse nisi reprehenderit eiusmod qui",
-- "NMNosaukums": "amet dolor consequat",
-- "Vards": "esse",
-- "VardsNezinams": false,
-- "Uzvards": "reprehenderit in irure deserunt",
-- "DzimsanasDatums": "2000-01-31T00:00:00",
-- "DzimsanasDatumsNezinams": false,
-- "DzimsanasVieta": "in",
-- "DzimsanasVietaNezinama": false,
-- "NmrKods": "offici",
-- "NmrKodsNezinams": true,
-- "NMValsts": "dolore irure minim",
-- "Iela": "",
-- "Maja": "qui dolore dolor id",
-- "Dzivoklis": "minim Lorem",
-- "Ciems": "in fugiat exercitation nostrud",
-- "PastaInd": "sint ullamco",
-- "Epasts": "nisi sed",
-- "RezidencesValstis": "commodo aliquip",
-- "RezidencesValstisNezinams": false
-- }
-- ],
-- "ZinojumaInfo": {
-- "ZinojumaNosaukums": "laborum aute in adipisicing",
-- "Kopsavilkums": "sint est",
-- "Pazimes": "veniam ad aliqua off",
-- "AttiecinamasValstis": "dolore quis",
-- "Regulejums": "Excepteur commodo sit cupidatat",
-- "UzsaksanasDatums": "2000-01-31T00:00:00",
-- "UzsaksanasDatumsNezinams": true,
-- "ZinosanasIemesls": "laborum irure consectetur",
-- "Tests": true,
-- "D1citiKomentars": "Lorem cillum do ad incididunt",
-- "Summa": -18266963,
-- "SummaNezinama": false,
-- "Valuta": "qui cillum id"
-- },
-- "Id": -17090445,
-- "UID": "commodo aute consequat",
-- "NmrKods": "deserunt ",
-- "Precizejums": true,
-- "PrecizejamaisDokuments": 68257581,
-- "PrecizejumaPamatojums": "cupidatat eu"
-- }
-- Sample code for parsing the JSON response...
-- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
DECLARE @VardsNezinams int
DECLARE @DzimsanasDatumsNezinams int
DECLARE @DzimsanasVietaNezinama int
DECLARE @NmrKodsNezinams int
DECLARE @NMValsts nvarchar(4000)
DECLARE @RezidencesValstisNezinams int
DECLARE @j int
DECLARE @count_j int
DECLARE @value nvarchar(4000)
DECLARE @StarpniekaLoma nvarchar(4000)
DECLARE @Atbrivojums int
DECLARE @Dalibvalstis nvarchar(4000)
DECLARE @Epasts nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Epasts OUT, 'Epasts'
DECLARE @Talrunis nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Talrunis OUT, 'Talrunis'
DECLARE @IesniegumaVeids nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @IesniegumaVeids OUT, 'IesniegumaVeids'
DECLARE @Sagatavotajs nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Sagatavotajs OUT, 'Sagatavotajs'
DECLARE @NMNosaukums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @NMNosaukums OUT, 'NMNosaukums'
DECLARE @Vards nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Vards OUT, 'Vards'
DECLARE @Uzvards nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Uzvards OUT, 'Uzvards'
DECLARE @DzimsanasDatums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasDatums OUT, 'DzimsanasDatums'
DECLARE @DzimsanasVieta nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasVieta OUT, 'DzimsanasVieta'
DECLARE @Tips nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Tips OUT, 'Tips'
DECLARE @Iela nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Iela OUT, 'Adrese.Iela'
DECLARE @Maja nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Maja OUT, 'Adrese.Maja'
DECLARE @Dzivoklis nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Dzivoklis OUT, 'Adrese.Dzivoklis'
DECLARE @Ciems nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Ciems OUT, 'Adrese.Ciems'
DECLARE @PilsPag nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @PilsPag OUT, 'Adrese.PilsPag'
DECLARE @PastaInd nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @PastaInd OUT, 'Adrese.PastaInd'
DECLARE @Valsts nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Valsts OUT, 'Adrese.Valsts'
DECLARE @RezidencesValstis nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @RezidencesValstis OUT, 'RezidencesValstis'
DECLARE @Loma nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Loma OUT, 'Loma'
DECLARE @Statuss nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Statuss OUT, 'Statuss'
DECLARE @IesniedzejaLoma nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @IesniedzejaLoma OUT, 'IesniedzejaLoma'
DECLARE @ShemasId nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @ShemasId OUT, 'Atbrivojums.ShemasId'
DECLARE @Pamatojums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Pamatojums OUT, 'Atbrivojums.Pamatojums'
DECLARE @PamatinformacijaShemasId nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @PamatinformacijaShemasId OUT, 'Pamatinformacija.ShemasId'
DECLARE @TirgojamaShema int
EXEC sp_OAMethod @jResp, 'BoolOf', @TirgojamaShema OUT, 'Pamatinformacija.TirgojamaShema'
DECLARE @SakotnejaisZinojums int
EXEC sp_OAMethod @jResp, 'BoolOf', @SakotnejaisZinojums OUT, 'Pamatinformacija.SakotnejaisZinojums'
DECLARE @ZinojumaValoda nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @ZinojumaValoda OUT, 'Pamatinformacija.ZinojumaValoda'
DECLARE @ZinojumaNosaukums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @ZinojumaNosaukums OUT, 'ZinojumaInfo.ZinojumaNosaukums'
DECLARE @Kopsavilkums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Kopsavilkums OUT, 'ZinojumaInfo.Kopsavilkums'
DECLARE @Pazimes nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Pazimes OUT, 'ZinojumaInfo.Pazimes'
DECLARE @AttiecinamasValstis nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @AttiecinamasValstis OUT, 'ZinojumaInfo.AttiecinamasValstis'
DECLARE @Regulejums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Regulejums OUT, 'ZinojumaInfo.Regulejums'
DECLARE @UzsaksanasDatums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @UzsaksanasDatums OUT, 'ZinojumaInfo.UzsaksanasDatums'
DECLARE @UzsaksanasDatumsNezinams int
EXEC sp_OAMethod @jResp, 'BoolOf', @UzsaksanasDatumsNezinams OUT, 'ZinojumaInfo.UzsaksanasDatumsNezinams'
DECLARE @ZinosanasIemesls nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @ZinosanasIemesls OUT, 'ZinojumaInfo.ZinosanasIemesls'
DECLARE @Tests int
EXEC sp_OAMethod @jResp, 'BoolOf', @Tests OUT, 'ZinojumaInfo.Tests'
DECLARE @D1citiKomentars nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @D1citiKomentars OUT, 'ZinojumaInfo.D1citiKomentars'
DECLARE @Summa int
EXEC sp_OAMethod @jResp, 'IntOf', @Summa OUT, 'ZinojumaInfo.Summa'
DECLARE @SummaNezinama int
EXEC sp_OAMethod @jResp, 'BoolOf', @SummaNezinama OUT, 'ZinojumaInfo.SummaNezinama'
DECLARE @Valuta nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Valuta OUT, 'ZinojumaInfo.Valuta'
DECLARE @Id int
EXEC sp_OAMethod @jResp, 'IntOf', @Id OUT, 'Id'
DECLARE @UID nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @UID OUT, 'UID'
DECLARE @NmrKods nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @NmrKods OUT, 'NmrKods'
DECLARE @Precizejums int
EXEC sp_OAMethod @jResp, 'BoolOf', @Precizejums OUT, 'Precizejums'
DECLARE @PrecizejamaisDokuments int
EXEC sp_OAMethod @jResp, 'IntOf', @PrecizejamaisDokuments OUT, 'PrecizejamaisDokuments'
DECLARE @PrecizejumaPamatojums nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @PrecizejumaPamatojums OUT, 'PrecizejumaPamatojums'
DECLARE @i int
SELECT @i = 0
DECLARE @count_i int
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'C1'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Tips OUT, 'C1[i].Tips'
EXEC sp_OAMethod @jResp, 'StringOf', @PilsPag OUT, 'C1[i].PilsPag'
EXEC sp_OAMethod @jResp, 'StringOf', @Valsts OUT, 'C1[i].Valsts'
EXEC sp_OAMethod @jResp, 'StringOf', @NMNosaukums OUT, 'C1[i].NMNosaukums'
EXEC sp_OAMethod @jResp, 'StringOf', @Vards OUT, 'C1[i].Vards'
EXEC sp_OAMethod @jResp, 'BoolOf', @VardsNezinams OUT, 'C1[i].VardsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @Uzvards OUT, 'C1[i].Uzvards'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasDatums OUT, 'C1[i].DzimsanasDatums'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasDatumsNezinams OUT, 'C1[i].DzimsanasDatumsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasVieta OUT, 'C1[i].DzimsanasVieta'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasVietaNezinama OUT, 'C1[i].DzimsanasVietaNezinama'
EXEC sp_OAMethod @jResp, 'StringOf', @NmrKods OUT, 'C1[i].NmrKods'
EXEC sp_OAMethod @jResp, 'BoolOf', @NmrKodsNezinams OUT, 'C1[i].NmrKodsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @NMValsts OUT, 'C1[i].NMValsts'
EXEC sp_OAMethod @jResp, 'StringOf', @UzsaksanasDatums OUT, 'C1[i].UzsaksanasDatums'
EXEC sp_OAMethod @jResp, 'BoolOf', @UzsaksanasDatumsNezinams OUT, 'C1[i].UzsaksanasDatumsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @Iela OUT, 'C1[i].Iela'
EXEC sp_OAMethod @jResp, 'StringOf', @Maja OUT, 'C1[i].Maja'
EXEC sp_OAMethod @jResp, 'StringOf', @Dzivoklis OUT, 'C1[i].Dzivoklis'
EXEC sp_OAMethod @jResp, 'StringOf', @Ciems OUT, 'C1[i].Ciems'
EXEC sp_OAMethod @jResp, 'StringOf', @PastaInd OUT, 'C1[i].PastaInd'
EXEC sp_OAMethod @jResp, 'StringOf', @Epasts OUT, 'C1[i].Epasts'
EXEC sp_OAMethod @jResp, 'StringOf', @RezidencesValstis OUT, 'C1[i].RezidencesValstis'
EXEC sp_OAMethod @jResp, 'BoolOf', @RezidencesValstisNezinams OUT, 'C1[i].RezidencesValstisNezinams'
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'C1[i].AssociatedEnterprise'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @value OUT, 'C1[i].AssociatedEnterprise[j].value'
SELECT @j = @j + 1
END
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'D1'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Tips OUT, 'D1[i].Tips'
EXEC sp_OAMethod @jResp, 'StringOf', @PilsPag OUT, 'D1[i].PilsPag'
EXEC sp_OAMethod @jResp, 'StringOf', @Valsts OUT, 'D1[i].Valsts'
EXEC sp_OAMethod @jResp, 'StringOf', @NMNosaukums OUT, 'D1[i].NMNosaukums'
EXEC sp_OAMethod @jResp, 'StringOf', @Vards OUT, 'D1[i].Vards'
EXEC sp_OAMethod @jResp, 'BoolOf', @VardsNezinams OUT, 'D1[i].VardsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @Uzvards OUT, 'D1[i].Uzvards'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasDatums OUT, 'D1[i].DzimsanasDatums'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasDatumsNezinams OUT, 'D1[i].DzimsanasDatumsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasVieta OUT, 'D1[i].DzimsanasVieta'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasVietaNezinama OUT, 'D1[i].DzimsanasVietaNezinama'
EXEC sp_OAMethod @jResp, 'StringOf', @NmrKods OUT, 'D1[i].NmrKods'
EXEC sp_OAMethod @jResp, 'BoolOf', @NmrKodsNezinams OUT, 'D1[i].NmrKodsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @NMValsts OUT, 'D1[i].NMValsts'
EXEC sp_OAMethod @jResp, 'StringOf', @Iela OUT, 'D1[i].Iela'
EXEC sp_OAMethod @jResp, 'StringOf', @Maja OUT, 'D1[i].Maja'
EXEC sp_OAMethod @jResp, 'StringOf', @Dzivoklis OUT, 'D1[i].Dzivoklis'
EXEC sp_OAMethod @jResp, 'StringOf', @Ciems OUT, 'D1[i].Ciems'
EXEC sp_OAMethod @jResp, 'StringOf', @PastaInd OUT, 'D1[i].PastaInd'
EXEC sp_OAMethod @jResp, 'StringOf', @Epasts OUT, 'D1[i].Epasts'
EXEC sp_OAMethod @jResp, 'StringOf', @RezidencesValstis OUT, 'D1[i].RezidencesValstis'
EXEC sp_OAMethod @jResp, 'BoolOf', @RezidencesValstisNezinams OUT, 'D1[i].RezidencesValstisNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @StarpniekaLoma OUT, 'D1[i].StarpniekaLoma'
EXEC sp_OAMethod @jResp, 'BoolOf', @Atbrivojums OUT, 'D1[i].Atbrivojums'
EXEC sp_OAMethod @jResp, 'StringOf', @Dalibvalstis OUT, 'D1[i].Dalibvalstis'
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'E1'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Tips OUT, 'E1[i].Tips'
EXEC sp_OAMethod @jResp, 'StringOf', @PilsPag OUT, 'E1[i].PilsPag'
EXEC sp_OAMethod @jResp, 'StringOf', @Valsts OUT, 'E1[i].Valsts'
EXEC sp_OAMethod @jResp, 'StringOf', @NMNosaukums OUT, 'E1[i].NMNosaukums'
EXEC sp_OAMethod @jResp, 'StringOf', @Vards OUT, 'E1[i].Vards'
EXEC sp_OAMethod @jResp, 'BoolOf', @VardsNezinams OUT, 'E1[i].VardsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @Uzvards OUT, 'E1[i].Uzvards'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasDatums OUT, 'E1[i].DzimsanasDatums'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasDatumsNezinams OUT, 'E1[i].DzimsanasDatumsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @DzimsanasVieta OUT, 'E1[i].DzimsanasVieta'
EXEC sp_OAMethod @jResp, 'BoolOf', @DzimsanasVietaNezinama OUT, 'E1[i].DzimsanasVietaNezinama'
EXEC sp_OAMethod @jResp, 'StringOf', @NmrKods OUT, 'E1[i].NmrKods'
EXEC sp_OAMethod @jResp, 'BoolOf', @NmrKodsNezinams OUT, 'E1[i].NmrKodsNezinams'
EXEC sp_OAMethod @jResp, 'StringOf', @NMValsts OUT, 'E1[i].NMValsts'
EXEC sp_OAMethod @jResp, 'StringOf', @Iela OUT, 'E1[i].Iela'
EXEC sp_OAMethod @jResp, 'StringOf', @Maja OUT, 'E1[i].Maja'
EXEC sp_OAMethod @jResp, 'StringOf', @Dzivoklis OUT, 'E1[i].Dzivoklis'
EXEC sp_OAMethod @jResp, 'StringOf', @Ciems OUT, 'E1[i].Ciems'
EXEC sp_OAMethod @jResp, 'StringOf', @PastaInd OUT, 'E1[i].PastaInd'
EXEC sp_OAMethod @jResp, 'StringOf', @Epasts OUT, 'E1[i].Epasts'
EXEC sp_OAMethod @jResp, 'StringOf', @RezidencesValstis OUT, 'E1[i].RezidencesValstis'
EXEC sp_OAMethod @jResp, 'BoolOf', @RezidencesValstisNezinams OUT, 'E1[i].RezidencesValstisNezinams'
SELECT @i = @i + 1
END
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -X GET
-H "Accept: application/json"
https://eds.vid.gov.lv/api/doc/zpsv1/:id
Postman Collection Item JSON
{
"name": "Dokuments \"Ziņojums par pārrobežu shēmu\".",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/doc/zpsv1/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zpsv1",
":id"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta id."
}
]
}
},
"response": [
{
"name": "OK",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/zpsv1/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zpsv1",
":id"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta id."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"Epasts\": \"sunt esse\",\n \"Talrunis\": \"cillum do nul\",\n \"IesniegumaVeids\": \"consectetur\",\n \"Sagatavotajs\": \"amet eiusmod et\",\n \"NMNosaukums\": \"aliqua ad et tempor\",\n \"Vards\": \"sed incididunt\",\n \"Uzvards\": \"quis\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasVieta\": \"commodo voluptate\",\n \"Tips\": \"amet\",\n \"Adrese\": {\n \"Iela\": \"et Excepteur\",\n \"Maja\": \"Excepteur amet occaecat\",\n \"Dzivoklis\": \"Excepteur ea esse laboris\",\n \"Ciems\": \"consequat reprehenderit\",\n \"PilsPag\": \"eiusmod aute\",\n \"PastaInd\": \"nisi dolore irure do\",\n \"Valsts\": \"id dolore\"\n },\n \"RezidencesValstis\": \"dolor laborum\",\n \"Loma\": \"ea\",\n \"Statuss\": \"nulla nisi reprehenderit\",\n \"IesniedzejaLoma\": \"laboris sint in occaecat\",\n \"Atbrivojums\": {\n \"ShemasId\": \"pariatur nisi Ut\",\n \"Pamatojums\": \"ex veniam\"\n },\n \"Pamatinformacija\": {\n \"ShemasId\": \"id nisi\",\n \"TirgojamaShema\": true,\n \"SakotnejaisZinojums\": false,\n \"ZinojumaValoda\": \"cupidatat sed anim\"\n },\n \"C1\": [\n {\n \"Tips\": \"ex Duis reprehenderit\",\n \"PilsPag\": \"cons\",\n \"Valsts\": \"do\",\n \"NMNosaukums\": \"labore elit cillum nisi\",\n \"Vards\": \"labore\",\n \"VardsNezinams\": true,\n \"Uzvards\": \"dolor aliquip exercitation\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": true,\n \"DzimsanasVieta\": \"in irure dolore consectetur\",\n \"DzimsanasVietaNezinama\": true,\n \"NmrKods\": \"esse aliquip amet dolore\",\n \"NmrKodsNezinams\": true,\n \"NMValsts\": \"ipsum ex pariatur cillum\",\n \"UzsaksanasDatums\": \"2000-01-31T00:00:00\",\n \"UzsaksanasDatumsNezinams\": true,\n \"Iela\": \"consequat ut anim pariatur\",\n \"Maja\": \"aute laborum incididunt Ut\",\n \"Dzivoklis\": \"magna fugiat dolor\",\n \"Ciems\": \"dolore irure eu minim Lorem\",\n \"PastaInd\": \"in qui fugiat\",\n \"Epasts\": \"nisi aliquip ullamco sit\",\n \"RezidencesValstis\": \"Duis laborum exercitation\",\n \"RezidencesValstisNezinams\": true,\n \"AssociatedEnterprise\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n },\n {\n \"Tips\": \"sed\",\n \"PilsPag\": \"anim ut\",\n \"Valsts\": \"magna nostrud\",\n \"NMNosaukums\": \"enim laboris eu\",\n \"Vards\": \"qui dolor Duis\",\n \"VardsNezinams\": false,\n \"Uzvards\": \"dolor aliquip in non irure\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": false,\n \"DzimsanasVieta\": \"proident\",\n \"DzimsanasVietaNezinama\": true,\n \"NmrKods\": \"enim eu laborum in labore\",\n \"NmrKodsNezinams\": false,\n \"NMValsts\": \"laborum consequat nisi quis\",\n \"UzsaksanasDatums\": \"2000-01-31T00:00:00\",\n \"UzsaksanasDatumsNezinams\": false,\n \"Iela\": \"dolor do enim voluptate\",\n \"Maja\": \"in et laborum elit\",\n \"Dzivoklis\": \"velit in occaecat quis est\",\n \"Ciems\": \"ut nisi\",\n \"PastaInd\": \"voluptate minim qui tempor\",\n \"Epasts\": \"ex ullamco velit nisi\",\n \"RezidencesValstis\": \"esse d\",\n \"RezidencesValstisNezinams\": true,\n \"AssociatedEnterprise\": [\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n },\n {\n \"value\": \"<Error: Too many levels of nesting to fake this schema>\"\n }\n ]\n }\n ],\n \"D1\": [\n {\n \"Tips\": \"labore esse cillum\",\n \"PilsPag\": \"velit consectetur sit\",\n \"Valsts\": \"laboris Lorem\",\n \"NMNosaukums\": \"adipisicing dolore voluptate\",\n \"Vards\": \"est elit laboris nostrud\",\n \"VardsNezinams\": true,\n \"Uzvards\": \"in non minim esse\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": true,\n \"DzimsanasVieta\": \"et adipisicing commodo minim\",\n \"DzimsanasVietaNezinama\": false,\n \"NmrKods\": \"aliqua tempor esse\",\n \"NmrKodsNezinams\": false,\n \"NMValsts\": \"ea voluptate ipsum aute proident\",\n \"Iela\": \"elit aute amet eiusmod\",\n \"Maja\": \"labore \",\n \"Dzivoklis\": \"ut commodo\",\n \"Ciems\": \"cupidatat proident\",\n \"PastaInd\": \"dolore ad nostrud\",\n \"Epasts\": \"Duis veniam incididunt esse exercitation\",\n \"RezidencesValstis\": \"dolor dolor aliquip quis\",\n \"RezidencesValstisNezinams\": false,\n \"StarpniekaLoma\": \"elit do\",\n \"Atbrivojums\": false,\n \"Dalibvalstis\": \"magna in\"\n },\n {\n \"Tips\": \"ut aliquip\",\n \"PilsPag\": \"aliqua esse fugiat\",\n \"Valsts\": \"est anim nostrud\",\n \"NMNosaukums\": \"aute amet\",\n \"Vards\": \"cillum nulla in\",\n \"VardsNezinams\": false,\n \"Uzvards\": \"sit nisi officia\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": false,\n \"DzimsanasVieta\": \"culpa laborum\",\n \"DzimsanasVietaNezinama\": true,\n \"NmrKods\": \"aliqua minim sint\",\n \"NmrKodsNezinams\": true,\n \"NMValsts\": \"Lorem est ullamco\",\n \"Iela\": \"reprehenderit laborum veniam pariatur\",\n \"Maja\": \"officia veniam\",\n \"Dzivoklis\": \"anim quis deserunt pariatur\",\n \"Ciems\": \"aliqua ex veniam fugiat\",\n \"PastaInd\": \"voluptate\",\n \"Epasts\": \"cillum laboris Lorem veniam mollit\",\n \"RezidencesValstis\": \"est aliquip labore et\",\n \"RezidencesValstisNezinams\": false,\n \"StarpniekaLoma\": \"inc\",\n \"Atbrivojums\": true,\n \"Dalibvalstis\": \"laboris nostrud ut\"\n }\n ],\n \"E1\": [\n {\n \"Tips\": \"non sunt ea velit in\",\n \"PilsPag\": \"non cupidatat ipsum\",\n \"Valsts\": \"consectetur dolore enim dolor\",\n \"NMNosaukums\": \"esse\",\n \"Vards\": \"sint elit reprehenderit ut\",\n \"VardsNezinams\": false,\n \"Uzvards\": \"laboris tempor labore anim\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": false,\n \"DzimsanasVieta\": \"voluptate labore in\",\n \"DzimsanasVietaNezinama\": false,\n \"NmrKods\": \"aliquip pariatur dolor nulla ipsum\",\n \"NmrKodsNezinams\": true,\n \"NMValsts\": \"irure dolore ullamco\",\n \"Iela\": \"et enim anim\",\n \"Maja\": \"in quis dolore ea esse\",\n \"Dzivoklis\": \"culpa esse\",\n \"Ciems\": \"aliquip\",\n \"PastaInd\": \"consequat eu deserunt commodo\",\n \"Epasts\": \"commodo nulla\",\n \"RezidencesValstis\": \"quis id\",\n \"RezidencesValstisNezinams\": true\n },\n {\n \"Tips\": \"nulla non proident minim\",\n \"PilsPag\": \"ut velit proident incididunt pariatur\",\n \"Valsts\": \"esse nisi reprehenderit eiusmod qui\",\n \"NMNosaukums\": \"amet dolor consequat\",\n \"Vards\": \"esse\",\n \"VardsNezinams\": false,\n \"Uzvards\": \"reprehenderit in irure deserunt\",\n \"DzimsanasDatums\": \"2000-01-31T00:00:00\",\n \"DzimsanasDatumsNezinams\": false,\n \"DzimsanasVieta\": \"in\",\n \"DzimsanasVietaNezinama\": false,\n \"NmrKods\": \"offici\",\n \"NmrKodsNezinams\": true,\n \"NMValsts\": \"dolore irure minim\",\n \"Iela\": \"\",\n \"Maja\": \"qui dolore dolor id\",\n \"Dzivoklis\": \"minim Lorem\",\n \"Ciems\": \"in fugiat exercitation nostrud\",\n \"PastaInd\": \"sint ullamco\",\n \"Epasts\": \"nisi sed\",\n \"RezidencesValstis\": \"commodo aliquip\",\n \"RezidencesValstisNezinams\": false\n }\n ],\n \"ZinojumaInfo\": {\n \"ZinojumaNosaukums\": \"laborum aute in adipisicing\",\n \"Kopsavilkums\": \"sint est\",\n \"Pazimes\": \"veniam ad aliqua off\",\n \"AttiecinamasValstis\": \"dolore quis\",\n \"Regulejums\": \"Excepteur commodo sit cupidatat\",\n \"UzsaksanasDatums\": \"2000-01-31T00:00:00\",\n \"UzsaksanasDatumsNezinams\": true,\n \"ZinosanasIemesls\": \"laborum irure consectetur\",\n \"Tests\": true,\n \"D1citiKomentars\": \"Lorem cillum do ad incididunt\",\n \"Summa\": -18266963,\n \"SummaNezinama\": false,\n \"Valuta\": \"qui cillum id\"\n },\n \"Id\": -17090445,\n \"UID\": \"commodo aute consequat\",\n \"NmrKods\": \"deserunt \",\n \"Precizejums\": true,\n \"PrecizejamaisDokuments\": 68257581,\n \"PrecizejumaPamatojums\": \"cupidatat eu\"\n}"
},
{
"name": "Lietotājs nav autentificēts.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/zpsv1/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zpsv1",
":id"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta id."
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Dokuments neeksistē vai lietotājam nav tiesību.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/zpsv1/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zpsv1",
":id"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta id."
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Pārsniegts izsaukumu skaita ierobežojums.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/zpsv1/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
"zpsv1",
":id"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta id."
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}