Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
Appointment management
APIs to manage appointment resources
Show all appointments.
Example request:
curl --request GET \
--get "http://localhost:8000/api/appointment" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/appointment"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"data": [
{
"id": 1,
"doctor_id": 8,
"service_id": 5,
"date": "2024-12-06",
"start_time": "12:30",
"end_time": "13:30",
"is_reserved": null
},
{
"id": 2,
"doctor_id": 8,
"service_id": 5,
"date": "2024-12-06",
"start_time": "12:30",
"end_time": "13:30",
"is_reserved": null
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an appointment
Example request:
curl --request POST \
"http://localhost:8000/api/appointment/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"doctor_id\": null,
\"service_id\": null,
\"date\": \"2024-10-01\",
\"start_time\": \"09:00\",
\"end_time\": \"10:30\"
}"
const url = new URL(
"http://localhost:8000/api/appointment/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"doctor_id": null,
"service_id": null,
"date": "2024-10-01",
"start_time": "09:00",
"end_time": "10:30"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'doctor_id' => null,
'service_id' => null,
'date' => '2024-10-01',
'start_time' => '09:00',
'end_time' => '10:30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "success",
"message": "Appointment created successfully.",
"appointment": {
"doctor_id": 8,
"service_id": 5,
"date": "2024-12-02",
"start_time": "12:30",
"end_time": "13:00",
"tag": "reserved"
},
"intervals": {
"headers": {},
"original": {
"intervals": [
{
"start_time": "12:15",
"end_time": "12:30",
"tag": "not reserved"
},
{
"start_time": "12:30",
"end_time": "13:00",
"tag": "reserved"
},
{
"start_time": "13:00",
"end_time": "13:15",
"tag": "not reserved"
}
]
},
"exception": null
}
}
Example response (404, the end time of the appointment should be after the start time):
{
"status": "error",
"message": "Validation failed",
"errors": {
"end_time": [
"The end time must be after the start time."
]
}
}
Example response (404, the date parameter should be today or a future date):
{
"status": "error",
"message": "Validation failed",
"errors": {
"date": [
"The appointment date must be today or a future date."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all appointments by doctor
Example request:
curl --request GET \
--get "http://localhost:8000/api/appointment/getAppointmentsByDoctor?doctor_id=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/appointment/getAppointmentsByDoctor"
);
const params = {
"doctor_id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/getAppointmentsByDoctor';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'doctor_id' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": [
{
"id": 1,
"doctor_id": 8,
"service_id": 5,
"date": "2024-12-02",
"start_time": "12:30",
"end_time": "13:00",
"tag": "reserved",
"created_at": "2024-10-11T22:02:41.000000Z",
"updated_at": "2024-10-11T22:02:41.000000Z"
}
]
}
Example response (200, request was successful but no appointments):
{
"status": "Request was successful",
"message": "success",
"data": []
}
Example response (404, there is no doctor associated with the specifiedid):
{
"status": "error",
"message": "There is no doctor with this id",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all appointments by doctor and date
Example request:
curl --request GET \
--get "http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate?doctor_id=0&date=%222024-10-15%22" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate"
);
const params = {
"doctor_id": "0",
"date": ""2024-10-15"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/getAppointmentsByDoctorAndDate';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'doctor_id' => '0',
'date' => '"2024-10-15"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "success",
"message": "Appointments retrieved successfully.",
"appointments": [
{
"doctor_name": "mahmoud mohamed",
"service_name": "teeth removal",
"date": "2024-12-2",
"start_time": "12:30",
"end_time": "13:00"
}
],
"intervals": {
"headers": {},
"original": {
"intervals": [
{
"start_time": "12:15",
"end_time": "12:30",
"tag": "not reserved"
},
{
"start_time": "12:30",
"end_time": "13:00",
"tag": "reserved"
},
{
"start_time": "13:00",
"end_time": "13:15",
"tag": "not reserved"
}
]
},
"exception": null
}
}
Example response (404, there is no doctor associated with the specifiedid):
{
"status": "error",
"message": "There is no doctor with this id",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
update appointment
Example request:
curl --request PUT \
"http://localhost:8000/api/appointment/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"doctor_id\": null,
\"service_id\": null,
\"date\": \"2024-10-01\",
\"start_time\": \"09:00\",
\"end_time\": \"10:30\"
}"
const url = new URL(
"http://localhost:8000/api/appointment/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"doctor_id": null,
"service_id": null,
"date": "2024-10-01",
"start_time": "09:00",
"end_time": "10:30"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/1';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'doctor_id' => null,
'service_id' => null,
'date' => '2024-10-01',
'start_time' => '09:00',
'end_time' => '10:30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request has been successful):
{
"status": "Request was successful",
"message": "appointment has been updated successfully",
"data": {
"id": 1,
"doctor_id": 8,
"service_id": 5,
"date": "2024-12-06",
"start_time": "12:30",
"end_time": "13:30",
"tag": "reserved",
"created_at": "2024-10-11T22:02:41.000000Z",
"updated_at": "2024-10-12T00:33:44.000000Z"
}
}
Example response (404, there is no appointment with the specified id):
{
"status": "error",
"message": "there is no appointment with the specified id",
"data": ""
}
Example response (404, the date parameter should be a future date):
{
"status": "error",
"message": "Validation failed",
"errors": {
"date": [
"The appointment date must be today or a future date."
]
}
}
Example response (404, the end time of the appointment should be after the start time):
{
"status": "error",
"message": "Validation failed",
"errors": {
"end_time": [
"The end time must be after the start time."
]
}
}
Example response (404, there is no doctor with the specified id):
{
"status": "error",
"message": "Validation failed",
"errors": {
"doctor_id": [
"The specified doctor does not exist in our records."
]
}
}
Example response (404, there is no service with the specified id):
{
"status": "error",
"message": "Validation failed",
"errors": {
"service_id": [
"The specified service does not exist in our records."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE api/appointment/{id}
Example request:
curl --request DELETE \
"http://localhost:8000/api/appointment/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/appointment/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/appointment/1';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Auth management
APIs to manage Auth resources
login
Example request:
curl --request POST \
"http://localhost:8000/api/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"voluptatem\",
\"password\": \"-lQ]pn]2D5WfZ\"
}"
const url = new URL(
"http://localhost:8000/api/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "voluptatem",
"password": "-lQ]pn]2D5WfZ"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/login';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'voluptatem',
'password' => '-lQ]pn]2D5WfZ',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, user logged in successfully):
{
"status": "Request was successful",
"message": "user logged in successfully",
"data": {
"user": {
"id": 1,
"name": "ahmed ismail",
"created_at": "2024-10-12T22:04:34.000000Z",
"updated_at": "2024-10-12T22:04:34.000000Z"
},
"token": "5|xK7B7IWh0cEdrEwTJCQJwGWUnsEvMTc6QxkAFFVz59a8a498"
}
}
Example response (404, the specified user doesn't exist):
{
"status": "error",
"message": "Validation failed",
"data": {
"name": [
"This user doesn't exist."
]
}
}
Example response (404, wrong password):
{
"status": "error",
"message": "the password isn't correct",
"data": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
create a user
Example request:
curl --request POST \
"http://localhost:8000/api/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"unqfddctubculjijoy\",
\"password\": \"y!^W1tH]fsl8Qz^Rm\"
}"
const url = new URL(
"http://localhost:8000/api/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "unqfddctubculjijoy",
"password": "y!^W1tH]fsl8Qz^Rm"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/register';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'unqfddctubculjijoy',
'password' => 'y!^W1tH]fsl8Qz^Rm',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, user has been created successfully):
{
"status": "Request was successful",
"message": "user has been created successfully",
"data": {
"user": {
"name": "ahmed",
"updated_at": "2024-10-12T22:07:57.000000Z",
"created_at": "2024-10-12T22:07:57.000000Z",
"id": 3
},
"token": "3|vUhBeVm8bRTlKl8UsgInOL7p6RGvHiqeuxZYpngJ5e93c06e"
}
}
Example response (404, username has already been taken):
{
"status": "error",
"message": "Validation failed",
"data": {
"name": [
"This username has already been taken."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
reset password
Example request:
curl --request POST \
"http://localhost:8000/api/reset" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"velit\",
\"old_password\": \"wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz\",
\"new_password\": \"sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx\"
}"
const url = new URL(
"http://localhost:8000/api/reset"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "velit",
"old_password": "wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz",
"new_password": "sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/reset';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'velit',
'old_password' => 'wvqmuyagojkvwsxuouuuxtspttfpwfqjnhszwvzehqgyozgmlvaltzngkcsz',
'new_password' => 'sktynsjoxgzuvckbsieidrbdzruzaztdmzgchkx',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, password reset successfully):
{
"status": "Request was successful",
"message": "Password has been successfully updated.",
"data": null
}
}
Example response (404, incorrect old password):
{
"status": "error",
"message": "The old password isn't correct.",
"data": null
}
Example response (404, new password confirmation does not match):
{
"status": "error",
"message": "Validation failed",
"data": {
"new_password": [
"The new password confirmation does not match."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/logout
Example request:
curl --request POST \
"http://localhost:8000/api/logout" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/logout"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/logout';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, logged out successfully):
{
"status": "Request was successful",
"message": "logged out successfully",
"data": null
}
Example response (404, unauthenticated):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cashier management
APIs to manage Cashier resources
show all cashiers
Example request:
curl --request GET \
--get "http://localhost:8000/api/cashier" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cashier"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
"success"
{
"status": "Request was successful",
"message": "cashier returned successfully",
"data": {
"data": [
{
"id": 3,
"group": "surgery",
"code": "548",
"service_id": 5,
"doctor_id": 8,
"QTY": 50,
"price": 260,
"total": 13000,
"discount": 85,
"value": 11050,
"net_price": 1950
},
{
"id": 4,
"group": "surgery",
"code": "54217",
"service_id": 5,
"doctor_id": 8,
"QTY": 2,
"price": 260,
"total": 520,
"discount": 10,
"value": 52,
"net_price": 468
}
],
"meta": {
"total_cashiers": 2
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store cashier
Example request:
curl --request POST \
"http://localhost:8000/api/cashier/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"group\": \"General\",
\"code\": \"1234\",
\"service_id\": \"suscipit\",
\"doctor_id\": \"ut\",
\"QTY\": 3,
\"discount\": 10,
\"service\": null,
\"doctor\": null
}"
const url = new URL(
"http://localhost:8000/api/cashier/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"group": "General",
"code": "1234",
"service_id": "suscipit",
"doctor_id": "ut",
"QTY": 3,
"discount": 10,
"service": null,
"doctor": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'group' => 'General',
'code' => '1234',
'service_id' => 'suscipit',
'doctor_id' => 'ut',
'QTY' => 3,
'discount' => 10,
'service' => null,
'doctor' => null,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, The request was successful):
{
"status": "Request was successful",
"message": "Cashier created successfully",
"data": {
"id": 82,
"group": "surgery",
"code": "5473",
"service": "teeth removal",
"doctor": "mahmoud ali",
"QTY": "2",
"price": 100,
"total": 200,
"discount": "10",
"value": 20,
"net_price": 180
}
}
Example response (404, The code has already been taken):
{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"The code has already been taken."
]
}
}
Example response (422, missing parameters):
{
"status": "error",
"message": "Validation failed",
"data": {
"group": [
"The service group is required."
],
"code": [
"The code is required."
],
"service": [
"The service name is required."
],
"doctor": [
"The doctor's name is required."
],
"QTY": [
"The QTY is required."
],
"discount": [
"The discount is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/cashier/{id}
Example request:
curl --request GET \
--get "http://localhost:8000/api/cashier/80" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cashier/80"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/80';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, The request was successful):
{
"status": "Request was successful",
"message": "cashier deleted successfully",
"data": {
"id": 3,
"group": "surgery",
"code": "548",
"service_id": 5,
"doctor_id": 8,
"QTY": 50,
"price": 260,
"total": 13000,
"discount": 85,
"value": 11050,
"net_price": 1950
}
}
Example response (404, There is no cashier with the specified ID):
{
"status": "error",
"message": "There is no cashier with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
update cashier
Example request:
curl --request PUT \
"http://localhost:8000/api/cashier/3" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"group\": \"General\",
\"code\": \"1234\",
\"service_id\": \"ullam\",
\"doctor_id\": \"quis\",
\"QTY\": 3,
\"discount\": 10,
\"service\": null,
\"doctor\": null
}"
const url = new URL(
"http://localhost:8000/api/cashier/3"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"group": "General",
"code": "1234",
"service_id": "ullam",
"doctor_id": "quis",
"QTY": 3,
"discount": 10,
"service": null,
"doctor": null
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/3';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'group' => 'General',
'code' => '1234',
'service_id' => 'ullam',
'doctor_id' => 'quis',
'QTY' => 3,
'discount' => 10,
'service' => null,
'doctor' => null,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, the cashier has been created successfully):
{
"status": "Request was successful",
"message": "Cashier has been created successfully",
"data": {
"id": 3,
"group": "surgery",
"code": "548",
"service_id": "5",
"doctor_id": "8",
"QTY": "50",
"price": 260,
"total": 13000,
"discount": "85",
"value": 11050,
"net_price": 1950
}
}
Example response (404, The code has already been taken):
{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"The code has already been taken."
]
}
}
Example response (404, This id doesn't exit in our database):
{
"status": "error",
"message": "There is no cashier with this ID",
"data": ""
}
Example response (404, The selected service or doctor aren't in database):
{
{
"status": "error",
"message": "Validation failed",
"data": {
"service": [
"there is no service with the provided name"
],
"doctor": [
"there is no doctor with the provided name"
]
}
}
Example response (422, missing parameters):
{
"status": "error",
"message": "Validation failed",
"data": {
"group": [
"The service group is required."
],
"code": [
"The code is required."
],
"service": [
"The service name is required."
],
"doctor": [
"The doctor's name is required."
],
"QTY": [
"The QTY is required."
],
"discount": [
"The discount is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified resource from storage.
Example request:
curl --request DELETE \
"http://localhost:8000/api/cashier/723" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/cashier/723"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/cashier/723';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404, This id doesn't exit in our database):
{
"status": "error",
"message": "There is no cashier with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Doctor management
APIs to manage Doctor resources
Display Doctors
Example request:
curl --request GET \
--get "http://localhost:8000/api/doctor" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/doctor"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": [
{
"id": 8,
"name": "mahmoud mohamed",
"code": "215615651235",
"type": "advisor",
"specialization": "surgeon",
"work_days": "[\"sunday\",\"monday\",\"friday\"]",
"start_time": "12:15:00",
"end_time": "13:15:00",
"created_at": "2024-10-11T08:07:43.000000Z",
"updated_at": "2024-10-11T08:07:43.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
create doctor
Example request:
curl --request POST \
"http://localhost:8000/api/doctor/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Dr. John Doe\",
\"code\": \"DOC123\",
\"type\": \"General\",
\"specialization\": \"Cardiologist\",
\"work_days\": [
\"Monday\",
\"Wednesday\",
\"Friday\"
],
\"start_time\": \"09:00\",
\"end_time\": \"17:00\"
}"
const url = new URL(
"http://localhost:8000/api/doctor/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Dr. John Doe",
"code": "DOC123",
"type": "General",
"specialization": "Cardiologist",
"work_days": [
"Monday",
"Wednesday",
"Friday"
],
"start_time": "09:00",
"end_time": "17:00"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Dr. John Doe',
'code' => 'DOC123',
'type' => 'General',
'specialization' => 'Cardiologist',
'work_days' => [
'Monday',
'Wednesday',
'Friday',
],
'start_time' => '09:00',
'end_time' => '17:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": {
"name": "mahmoud mohamed",
"code": "215615651235",
"type": "advisor",
"specialization": "surgeon",
"start_time": "12:15",
"end_time": "13:15",
"work_days": "[\"sunday\",\"monday\",\"friday\"]",
"updated_at": "2024-10-11T08:07:43.000000Z",
"created_at": "2024-10-11T08:07:43.000000Z",
"id": 8
}
}
Example response (404, name or code already exists):
{
"status": "error",
"message": "Validation failed",
"data": {
"name": [
"This doctor name already exists."
],
"code": [
"This doctor code already exists."
]
}
}
Example response (422, missing parameters):
{
"status": "error",
"message": "Validation failed",
"data": {
"name": [
"The name field is required."
],
"code": [
"The code field is required."
],
"type": [
"The type field is required."
],
"specialization": [
"The specialization field is required."
],
"work_days": [
"The work_days field is required."
],
"start_time": [
"The start time field is required."
],
"end_time": [
"The end time field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display doctor by id
Example request:
curl --request GET \
--get "http://localhost:8000/api/doctor/6" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/doctor/6"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/6';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": {
"id": 1,
"name": "mahmoud ali",
"code": "215615651231",
"type": "advisor",
"specialization": "surgeon",
"work_days": "[\"sunday\",\"monday\",\"friday\"]",
"start_time": "12:15:00",
"end_time": "13:15:00",
"created_at": "2024-09-30T05:22:36.000000Z",
"updated_at": "2024-09-30T05:22:36.000000Z"
}
}
Example response (404, There is no doctor with this ID):
"{
"status": "error",
"message": "There is no doctor with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/doctor/{id}
Example request:
curl --request PUT \
"http://localhost:8000/api/doctor/6" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Dr. John Doe\",
\"code\": \"DOC123\",
\"type\": \"General\",
\"specialization\": \"Cardiologist\",
\"work_days\": [
\"Monday\",
\"Wednesday\",
\"Friday\"
],
\"start_time\": \"09:00\",
\"end_time\": \"17:00\"
}"
const url = new URL(
"http://localhost:8000/api/doctor/6"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Dr. John Doe",
"code": "DOC123",
"type": "General",
"specialization": "Cardiologist",
"work_days": [
"Monday",
"Wednesday",
"Friday"
],
"start_time": "09:00",
"end_time": "17:00"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/6';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Dr. John Doe',
'code' => 'DOC123',
'type' => 'General',
'specialization' => 'Cardiologist',
'work_days' => [
'Monday',
'Wednesday',
'Friday',
],
'start_time' => '09:00',
'end_time' => '17:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"data": [
{
"id": 70,
"name": "Mrs. Chelsea Lind",
"code": "DOC735",
"type": "General",
"specialization": "sed",
"work_days": [
"Wednesday",
"Friday",
"Monday",
"Sunday",
"Saturday"
],
"start_time": "10:42:00",
"end_time": "11:42:00"
},
{
"id": 71,
"name": "Caden Shanahan",
"code": "DOC979",
"type": "Specialist",
"specialization": "veniam",
"work_days": [
"Thursday",
"Tuesday",
"Saturday",
"Sunday",
"Monday",
"Friday",
"Wednesday"
],
"start_time": "05:20:00",
"end_time": "07:17:00"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove doctor from
Example request:
curl --request DELETE \
"http://localhost:8000/api/doctor/8" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/doctor/8"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/doctor/8';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, the doctor has been deleted successfully):
{
"status": "Request was successful",
"message": "the doctor has been deleted successfully",
"data": ""
}
Example response (404, there is no doctor with the specified id):
{
"status": "error",
"message": "There is no Doctor with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
GET api/user
Example request:
curl --request GET \
--get "http://localhost:8000/api/user" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/user"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/user';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/myFatoorah/error
Example request:
curl --request GET \
--get "http://localhost:8000/api/myFatoorah/error" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/myFatoorah/error"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/error';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
content-type: text/html; charset=UTF-8
cache-control: no-cache, private
x-ratelimit-limit: 60
x-ratelimit-remaining: 53
access-control-allow-origin: *
errror
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Hesabe payment gateway management
APIs to manage Hesabe payment gateway resources
POST api/hesabe/create
Example request:
curl --request POST \
"http://localhost:8000/api/hesabe/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount\": 1
}"
const url = new URL(
"http://localhost:8000/api/hesabe/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'amount' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/hesabe/webhook
Example request:
curl --request POST \
"http://localhost:8000/api/hesabe/webhook" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/hesabe/webhook"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/webhook';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/hesabe/response
Example request:
curl --request GET \
--get "http://localhost:8000/api/hesabe/response" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/hesabe/response"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/response';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (400):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 56
access-control-allow-origin: *
{
"message": "Invalid payment response"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/hesabe/failure
Example request:
curl --request GET \
--get "http://localhost:8000/api/hesabe/failure" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/hesabe/failure"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/hesabe/failure';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (400):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 55
access-control-allow-origin: *
{
"message": "Payment failed",
"data": false
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
MyFotoorah payment gateway management
APIs to manage MyFatoorah resources
POST api/myFatoorah/pay
Example request:
curl --request POST \
"http://localhost:8000/api/myFatoorah/pay" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/myFatoorah/pay"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/pay';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/myFatoorah/callback
Example request:
curl --request GET \
--get "http://localhost:8000/api/myFatoorah/callback" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/myFatoorah/callback"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/myFatoorah/callback';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
{
"message": "Server Error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Patient attachment management
APIs to manage Patient attachment resources
Display all patients attachments
Example request:
curl --request GET \
--get "http://localhost:8000/api/patientAttachment" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patientAttachment"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "Patient attachments retrieved successfully",
"data": [
{
"id": 1,
"patient_id": 4,
"civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
"patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
"report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
"report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
"other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
},
{
"id": 2,
"patient_id": 5,
"civil_id_doc": "ali_saeed/ali_saeed_civil_id_doc.jpeg",
"patient_status_doc": "ali_saeed/ali_saeed_patient_status_doc.jpg",
"report_1_doc": "ali_saeed/ali_saeed_report_1_doc.jpeg",
"report_2_doc": "ali_saeed/ali_saeed_report_2_doc.jpg",
"other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create new patient attachment
Example request:
curl --request POST \
"http://localhost:8000/api/patientAttachment/create" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "patient_id=id"\
--form "civil_id_doc=@/tmp/phpBee9BT" \
--form "patient_status_doc=@/tmp/phpqBwrPx" \
--form "report_1_doc=@/tmp/php3942nL" \
--form "report_2_doc=@/tmp/phpUH15iK" \
--form "other_document_doc=@/tmp/phpL6AWRl" const url = new URL(
"http://localhost:8000/api/patientAttachment/create"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('patient_id', 'id');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'patient_id',
'contents' => 'id'
],
[
'name' => 'civil_id_doc',
'contents' => fopen('/tmp/phpBee9BT', 'r')
],
[
'name' => 'patient_status_doc',
'contents' => fopen('/tmp/phpqBwrPx', 'r')
],
[
'name' => 'report_1_doc',
'contents' => fopen('/tmp/php3942nL', 'r')
],
[
'name' => 'report_2_doc',
'contents' => fopen('/tmp/phpUH15iK', 'r')
],
[
'name' => 'other_document_doc',
'contents' => fopen('/tmp/phpL6AWRl', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient attachment has been created successflly):
{
"status": "success",
"data": {
"patient_id": "4",
"civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
"patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
"report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
"report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
"other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg",
"updated_at": "2024-10-12T15:17:23.000000Z",
"created_at": "2024-10-12T15:17:23.000000Z",
"id": 1
}
}
Example response (404, there is no patient for this id to add attachment to):
{
"status": "error",
"message": "Validation failed",
"data": {
"patient_id": [
"The selected patient id is invalid."
]
}
}
Example response (404, the patient already has attachments assigned to):
{
"status": "error",
"message": "this patient already has attachment assigned to it",
"data": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display Patient attachments by id
Example request:
curl --request GET \
--get "http://localhost:8000/api/patientAttachment/283" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patientAttachment/283"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/283';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, success):
{
"status": "Request was successful",
"message": "patient attachments returned successfully",
"data": {
"id": 2,
"patient_id": 4,
"civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
"patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
"report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
"report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
"other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
}
}
Example response (404, no patient attachments found with this id):
{
"status": "error",
"message": "There is no patient attachment with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update patient attachments
Example request:
curl --request PUT \
"http://localhost:8000/api/patientAttachment/64" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "patient_id=veritatis"\
--form "civil_id_doc=@/tmp/phpcbVd1v" \
--form "patient_status_doc=@/tmp/phpPWkhpv" \
--form "report_1_doc=@/tmp/phpU8GiBb" \
--form "report_2_doc=@/tmp/phpjHr1sr" \
--form "other_document_doc=@/tmp/phpxrwtHI" const url = new URL(
"http://localhost:8000/api/patientAttachment/64"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('patient_id', 'veritatis');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/64';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'patient_id',
'contents' => 'veritatis'
],
[
'name' => 'civil_id_doc',
'contents' => fopen('/tmp/phpcbVd1v', 'r')
],
[
'name' => 'patient_status_doc',
'contents' => fopen('/tmp/phpPWkhpv', 'r')
],
[
'name' => 'report_1_doc',
'contents' => fopen('/tmp/phpU8GiBb', 'r')
],
[
'name' => 'report_2_doc',
'contents' => fopen('/tmp/phpjHr1sr', 'r')
],
[
'name' => 'other_document_doc',
'contents' => fopen('/tmp/phpxrwtHI', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient attachment has been updated successfully):
{
"status": "Request was successful",
"message": "patient attachment has been updated successfully",
"data": {
"id": 1,
"patient_id": "4",
"civil_id_doc": "ali_mohamed/ali_mohamed_civil_id_doc.jpeg",
"patient_status_doc": "ali_mohamed/ali_mohamed_patient_status_doc.jpg",
"report_1_doc": "ali_mohamed/ali_mohamed_report_1_doc.jpeg",
"report_2_doc": "ali_mohamed/ali_mohamed_report_2_doc.jpg",
"other_document_doc": "ali_mohamed/ali_mohamed_other_document_doc.jpeg"
}
}
Example response (404, no patient attachments found with this id):
{
"status": "error",
"message": "There is no patient attachment with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete patient attachment
Example request:
curl --request DELETE \
"http://localhost:8000/api/patientAttachment/3721" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patientAttachment/3721"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patientAttachment/3721';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient attachments deleted successfully):
{
"status": "Request was successful",
"message": "the patient attachments has been deleted successfully",
"data": null
}
Example response (404, is no patient attachment with the specified ID):
{
"status": "error",
"message": "There is no patient attachment with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Patient management
APIs to manage Patient resources
Display all patients
Example request:
curl --request GET \
--get "http://localhost:8000/api/patient" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patient"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, success):
{
"status": "Request was successful",
"message": "success",
"data": [
{
"id": 2,
"name_english": "ali mohamed",
"name_arabic": "أحمد علي",
"email": "ahmed@gmail.com",
"civil_id": "30201078908135",
"phone_number": "01145684288",
"nationality": "egyption",
"city": "menofia",
"gender": "male",
"birth_date": "2002-08-08",
"address": "64 altowheed stread",
"insurance_company": "bank masr for life ensurance",
"policy_holder": "mohomed hatem",
"policy_number": "2262509",
"policy_start_date": "2006-08-08",
"policy_end_date": "2025-08-09",
"notice": "i noticed",
"how_did_you_know_about_us": "internet",
"patient_status": null,
"report_1": null,
"report_2": null,
"other_document": null,
"transactions": []
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create patient
Example request:
curl --request POST \
"http://localhost:8000/api/patient/create" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name_english=<faker>name</faker>"\
--form "name_arabic=<faker>name</faker>"\
--form "civil_id=<faker>numerify('##############')</faker>"\
--form "phone_number=<faker>e164PhoneNumber</faker>"\
--form "nationality=<faker>country</faker>"\
--form "city=<faker>city</faker>"\
--form "gender=<faker>randomElement(['male', 'female'])</faker>"\
--form "birth_date=<faker>date('Y-m-d')</faker>"\
--form "address=<faker>address</faker>"\
--form "notice=mhbkttuzubhiartwjbehaj"\
--form "insurance_company=<faker>company</faker>"\
--form "policy_holder=<faker>name</faker>"\
--form "policy_number=<faker>uuid</faker>"\
--form "policy_start_date=<faker>date('Y-m-d')</faker>"\
--form "policy_end_date=<faker>date('Y-m-d')</faker>"\
--form "how_did_you_know_about_us=pldnqjnhdoqikncsegzjh"\
--form "email=flesch@example.com"\
--form "civil_id_doc=@/tmp/phpsHIWMF" \
--form "patient_status_doc=@/tmp/phpwZqTDo" \
--form "report_1_doc=@/tmp/phpXcufjM" \
--form "report_2_doc=@/tmp/phpxANsdA" \
--form "other_document_doc=@/tmp/php36eQQO" const url = new URL(
"http://localhost:8000/api/patient/create"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name_english', '<faker>name</faker>');
body.append('name_arabic', '<faker>name</faker>');
body.append('civil_id', '<faker>numerify('##############')</faker>');
body.append('phone_number', '<faker>e164PhoneNumber</faker>');
body.append('nationality', '<faker>country</faker>');
body.append('city', '<faker>city</faker>');
body.append('gender', '<faker>randomElement(['male', 'female'])</faker>');
body.append('birth_date', '<faker>date('Y-m-d')</faker>');
body.append('address', '<faker>address</faker>');
body.append('notice', 'mhbkttuzubhiartwjbehaj');
body.append('insurance_company', '<faker>company</faker>');
body.append('policy_holder', '<faker>name</faker>');
body.append('policy_number', '<faker>uuid</faker>');
body.append('policy_start_date', '<faker>date('Y-m-d')</faker>');
body.append('policy_end_date', '<faker>date('Y-m-d')</faker>');
body.append('how_did_you_know_about_us', 'pldnqjnhdoqikncsegzjh');
body.append('email', 'flesch@example.com');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name_english',
'contents' => '<faker>name</faker>'
],
[
'name' => 'name_arabic',
'contents' => '<faker>name</faker>'
],
[
'name' => 'civil_id',
'contents' => '<faker>numerify('##############')</faker>'
],
[
'name' => 'phone_number',
'contents' => '<faker>e164PhoneNumber</faker>'
],
[
'name' => 'nationality',
'contents' => '<faker>country</faker>'
],
[
'name' => 'city',
'contents' => '<faker>city</faker>'
],
[
'name' => 'gender',
'contents' => '<faker>randomElement(['male', 'female'])</faker>'
],
[
'name' => 'birth_date',
'contents' => '<faker>date('Y-m-d')</faker>'
],
[
'name' => 'address',
'contents' => '<faker>address</faker>'
],
[
'name' => 'notice',
'contents' => 'mhbkttuzubhiartwjbehaj'
],
[
'name' => 'insurance_company',
'contents' => '<faker>company</faker>'
],
[
'name' => 'policy_holder',
'contents' => '<faker>name</faker>'
],
[
'name' => 'policy_number',
'contents' => '<faker>uuid</faker>'
],
[
'name' => 'policy_start_date',
'contents' => '<faker>date('Y-m-d')</faker>'
],
[
'name' => 'policy_end_date',
'contents' => '<faker>date('Y-m-d')</faker>'
],
[
'name' => 'how_did_you_know_about_us',
'contents' => 'pldnqjnhdoqikncsegzjh'
],
[
'name' => 'email',
'contents' => 'flesch@example.com'
],
[
'name' => 'civil_id_doc',
'contents' => fopen('/tmp/phpsHIWMF', 'r')
],
[
'name' => 'patient_status_doc',
'contents' => fopen('/tmp/phpwZqTDo', 'r')
],
[
'name' => 'report_1_doc',
'contents' => fopen('/tmp/phpXcufjM', 'r')
],
[
'name' => 'report_2_doc',
'contents' => fopen('/tmp/phpxANsdA', 'r')
],
[
'name' => 'other_document_doc',
'contents' => fopen('/tmp/php36eQQO', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient has been created successfully):
{
"status": "Request was successful",
"message": "patient has been created successfully",
"data": {
"id": 2,
"name_english": "ali mohamed",
"name_arabic": "أحمد علي",
"email": "ahmed@gmail.com",
"civil_id": "30201078908135",
"phone_number": "01145684288",
"nationality": "egyption",
"city": "menofia",
"gender": "male",
"birth_date": "2002-8-8",
"address": "64 altowheed stread",
"insurance_company": "bank masr for life ensurance",
"policy_holder": "mohomed hatem",
"policy_number": "2262509",
"policy_start_date": "2006-8-8",
"policy_end_date": "2025-8-9",
"notice": "i noticed",
"how_did_you_know_about_us": "internet",
"patient_status": null,
"report_1": null,
"report_2": null,
"other_document": null,
"transactions": []
}
}
Example response (404, civil id or email already exist):
{
"status": "error",
"message": "Validation failed",
"data": {
"civil_id": [
"This civil id already exists."
],
"email": [
"The email has already been taken."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display patient by id
Example request:
curl --request GET \
--get "http://localhost:8000/api/patient/324" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patient/324"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/324';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": {
"id": 2,
"name_english": "ali mohamed",
"name_arabic": "أحمد علي",
"email": "ahmed@gmail.com",
"civil_id": "30201078908135",
"phone_number": "01145684288",
"nationality": "egyption",
"city": "menofia",
"gender": "male",
"birth_date": "2002-08-08",
"address": "64 altowheed stread",
"insurance_company": "bank masr for life ensurance",
"policy_holder": "mohomed hatem",
"policy_number": "2262509",
"policy_start_date": "2006-08-08",
"policy_end_date": "2025-08-09",
"notice": "i noticed",
"how_did_you_know_about_us": "internet",
"patient_status": null,
"report_1": null,
"report_2": null,
"other_document": null,
"transactions": []
}
}
Example response (404, no patient with the specified ID):
{
"status": "error",
"message": "There is no patient with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update patient.
Example request:
curl --request PUT \
"http://localhost:8000/api/patient/45" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name_english=wirsqbmxyegpbkcphjbeozbra"\
--form "name_arabic=brzqghpenbtwpefzrqep"\
--form "civil_id=eum"\
--form "phone_number=erktdtzobwvigqqujtzzibzcx"\
--form "nationality=wcayxhibpbewwgzpqrj"\
--form "city=gxoxjryvflzsrealthfanzq"\
--form "gender=flaupb"\
--form "birth_date=mbnewvzqlwmvtsvsbhj"\
--form "address=oxiopedfuvtudmxm"\
--form "notice=emvgqvqkh"\
--form "insurance_company=fj"\
--form "policy_holder=poglbmbgyawnvfoqxzgkjicai"\
--form "policy_number=n"\
--form "policy_start_date=ozjgyebpc"\
--form "policy_end_date=mgyuigvulmhhmbdhhnixcl"\
--form "how_did_you_know_about_us=bhppjx"\
--form "email=bruen.raul@example.com"\
--form "civil_id_doc=@/tmp/phpasOEWb" \
--form "patient_status_doc=@/tmp/phppM0oLk" \
--form "report_1_doc=@/tmp/phpYrcEQ0" \
--form "report_2_doc=@/tmp/phpchaf3Z" \
--form "other_document_doc=@/tmp/php7h6zu3" const url = new URL(
"http://localhost:8000/api/patient/45"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name_english', 'wirsqbmxyegpbkcphjbeozbra');
body.append('name_arabic', 'brzqghpenbtwpefzrqep');
body.append('civil_id', 'eum');
body.append('phone_number', 'erktdtzobwvigqqujtzzibzcx');
body.append('nationality', 'wcayxhibpbewwgzpqrj');
body.append('city', 'gxoxjryvflzsrealthfanzq');
body.append('gender', 'flaupb');
body.append('birth_date', 'mbnewvzqlwmvtsvsbhj');
body.append('address', 'oxiopedfuvtudmxm');
body.append('notice', 'emvgqvqkh');
body.append('insurance_company', 'fj');
body.append('policy_holder', 'poglbmbgyawnvfoqxzgkjicai');
body.append('policy_number', 'n');
body.append('policy_start_date', 'ozjgyebpc');
body.append('policy_end_date', 'mgyuigvulmhhmbdhhnixcl');
body.append('how_did_you_know_about_us', 'bhppjx');
body.append('email', 'bruen.raul@example.com');
body.append('civil_id_doc', document.querySelector('input[name="civil_id_doc"]').files[0]);
body.append('patient_status_doc', document.querySelector('input[name="patient_status_doc"]').files[0]);
body.append('report_1_doc', document.querySelector('input[name="report_1_doc"]').files[0]);
body.append('report_2_doc', document.querySelector('input[name="report_2_doc"]').files[0]);
body.append('other_document_doc', document.querySelector('input[name="other_document_doc"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/45';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name_english',
'contents' => 'wirsqbmxyegpbkcphjbeozbra'
],
[
'name' => 'name_arabic',
'contents' => 'brzqghpenbtwpefzrqep'
],
[
'name' => 'civil_id',
'contents' => 'eum'
],
[
'name' => 'phone_number',
'contents' => 'erktdtzobwvigqqujtzzibzcx'
],
[
'name' => 'nationality',
'contents' => 'wcayxhibpbewwgzpqrj'
],
[
'name' => 'city',
'contents' => 'gxoxjryvflzsrealthfanzq'
],
[
'name' => 'gender',
'contents' => 'flaupb'
],
[
'name' => 'birth_date',
'contents' => 'mbnewvzqlwmvtsvsbhj'
],
[
'name' => 'address',
'contents' => 'oxiopedfuvtudmxm'
],
[
'name' => 'notice',
'contents' => 'emvgqvqkh'
],
[
'name' => 'insurance_company',
'contents' => 'fj'
],
[
'name' => 'policy_holder',
'contents' => 'poglbmbgyawnvfoqxzgkjicai'
],
[
'name' => 'policy_number',
'contents' => 'n'
],
[
'name' => 'policy_start_date',
'contents' => 'ozjgyebpc'
],
[
'name' => 'policy_end_date',
'contents' => 'mgyuigvulmhhmbdhhnixcl'
],
[
'name' => 'how_did_you_know_about_us',
'contents' => 'bhppjx'
],
[
'name' => 'email',
'contents' => 'bruen.raul@example.com'
],
[
'name' => 'civil_id_doc',
'contents' => fopen('/tmp/phpasOEWb', 'r')
],
[
'name' => 'patient_status_doc',
'contents' => fopen('/tmp/phppM0oLk', 'r')
],
[
'name' => 'report_1_doc',
'contents' => fopen('/tmp/phpYrcEQ0', 'r')
],
[
'name' => 'report_2_doc',
'contents' => fopen('/tmp/phpchaf3Z', 'r')
],
[
'name' => 'other_document_doc',
'contents' => fopen('/tmp/php7h6zu3', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient has been updated successfully):
{
"status": "Request was successful",
"message": "the patient was updated successfully",
"data": {
"id": 3,
"name_english": "abdelfatah mahmoud housein",
"name_arabic": "أحمد علي",
"email": "ahmed@gmail.com",
"civil_id": "30204532890541",
"phone_number": "01145684288",
"nationality": "egyption",
"city": "menofia",
"gender": "male",
"birth_date": "2002-8-20",
"address": "64 altowheed stread",
"insurance_company": "bank masr for life ensurance",
"policy_holder": "mohomed hatem",
"policy_number": "2262509",
"policy_start_date": "2006-8-8",
"policy_end_date": "2025-8-9",
"notice": "i noticed",
"how_did_you_know_about_us": "internet",
"patient_status": null,
"report_1": null,
"report_2": null,
"other_document": null,
"transactions": []
}
}
Example response (404, no patient with the specified ID):
{
"status": "error",
"message": "There is no patient with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete patient.
Example request:
curl --request DELETE \
"http://localhost:8000/api/patient/3" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/patient/3"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/patient/3';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, patient has been deleted successfully):
{
"status": "Request was successful",
"message": "the patient has been deleted successfully",
"data": null
}
Example response (404, no patient with the specified ID):
{
"status": "error",
"message": "There is no patient with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Service group management
APIs to manage service group resources
Display a listing of the resource.
Example request:
curl --request GET \
--get "http://localhost:8000/api/serviceGroup" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/serviceGroup"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
[
{
"id": 4,
"code": "451",
"name": "teet",
"created_at": "2024-10-11T07:48:13.000000Z",
"updated_at": "2024-10-11T07:48:13.000000Z"
},
{
"id": 5,
"code": "4512",
"name": "teeth",
"created_at": "2024-10-11T07:48:23.000000Z",
"updated_at": "2024-10-11T07:48:23.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/serviceGroup/create
Example request:
curl --request POST \
"http://localhost:8000/api/serviceGroup/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"pzxb\",
\"name\": \"x\"
}"
const url = new URL(
"http://localhost:8000/api/serviceGroup/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "pzxb",
"name": "x"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'code' => 'pzxb',
'name' => 'x',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"data": [
{
"id": 68,
"code": "quis",
"name": "aut"
},
{
"id": 69,
"code": "blanditiis",
"name": "voluptatem"
}
]
}
Example response (200, the service group created successfully):
{
"status": "Request was successful",
"message": "the service group has been created successfully",
"data": {
"code": "45123",
"name": "surgery",
"updated_at": "2024-10-11T07:35:31.000000Z",
"created_at": "2024-10-11T07:35:31.000000Z",
"id": 2
}
}
Example response (404, code or name already exist):
{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
Example response (422, required parameters missing):
{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the service group code is required"
],
"name": [
"service group name is required"
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified resource.
Example request:
curl --request GET \
--get "http://localhost:8000/api/serviceGroup/4" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/serviceGroup/4"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
{
"id": 4,
"code": "451",
"name": "teet",
"created_at": "2024-10-11T07:48:13.000000Z",
"updated_at": "2024-10-11T07:48:13.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/serviceGroup/{id}
Example request:
curl --request PUT \
"http://localhost:8000/api/serviceGroup/4" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"rcoxkeroldjtmqd\",
\"name\": \"eyt\"
}"
const url = new URL(
"http://localhost:8000/api/serviceGroup/4"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "rcoxkeroldjtmqd",
"name": "eyt"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'code' => 'rcoxkeroldjtmqd',
'name' => 'eyt',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, the service group has been update successfully):
{
"status": "Request was successful",
"message": "the service group has been updated successfully",
"data": {
"code": "54564512",
"name": "surgery"
}
}
Example response (404, code or name already exist):
{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
Example response (404, There is no service group with the specified ID):
{
"status": "error",
"message": "There is no service group with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified resource from storage.
Example request:
curl --request DELETE \
"http://localhost:8000/api/serviceGroup/4" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/serviceGroup/4"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/serviceGroup/4';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, the service group has been deleted successfully):
{
"status": "Request was successful",
"message": "the service group has been deleted successfully",
"data": null
}
Example response (404, There is no service group with the specified ID):
{
"status": "error",
"message": "There is no service group with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Services management
APIs to manage services resources
get all services
Example request:
curl --request GET \
--get "http://localhost:8000/api/service" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/service"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
"request was successful"{
"status": "Request was successful",
"message": "success",
"data": {
"name_english": "teeth removal",
"name_arabic": "خلع أسنان",
"code": "05304545dssd555223",
"QTY": "20",
"cost": "210",
"price": "260",
"service_group_id": "2",
"updated_at": "2024-10-11T07:53:18.000000Z",
"created_at": "2024-10-11T07:53:18.000000Z",
"id": 4
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store services
Example request:
curl --request POST \
"http://localhost:8000/api/service/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name_english\": \"tgkcmychgufvkjbfhmlvpahcg\",
\"name_arabic\": \"jjtkwkvtfsrocuvildopobj\",
\"code\": \"wrprssiqgz\",
\"QTY\": 59,
\"cost\": 31,
\"price\": 29,
\"service_group_id\": 3
}"
const url = new URL(
"http://localhost:8000/api/service/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name_english": "tgkcmychgufvkjbfhmlvpahcg",
"name_arabic": "jjtkwkvtfsrocuvildopobj",
"code": "wrprssiqgz",
"QTY": 59,
"cost": 31,
"price": 29,
"service_group_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name_english' => 'tgkcmychgufvkjbfhmlvpahcg',
'name_arabic' => 'jjtkwkvtfsrocuvildopobj',
'code' => 'wrprssiqgz',
'QTY' => 59,
'cost' => 31,
'price' => 29,
'service_group_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
"service group created successfully"{
"status": "Request was successful",
"message": "the service group has been created successfully",
"data": {
"code": "4512",
"name": "teeth",
"updated_at": "2024-10-11T07:48:23.000000Z",
"created_at": "2024-10-11T07:48:23.000000Z",
"id": 5
}
}
Example response (400):
3 "code or name already exists"{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
Example response (404, no service group with the specified id):
{
"status": "error",
"message": "Validation failed",
"data": {
"service_group_id": [
"there is no service group with this id"
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display Service by id
Example request:
curl --request GET \
--get "http://localhost:8000/api/service/6230275" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/service/6230275"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/6230275';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": {
"id": 4,
"service_group_id": 2,
"code": "05304545d555223",
"name_english": "teeth removal",
"name_arabic": "خلع أسنان",
"QTY": 20,
"cost": 210,
"price": 260,
"created_at": "2024-10-11T07:53:18.000000Z",
"updated_at": "2024-10-11T07:53:18.000000Z"
}
}
Example response (404, no service with the specified id):
{
"status": "error",
"message": "There is no service with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
update services
Example request:
curl --request PUT \
"http://localhost:8000/api/service/41427630" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name_english\": \"kpaxwltgeitmxvahigfstdvw\",
\"name_arabic\": \"inrkxhjsoprweqxwhzdn\",
\"code\": \"mzb\",
\"QTY\": 59,
\"cost\": 40,
\"price\": 3,
\"service_group_id\": 18
}"
const url = new URL(
"http://localhost:8000/api/service/41427630"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name_english": "kpaxwltgeitmxvahigfstdvw",
"name_arabic": "inrkxhjsoprweqxwhzdn",
"code": "mzb",
"QTY": 59,
"cost": 40,
"price": 3,
"service_group_id": 18
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/41427630';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name_english' => 'kpaxwltgeitmxvahigfstdvw',
'name_arabic' => 'inrkxhjsoprweqxwhzdn',
'code' => 'mzb',
'QTY' => 59,
'cost' => 40,
'price' => 3,
'service_group_id' => 18,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
"service group created successfully"{
"status": "Request was successful",
"message": "the service group has been created successfully",
"data": {
"code": "4512",
"name": "teeth",
"updated_at": "2024-10-11T07:48:23.000000Z",
"created_at": "2024-10-11T07:48:23.000000Z",
"id": 5
}
}
Example response (400):
3 "code or name already exists"{
"status": "error",
"message": "Validation failed",
"data": {
"code": [
"the specified code already exists"
],
"name": [
"the specified name already exists"
]
}
}
Example response (404, no service group with the specified id):
{
"status": "error",
"message": "Validation failed",
"data": {
"service_group_id": [
"there is no service group with this id"
]
}
}
Example response (404, there is no service with the specified id):
{
"status": "error",
"message": "There is no service with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
delete service
Example request:
curl --request DELETE \
"http://localhost:8000/api/service/725" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/service/725"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/service/725';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "the service has been deleted successfully",
"data": null
}
Example response (404, there is no service with the specified id):
{
"status": "error",
"message": "There is no service with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
clinic management
APIs to manage clinic resources
Display all available clinics
Example request:
curl --request GET \
--get "http://localhost:8000/api/clinic" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/clinic"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"status": "Request was successful",
"message": "success",
"data": [
{
"id": 5,
"name_english": "surgery",
"name_arabic": "جراحه",
"specialization": "surgery",
"location": "kweit",
"address": "15 wall street",
"phone": "0904562185",
"mobile": "01236954812",
"logo": "surgery/surgery_logo.jpg",
"created_at": "2024-10-12T10:55:24.000000Z",
"updated_at": "2024-10-12T10:55:24.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create new clinic
Example request:
curl --request POST \
"http://localhost:8000/api/clinic/create" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name_english=zrigvbkfklbwnlwn"\
--form "name_arabic=jbmyq"\
--form "specialization=apcvikcniojk"\
--form "location=kjvsrvwah"\
--form "address=ysg"\
--form "phone=pyenfmk"\
--form "mobile=qqwrphzgmeokzjuja"\
--form "logo=@/tmp/phpmpiljG" const url = new URL(
"http://localhost:8000/api/clinic/create"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name_english', 'zrigvbkfklbwnlwn');
body.append('name_arabic', 'jbmyq');
body.append('specialization', 'apcvikcniojk');
body.append('location', 'kjvsrvwah');
body.append('address', 'ysg');
body.append('phone', 'pyenfmk');
body.append('mobile', 'qqwrphzgmeokzjuja');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/create';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name_english',
'contents' => 'zrigvbkfklbwnlwn'
],
[
'name' => 'name_arabic',
'contents' => 'jbmyq'
],
[
'name' => 'specialization',
'contents' => 'apcvikcniojk'
],
[
'name' => 'location',
'contents' => 'kjvsrvwah'
],
[
'name' => 'address',
'contents' => 'ysg'
],
[
'name' => 'phone',
'contents' => 'pyenfmk'
],
[
'name' => 'mobile',
'contents' => 'qqwrphzgmeokzjuja'
],
[
'name' => 'logo',
'contents' => fopen('/tmp/phpmpiljG', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, clinic created successfully):
{
"status": "Request was successful",
"message": "Clinic created successfully",
"data": {
"name_english": "surgery",
"name_arabic": "جراحه",
"specialization": "surgery",
"location": "kweit",
"address": "15 wall street",
"phone": "0904562185",
"mobile": "01236954812",
"logo": "surgery/surgery_logo.jpg",
"updated_at": "2024-10-12T10:35:36.000000Z",
"created_at": "2024-10-12T10:35:36.000000Z",
"id": 1
}
}
Example response (404, name_english or name_arabic already exists):
{
"status": "error",
"message": "Validation failed",
"data": {
"name_english": [
"This clinic english name already exists."
],
"name_arabic": [
"This clinic arabic name already exists."
]
}
}
Example response (422, missing attributes):
{
"status": "error",
"message": "Validation failed",
"data": {
"name_english": [
"The english name field is required."
],
"name_arabic": [
"The arabic name field is required."
],
"specialization": [
"The specialization field is required."
],
"location": [
"The location field is required."
],
"address": [
"The address field is required."
],
"phone": [
"The phone field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
show a clinic by id
Example request:
curl --request GET \
--get "http://localhost:8000/api/clinic/23" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/clinic/23"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/23';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, request was successful):
{
"id": 5,
"name_english": "surgery",
"name_arabic": "جراحه",
"specialization": "surgery",
"location": "kweit",
"address": "15 wall street",
"phone": "0904562185",
"mobile": "01236954812",
"logo": "surgery/surgery_logo.jpg",
"created_at": "2024-10-12T10:55:24.000000Z",
"updated_at": "2024-10-12T10:55:24.000000Z"
}
Example response (404, no clinic with the specified id):
{
"status": "error",
"message": "There is no clinic with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the specified resource in storage.
Example request:
curl --request PUT \
"http://localhost:8000/api/clinic/95" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name_english=avsihdsracghupttkkcbrdyi"\
--form "name_arabic=j"\
--form "specialization=i"\
--form "location=bqlouncitpuzruxvd"\
--form "address=kenoxqewagpz"\
--form "phone=yytapemmcfov"\
--form "mobile=otmdqrcpmvmbcr"\
--form "logo=@/tmp/phpAJ6Gut" const url = new URL(
"http://localhost:8000/api/clinic/95"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name_english', 'avsihdsracghupttkkcbrdyi');
body.append('name_arabic', 'j');
body.append('specialization', 'i');
body.append('location', 'bqlouncitpuzruxvd');
body.append('address', 'kenoxqewagpz');
body.append('phone', 'yytapemmcfov');
body.append('mobile', 'otmdqrcpmvmbcr');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/95';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name_english',
'contents' => 'avsihdsracghupttkkcbrdyi'
],
[
'name' => 'name_arabic',
'contents' => 'j'
],
[
'name' => 'specialization',
'contents' => 'i'
],
[
'name' => 'location',
'contents' => 'bqlouncitpuzruxvd'
],
[
'name' => 'address',
'contents' => 'kenoxqewagpz'
],
[
'name' => 'phone',
'contents' => 'yytapemmcfov'
],
[
'name' => 'mobile',
'contents' => 'otmdqrcpmvmbcr'
],
[
'name' => 'logo',
'contents' => fopen('/tmp/phpAJ6Gut', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, clinic updated successfully):
{
"status": "Request was successful",
"message": "Clinic updated successfully",
"data": {
"id": 1,
"name_english": "brain surgery",
"name_arabic": "جراحة المخ و الأعصاب",
"specialization": "surgery",
"location": "egypt",
"address": "15 elnaser street",
"phone": "0123598888",
"mobile": "01236954812",
"logo": "brain surgery/brain_surgery_logo.jpg",
"created_at": "2024-10-12T10:35:36.000000Z",
"updated_at": "2024-10-12T10:41:30.000000Z"
}
}
Example response (404, no clinic with the specified id):
{
"status": "error",
"message": "There is no clinic with this ID",
"data": ""
}
Example response (404, clinic name_english or name_arabic already exists):
{
"status": "error",
"message": "Validation failed",
"data": {
"name_english": [
"This clinic english name already exists."
],
"name_arabic": [
"This clinic arabic name already exists."
]
}
}
Example response (422, missing required attributes):
{
"status": "error",
"message": "Validation failed",
"data": {
"name_english": [
"The english name field is required."
],
"name_arabic": [
"The arabic name field is required."
],
"specialization": [
"The specialization field is required."
],
"location": [
"The location field is required."
],
"address": [
"The address field is required."
],
"phone": [
"The phone field is required."
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE api/clinic/{id}
Example request:
curl --request DELETE \
"http://localhost:8000/api/clinic/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/clinic/2"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost:8000/api/clinic/2';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, clinic has been deleted successfully):
{
"status": "Request was successful",
"message": "the clinic has been deleted successfully",
"data": ""
}
Example response (404, no clinic with the specified id):
{
"status": "error",
"message": "There is no service with this ID",
"data": ""
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.