| Uwierzytelnianie | wymagane |
| Format odpowiedzi | json |
| Metoda HTTP | POST |
https://your-system-name.thulium.com/api/todos
|
task
wymagany |
Zadanie.
Przykładowa wartość: Uaktualnienie systemu
|
|
description
opcjonalny |
Opis.
Przykładowa wartość: Najpierw należy pobrać najnowszą wersję panelu programu ze strony producenta.
|
|
user_login
wymagany |
Login.
Przykładowa wartość: janek123
|
|
author_login
opcjonalny |
Login autora.
Przykładowa wartość: admin
|
|
target_date
wymagany |
Dzień i godzina.
Przykładowa wartość: 2023-03-20 19:00:00
|
| POST | https://your-system-name.thulium.com/api/todos |
| Dane | {"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"} |
{
id: 123
}
<?php $data = '{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}'; $request = curl_init('https://your-system-name.thulium.com/api/todos'); curl_setopt($request, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json; charset=utf-8', 'Content-Length: ' . mb_strlen($data) )); curl_setopt($request, CURLOPT_USERPWD, 'api_user:api_pass'); curl_setopt($request, CURLOPT_TIMEOUT, 30); curl_setopt($request, CURLOPT_RETURNTRANSFER, true); curl_setopt($request, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($request, CURLOPT_POSTFIELDS, $data); $response = curl_exec($request); if ($response) { $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE); if ($httpCode == 200){ print_r(json_decode($response)); } else { echo $response; } } else { trigger_error(curl_error($request), E_USER_WARNING); } curl_close($request);
public class Example { public static void main(String[] args) throws Exception { ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true); ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/todos", "{\"task\":\"Uaktualnienie systemu.\",\"description\":\"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.\",\"user_login\":\"janek123\",\"author_login\":\"admin\",\"target_date\":\"2023-03-20 19:00:00\"}"); System.out.println(response); } }
curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}' "https://your-system-name.thulium.com/api/todos"
echo '{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/todos