Endpoint: const url = "https://projects.sbw.media/Address";
Update: const url = `https://projects.sbw.media/Address/${addressId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
address: {
ID: 0, // type: int
StreetNr: "", // type: string
ZIP: "", // type: string
City: "", // type: string
CountryID: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Country";
Update: const url = `https://projects.sbw.media/Country/${countryId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
country: {
ISO: "", // type: string
German: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Customer";
Update: const url = `https://projects.sbw.media/Customer/${customerId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
customer: {
ID: 0, // type: int
Name: "", // type: string
Email: "", // type: string
AddressID: 0, // type: int
BillingAddressID: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/CustomerView";
Update: const url = `https://projects.sbw.media/CustomerView/${customerViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
customerView: {
ID: 0, // type: int
Name: "", // type: string
Email: "", // type: string
AddressID: 0, // type: int
StreetNr: "", // type: string
ZIP: "", // type: string
City: "", // type: string
Country: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Department";
Update: const url = `https://projects.sbw.media/Department/${departmentId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
department: {
ID: 0, // type: int
Name: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/DepartmentMember";
Update: const url = `https://projects.sbw.media/DepartmentMember/${departmentMemberId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
departmentMember: {
ID: 0, // type: int
DepartmentID: 0, // type: int
StudentID: 0, // type: int
FromDate: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/DepartmentMemberView";
Update: const url = `https://projects.sbw.media/DepartmentMemberView/${departmentMemberViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
departmentMemberView: {
ID: 0, // type: int
StudentID: 0, // type: int
fullname: "", // type: string
year: 0, // type: int
DepartmentID: 0, // type: int
Name: "", // type: string
FromDate: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/Equipment";
Update: const url = `https://projects.sbw.media/Equipment/${equipmentId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
equipment: {
ID: 0, // type: int
EquipmentTypeID: 0, // type: int
Name: "", // type: string
Number: "", // type: string
Description: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/EquipmentReservation";
Update: const url = `https://projects.sbw.media/EquipmentReservation/${equipmentReservationId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
equipmentReservation: {
ID: 0, // type: int
EquipmentID: 0, // type: int
StudentID: 0, // type: int
Start: "", // type: Date
End: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/EquipmentView";
Update: const url = `https://projects.sbw.media/EquipmentView/${equipmentViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
equipmentView: {
ID: 0, // type: int
Name: "", // type: string
Number: "", // type: string
Description: "", // type: string
Type: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Equipmenttype";
Update: const url = `https://projects.sbw.media/Equipmenttype/${equipmenttypeId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
equipmenttype: {
ID: 0, // type: int
Name: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Project";
Update: const url = `https://projects.sbw.media/Project/${projectId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
project: {
ID: 0, // type: int
ParentID: 0, // type: int
Number: "", // type: string
Name: "", // type: string
Description: "", // type: string
TypeID: 0, // type: int
CustomerID: 0, // type: int
Coach: "", // type: string
Status: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/Projectrole";
Update: const url = `https://projects.sbw.media/Projectrole/${projectroleId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
projectrole: {
ID: "", // type: string
Name: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Projecttype";
Update: const url = `https://projects.sbw.media/Projecttype/${projecttypeId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
projecttype: {
ID: 0, // type: int
Name: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Student";
Update: const url = `https://projects.sbw.media/Student/${studentId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
student: {
ID: 0, // type: int
Firstname: "", // type: string
Name: "", // type: string
Year: 0, // type: int
Fullname: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Studentroleproject";
Update: const url = `https://projects.sbw.media/Studentroleproject/${studentroleprojectId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
studentroleproject: {
ID: 0, // type: int
StudentID: 0, // type: int
ProjectID: 0, // type: int
Start: "", // type: Date
ProjectRoleID: "", // type: string
End: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/Task";
Update: const url = `https://projects.sbw.media/Task/${taskId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
task: {
ID: 0, // type: int
ProjectID: 0, // type: int
StudentID: 0, // type: int
Name: "", // type: string
Start: "", // type: Date
Due: "", // type: Date
Done: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/TaskView";
Update: const url = `https://projects.sbw.media/TaskView/${taskViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
taskView: {
ID: 0, // type: int
ProjectID: 0, // type: int
ProjectName: "", // type: string
StudentID: 0, // type: int
StudentName: "", // type: string
TaskName: "", // type: string
Start: "", // type: Date
Due: "", // type: Date
done: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/Teacher";
Update: const url = `https://projects.sbw.media/Teacher/${teacherId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
teacher: {
Abbr: "", // type: string
Name: "", // type: string
Firstname: "", // type: string
FullName: "", // type: string
}Endpoint: const url = "https://projects.sbw.media/Test";
Update: const url = `https://projects.sbw.media/Test/${testId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
test: {
test_ID: 0, // type: int
Name: "", // type: string
Size: "", // type: float
Date: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/Timesheet";
Update: const url = `https://projects.sbw.media/Timesheet/${timesheetId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
timesheet: {
ID: 0, // type: int
ProjectID: 0, // type: int
StudentID: 0, // type: int
Date: "", // type: Date
Minutes: 0, // type: int
Approved: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/TimesheetView";
Update: const url = `https://projects.sbw.media/TimesheetView/${timesheetViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
timesheetView: {
ID: 0, // type: int
StudentID: 0, // type: int
Fullname: "", // type: string
ProjectName: "", // type: string
Number: "", // type: string
Date: "", // type: Date
Minutes: 0, // type: int
Approved: 0, // type: int
}Endpoint: const url = "https://projects.sbw.media/Vacation";
Update: const url = `https://projects.sbw.media/Vacation/${vacationId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
vacation: {
ID: 0, // type: int
VacationTypeID: 0, // type: int
StudentID: 0, // type: int
FromDate: "", // type: Date
ToDate: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/VacationView";
Update: const url = `https://projects.sbw.media/VacationView/${vacationViewId}`;
Note: views are not updatable
key: is auto increment: nein
Fields:
vacationView: {
ID: 0, // type: int
VacationType: "", // type: string
StudentID: 0, // type: int
Fullname: "", // type: string
FromDate: "", // type: Date
ToDate: "", // type: Date
}Endpoint: const url = "https://projects.sbw.media/Vacationtype";
Update: const url = `https://projects.sbw.media/Vacationtype/${vacationtypeId}`;
Note: views are not updatable
key: is auto increment: ja
Fields:
vacationtype: {
ID: 0, // type: int
Name: "", // type: string
}
const result = {
partial: <boolean>, // true wenn nich vollständig
first: <id>, // Id der erste Resource
last: <id>, // id der letzten Resource
count: <number> // Anzahl Resources in resources
links: [], // array von Navigationslinks
resources: [], // array von Resourcen als Objekt
};
Die folgenden Methoden sind zulässig:
async function get() {
const url = 'https://projects.sbw.media/endpoint';
const response = await fetch(url);
if(!response.ok) {
throw new Error('HTTP error! status: ' + response.status');
}
const data = await response.json();
return data.resources;
}
async function post(payload) {
const url = 'https://projects.sbw.media/Endpoint';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
if(!response.ok) {
throw new Error('HTTP error! status: ' + response.status');
}
const data = await response.json();
return data;
}
async function put(id, payload) {
const url = 'https://projects.sbw.media/Endpoint' + id;
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
if(!response.ok) {
throw new Error('HTTP error! status: ' + response.status');
}
const data = await response.json();
return data;
}
async function delete(id) {
const url = 'https://projects.sbw.media/Endpoint' + id;
const response = await fetch(url,
{
method: 'DELETE'
});
if(!response.ok) {
throw new Error('HTTP error! status: ' + response.status');
}
const data = await response.json();
return data;
}
Der Dienst folgt REST-Standards mit den folgenden HTTP_Statuscodes: