VB6 / EDS API / Iesniegt dokumentu.
Back to Collection Items
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim http As New ChilkatHttp
Dim success As Long
http.SetRequestHeader "Accept","application/json"
Dim sbResponseBody As New ChilkatStringBuilder
success = http.QuickGetSb("https://eds.vid.gov.lv/api/doc/:id/submit",sbResponseBody)
If (success = 0) Then
Debug.Print http.LastErrorText
Exit Sub
End If
Dim jResp As New ChilkatJsonObject
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0
Debug.Print "Response Body:"
Debug.Print jResp.Emit()
Dim respStatusCode As Long
respStatusCode = http.LastStatus
Debug.Print "Response Status Code = " & respStatusCode
If (respStatusCode >= 400) Then
Debug.Print "Response Header:"
Debug.Print http.LastHeader
Debug.Print "Failed."
Exit Sub
End If
Curl Command
curl -X GET
-H "Accept: application/json"
https://eds.vid.gov.lv/api/doc/:id/submit
Postman Collection Item JSON
{
"name": "Iesniegt dokumentu.",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/doc/:id/submit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
":id",
"submit"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta numurs."
}
]
}
},
"response": [
{
"name": "Uzsākts dokumenta iesniegšanas process.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/:id/submit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
":id",
"submit"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta numurs."
}
]
}
},
"status": "Accepted",
"code": 202,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{}"
},
{
"name": "Lietotājs nav autentificēts.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/doc/:id/submit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
":id",
"submit"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta numurs."
}
]
}
},
"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/:id/submit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
":id",
"submit"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta numurs."
}
]
}
},
"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/:id/submit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"doc",
":id",
"submit"
],
"variable": [
{
"key": "id",
"value": "25210683",
"description": "(Required) Dokumenta numurs."
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}