6.0 KiB
API Docs
List
Details for vihar list api
####Endpoint
{warning} Please note that the URI for this endpoint should include api/{$version} before
| Method | URI | Headers |
| : | :- | : |
| GET | /vihar | Bearer {token} |
URL Params
None
Data Params
{
"sant_id":"1",
"page" : "2"
}
{success} Success Response
####Code 200
####Content
{
"status": 200,
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 2,
"user_id": 2,
"sant_id": 1,
"from": null,
"to": "Surat",
"start_date": "2022-01-10",
"end_date": null,
"start_time": "16:40:00",
"end_time": null,
"created_at": "2022-01-11T12:13:53.000000Z",
"updated_at": "2022-01-11T12:13:53.000000Z",
"deleted_at": null
},
{
"id": 3,
"user_id": 2,
"sant_id": 1,
"from": null,
"to": "Surat",
"start_date": "2022-01-10",
"end_date": null,
"start_time": "16:40:00",
"end_time": null,
"created_at": "2022-01-11T12:14:25.000000Z",
"updated_at": "2022-01-11T12:14:25.000000Z",
"deleted_at": null
},
],
"first_page_url": "http://global-jain.test/api/v1/vihar?page=1",
"from": 1,
"last_page": 2,
"last_page_url": "http://global-jain.test/api/v1/vihar?page=2",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://global-jain.test/api/v1/vihar?page=1",
"label": "1",
"active": true
},
{
"url": "http://global-jain.test/api/v1/vihar?page=2",
"label": "2",
"active": false
},
{
"url": "http://global-jain.test/api/v1/vihar?page=2",
"label": "Next »",
"active": false
}
],
"next_page_url": "http://global-jain.test/api/v1/vihar?page=2",
"path": "http://global-jain.test/api/v1/vihar",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 13
}
}
{danger} Unauthenticated Response
####Code 403
####Content
{
"message": "Something went wrong!"
}
Add
Details for add vihar api
####Endpoint
{warning} Please note that the URI for this endpoint should include api/{$version} before
| Method | URI | Headers |
| : | :- | : |
| POST | /vihar | Bearer {token} |
URL Params
None
Data Params
from:Ahemdabad
to:Surat
start_date:2022-01-10
start_time:16:40
end_date:2022-01-09
sant_id:1
{success} Success Response
####Code 200
####Content
{
"status": 200,
"success": true,
"data": {
"from": "Ahemdabad",
"to": "Surat",
"start_date": "2022-01-10",
"start_time": "16:40",
"sant_id": "1",
"user_id": 2,
"updated_at": "2022-01-12T18:07:36.000000Z",
"created_at": "2022-01-12T18:07:36.000000Z",
"id": 21
},
"message": "Vihar added successfully!"
}
Update
Details for update vihar api
####Endpoint
{warning} Please note that the URI for this endpoint should include api/{$version} before
| Method | URI | Headers |
| : | :- | : |
| POST | /vihar/{id} | Bearer {token} |
URL Params
None
Data Params
from:Ahemdabad
to:Surat
start_date:2022-01-10
start_time:16:40
sant_id:1
end_date:2022-01-09
{success} Success Response
####Code 200
####Content
{
"status": 200,
"success": true,
"data": {
"id": 14,
"user_id": 2,
"sant_id": 1,
"from": "Ahemdabad",
"to": "Surat",
"start_date": "2022-01-10",
"end_date": "2022-01-10",
"start_time": "16:40:00",
"end_time": "23:59:00",
"created_at": "2022-01-11T12:34:32.000000Z",
"updated_at": "2022-01-12T18:12:18.000000Z",
"deleted_at": null
},
"message": "Vihar updated successfully!"
}
Add
Details for vihar
####Endpoint
{warning} Please note that the URI for this endpoint should include api/{$version} before
| Method | URI | Headers |
| : | :- | : |
| GET | /vihar/1 | Bearer {token} |
URL Params
None
Data Params
None
{success} Success Response
####Code 200
####Content
{
"status": 200,
"success": true,
"data": {
"id": 1,
"user_id": 1,
"sant_id": 1,
"from": "Ahemdabad",
"to": "Surat",
"start_date": "2022-01-10",
"end_date": null,
"start_time": "16:40:00",
"end_time": null,
"created_at": "2022-01-18T11:54:52.000000Z",
"updated_at": "2022-01-18T11:54:52.000000Z",
"deleted_at": null
},
"message": "Get vihar successfully!"
}
List
Details for delete vihar api
####Endpoint
{warning} Please note that the URI for this endpoint should include api/{$version} before
| Method | URI | Headers |
| : | :- | : |
| DELETE | /vihar/{id} | Default |
URL Params
None
Data Params
None
{success} Success Response
####Code 200
####Content
{
"status": 200,
"success": true,
"message": "Vihar deleted successfully!"
}