You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
410 lines
12 KiB
410 lines
12 KiB
2 years ago
|
|
||
|
## API LOGIN
|
||
|
|
||
|
Payload Login Sales
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/sales/login
|
||
|
{
|
||
|
"username": null, //string
|
||
|
"password": null //string
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
## API UPLOAD IMAGE
|
||
|
|
||
|
Payload Upload Image
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/image/{category}/upload
|
||
|
//notes: gunakan form-data
|
||
|
Payload di form-data:
|
||
|
ref_id: "" //diambil dari id berdasarkan categorynya
|
||
|
files: tipe datanya file (ini file image1)
|
||
|
files: tipe datanya file (ini file image2)
|
||
|
files: tipe datanya file (ini file image3)
|
||
|
files: tipe datanya file (ini file image4, dst)
|
||
|
```
|
||
|
|
||
|
|
||
|
## API OFFICE
|
||
|
|
||
|
Search
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/office/monitoring
|
||
|
Payload
|
||
|
{
|
||
|
"paging": {"start": 0, "length": 10},
|
||
|
"columns": [
|
||
|
{"name":"name", "logic_operator": "like", "value": "", "operator": "and"}
|
||
|
],
|
||
|
"orders": {"columns": ["name"], "ascending": true}
|
||
|
}
|
||
|
|
||
|
Response
|
||
|
{
|
||
|
"code": 200,
|
||
|
"data": {
|
||
|
"type": "FeatureCollection",
|
||
|
"features": [
|
||
|
{
|
||
|
"id": "m_office.37",
|
||
|
"geometry_name": "the_geom",
|
||
|
"type": "Feature",
|
||
|
"properties": {
|
||
|
"id": "m_office.37",
|
||
|
"company": 5,
|
||
|
"name": "goro",
|
||
|
"employes": "goro",
|
||
|
"address": "goro",
|
||
|
"description": "goro",
|
||
|
"buffer_radius": 100,
|
||
|
"lat": -6.178889275035602,
|
||
|
"lon": 106.83972036828338,
|
||
|
"geom": "POLYGON((93.8211107249645 106.839720368283,64.5317888436193 36.1290422496288,-6.17888927503533 6.83972036828345,-76.8895673936901 36.1290422496285,-106.178889275036 106.839720368283,-76.8895673936905 177.550398486938,-6.17888927503596 206.839720368283,64.5317888436189 177.550398486939,93.8211107249645 106.839720368283))",
|
||
|
"created_by": "@system",
|
||
|
"created_date": "2021-06-15T13:54:24.157516Z",
|
||
|
"modified_by": "@system",
|
||
|
"modified_date": "2021-06-15T13:54:24.157516Z",
|
||
|
"join": {
|
||
|
"": ""
|
||
|
}
|
||
|
},
|
||
|
"geometry": {
|
||
|
"type": "Point",
|
||
|
"coordinates": [
|
||
|
106.83972036828338,
|
||
|
-6.178889275035602
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"id": "m_office.36",
|
||
|
"geometry_name": "the_geom",
|
||
|
"type": "Feature",
|
||
|
"properties": {
|
||
|
"id": "m_office.36",
|
||
|
"company": 1,
|
||
|
"name": "tori",
|
||
|
"employes": "tori",
|
||
|
"address": "toritori",
|
||
|
"description": "toriaja",
|
||
|
"buffer_radius": 100,
|
||
|
"lat": -5.992300230787033,
|
||
|
"lon": 106.0353342769051,
|
||
|
"geom": "POLYGON((94.0076997692131 106.035334276905,64.7183778878679 35.3246561582504,-5.99230023078677 6.03533427690506,-76.7029783494415 35.3246561582501,-105.992300230787 106.035334276905,-76.702978349442 176.74601239556,-5.99230023078739 206.035334276905,64.7183778878674 176.74601239556,94.0076997692131 106.035334276905))",
|
||
|
"created_by": "@system",
|
||
|
"created_date": "2021-06-15T13:20:33.590436Z",
|
||
|
"modified_by": "@system",
|
||
|
"modified_date": "2021-06-15T13:52:05.91823Z",
|
||
|
"join": {
|
||
|
"": ""
|
||
|
}
|
||
|
},
|
||
|
"geometry": {
|
||
|
"type": "Point",
|
||
|
"coordinates": [
|
||
|
106.0353342769051,
|
||
|
-5.992300230787033
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"executionTime": "2.122619ms",
|
||
|
"message": "OK",
|
||
|
"totalRecord": 2
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
Payload Add/Edit Office
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/office/add
|
||
|
[PUT] https://oslog.id/geohr-api/office/{id:[0-9]+}/edit
|
||
|
{
|
||
|
"company": null, //int
|
||
|
"name": null, //string
|
||
|
"employes": null, //string
|
||
|
"address": null, //string
|
||
|
"description": null, //string
|
||
|
"geom": null //string
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
## API CUSTOMER
|
||
|
|
||
|
Monitoring
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/customer/monitoring
|
||
|
{
|
||
|
"paging": {"start": 0, "length": 10},
|
||
|
"columns": [
|
||
|
{"name":"name", "logic_operator": "like", "value": "", "operator": "and"}
|
||
|
],
|
||
|
"orders": {"columns": ["name"], "ascending": true}
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
## API SALES
|
||
|
|
||
|
Search
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/sales/monitoring
|
||
|
Payload
|
||
|
{
|
||
|
"paging": {"start": 0, "length": 10},
|
||
|
"columns": [
|
||
|
{"name":"name", "logic_operator": "like", "value": "", "operator": "and", "table_name": "m_group_sales"}
|
||
|
],
|
||
|
"joins": [
|
||
|
{"name": "group_sales", "column_results": ["name", "description"]}
|
||
|
],
|
||
|
"orders": {"columns": ["name"], "ascending": true}
|
||
|
}
|
||
|
|
||
|
Response
|
||
|
{
|
||
|
"code": 200,
|
||
|
"data": {
|
||
|
"type": "FeatureCollection",
|
||
|
"features": [
|
||
|
{
|
||
|
"id": "m_sales.1",
|
||
|
"geometry_name": "the_geom",
|
||
|
"type": "Feature",
|
||
|
"properties": {
|
||
|
"id": "m_sales.1",
|
||
|
"group_sales": 7,
|
||
|
"username": "ibnuh",
|
||
|
"password": "7f2ababa423061c509f4923dd04b6cf1",
|
||
|
"session_login": "5459aff0-82c9-40bb-a34e-e6278fd9c173",
|
||
|
"name": "ibnu hamdani",
|
||
|
"phone_number": "083823134569",
|
||
|
"email": "ibnuhamdani234@gmail.com",
|
||
|
"address": "jl tenjo bogor",
|
||
|
"achieve": null,
|
||
|
"type_sales": null,
|
||
|
"lat": -6.2622531,
|
||
|
"lon": 106.7881649,
|
||
|
"created_by": "admin",
|
||
|
"created_date": "2021-06-15T03:35:32.852925Z",
|
||
|
"modified_by": "admin",
|
||
|
"modified_date": "2021-06-15T03:35:32.852925Z",
|
||
|
"join": {
|
||
|
"group_sales_description": "Group Sales Wilayah Kebayoran baru",
|
||
|
"group_sales_name": "Kebayoran Baru"
|
||
|
}
|
||
|
},
|
||
|
"geometry": {
|
||
|
"type": "Point",
|
||
|
"coordinates": [
|
||
|
106.7881649,
|
||
|
-6.2622531
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"executionTime": "1.916764ms",
|
||
|
"message": "OK",
|
||
|
"totalRecord": 1
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Payload Add/Edit Sales
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/sales/add
|
||
|
[PUT] https://oslog.id/geohr-api/sales/{id:[0-9]+}/edit
|
||
|
{
|
||
|
"group_sales": null, //int
|
||
|
"username": null, //string
|
||
|
"password": null, //string
|
||
|
"name": null, //string
|
||
|
"phone_number": null, //string
|
||
|
"email": null, //string
|
||
|
"address": null, //string
|
||
|
"image": null //string
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
## API GROUP SALES
|
||
|
|
||
|
Search
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/group-sales/search
|
||
|
{
|
||
|
"paging": {"start": 0, "length": 10},
|
||
|
"columns": [
|
||
|
{"name":"name", "logic_operator": "like", "value": "", "operator": "and"}
|
||
|
],
|
||
|
"orders": {"columns": ["name"], "ascending": true}
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Payload Add/Edit Group Sales
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/group-sales/add
|
||
|
[PUT] https://oslog.id/geohr-api/group-sales/{id:[0-9]+}/edit
|
||
|
{
|
||
|
"name": null, //string
|
||
|
"description": null //string
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## API WAYPOINT SALES
|
||
|
|
||
|
Search
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/waypoint-sales/monitoring?salesId=1
|
||
|
Payload
|
||
|
{
|
||
|
"paging": {"start": 0, "length": -1},
|
||
|
"columns": [
|
||
|
{"name":"wptime", "logic_operator": "range", "value": "2021-06-15 00:00:00", "value1": "2021-06-15 23:59:59", "operator": "and"}
|
||
|
],
|
||
|
"orders": {"columns": ["wptime"], "ascending": true}
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Example Response (if waypoint is available)
|
||
|
```
|
||
|
{
|
||
|
"code": 200,
|
||
|
"data": {
|
||
|
"type": "FeatureCollection",
|
||
|
"features": [
|
||
|
{
|
||
|
"id": "m_sales.1",
|
||
|
"geometry_name": "the_geom",
|
||
|
"type": "Feature",
|
||
|
"properties": {
|
||
|
"id": "m_sales.1",
|
||
|
"group_sales": 7,
|
||
|
"username": "ibnuh",
|
||
|
"password": "7f2ababa423061c509f4923dd04b6cf1",
|
||
|
"session_login": "a5b5dff4-a7af-475c-9eb8-13f234d05472",
|
||
|
"name": "ibnu hamdani",
|
||
|
"phone_number": "083823134569",
|
||
|
"email": "ibnuhamdani234@gmail.com",
|
||
|
"address": "jl tenjo bogor",
|
||
|
"achieve": null,
|
||
|
"type_sales": "BTB",
|
||
|
"lat": -6.2623094,
|
||
|
"lon": 106.7880976,
|
||
|
"created_by": "admin",
|
||
|
"created_date": "2021-06-15T03:35:32.852925Z",
|
||
|
"modified_by": "@system",
|
||
|
"modified_date": "2021-06-16T07:24:31.227968Z",
|
||
|
"join": {
|
||
|
"group_sales_description": "Group Sales Wilayah Kebayoran baru",
|
||
|
"group_sales_name": "Kebayoran Baru"
|
||
|
}
|
||
|
},
|
||
|
"geometry": {
|
||
|
"type": "LineString",
|
||
|
"coordinates": [
|
||
|
[
|
||
|
106.7881649,
|
||
|
-6.2622531
|
||
|
],
|
||
|
...,
|
||
|
[
|
||
|
106.7881603,
|
||
|
-6.2622923
|
||
|
]
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"executionTime": "6.957314ms",
|
||
|
"message": "OK",
|
||
|
"totalRecord": 1
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Example Response (if waypoint is unavailable)
|
||
|
```
|
||
|
{
|
||
|
"code": 200,
|
||
|
"data": {
|
||
|
"type": "FeatureCollection",
|
||
|
"features": [
|
||
|
{
|
||
|
"id": "m_sales.2",
|
||
|
"geometry_name": "the_geom",
|
||
|
"type": "Feature",
|
||
|
"properties": {
|
||
|
"id": "m_sales.2",
|
||
|
"group_sales": 25,
|
||
|
"username": "jono",
|
||
|
"password": "jono123",
|
||
|
"session_login": null,
|
||
|
"name": "jono",
|
||
|
"phone_number": "0983838484",
|
||
|
"email": "jono@gmail.com",
|
||
|
"address": "jonoooo",
|
||
|
"achieve": null,
|
||
|
"type_sales": "BTB",
|
||
|
"lat": null,
|
||
|
"lon": null,
|
||
|
"created_by": "@system",
|
||
|
"created_date": "2021-06-16T04:06:23.743462Z",
|
||
|
"modified_by": "@system",
|
||
|
"modified_date": "2021-06-16T07:24:21.725833Z",
|
||
|
"join": {
|
||
|
"group_sales_description": "Group Sales Wilayah Cilandak",
|
||
|
"group_sales_name": "Cilandak"
|
||
|
}
|
||
|
},
|
||
|
"geometry": {
|
||
|
"type": "LineString",
|
||
|
"coordinates": []
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"executionTime": "2.73392ms",
|
||
|
"message": "OK",
|
||
|
"totalRecord": 0
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
Payload Add Waypoint Sales
|
||
|
```
|
||
|
[POST] https://oslog.id/geohr-api/waypoint-sales/add
|
||
|
{
|
||
|
"sales": null, //int
|
||
|
"lat": null, //float
|
||
|
"lon": null, //float
|
||
|
"wptime": null, //time now
|
||
|
"speed": null, //int
|
||
|
"angle": null, //float
|
||
|
"satelite": null, //int
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
## API DAILY INFO
|
||
|
|
||
|
Response (still dummy)
|
||
|
```
|
||
|
{
|
||
|
"code":200,
|
||
|
"data": {
|
||
|
"at_trip":{"total": 50, "id": [1, 2, 25]},
|
||
|
"at_customer":"20",
|
||
|
"at_office":"30",
|
||
|
"present": "100",
|
||
|
"absent":"10",
|
||
|
"at_time":"2021-06-16T07:16:03.509928Z"
|
||
|
},
|
||
|
"executionTime":"1.494754ms",
|
||
|
"message":"OK"
|
||
|
}
|
||
|
```
|