C# / EDS API / Autorizācijas talona atcelšana.
Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
bool success;
http.SetRequestHeader("Accept","application/json");
Chilkat.HttpResponse resp = http.QuickRequest("DELETE","https://eds.vid.gov.lv/api/auth");
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
resp.GetBodySb(sbResponseBody);
Chilkat.JsonObject jResp = new Chilkat.JsonObject();
jResp.LoadSb(sbResponseBody);
jResp.EmitCompact = false;
Debug.WriteLine("Response Body:");
Debug.WriteLine(jResp.Emit());
int respStatusCode = resp.StatusCode;
Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
if (respStatusCode >= 400) {
Debug.WriteLine("Response Header:");
Debug.WriteLine(resp.Header);
Debug.WriteLine("Failed.");
return;
}
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://eds.vid.gov.lv/api/auth
Postman Collection Item JSON
{
"name": "Autorizācijas talona atcelšana.",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/auth",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth"
]
}
},
"response": [
{
"name": "Autorizācijas talons atcelts.",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/auth",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth"
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{}"
},
{
"name": "Lietotājs nav autentificēts.",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/auth",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth"
]
}
},
"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": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/auth",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth"
]
}
},
"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": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/auth",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth"
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}