NAV
php

Info

Welcome to the generated API reference. Get Postman Collection

Account

Test push notification onesignal

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/test-onesignal',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'user_id'=> 'quis',
            'message'=> 'quos',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

GET api/v1/test-onesignal

Query Parameters

Parameter Status Description
user_id required
message required

Test push notification news

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/test-onesignal-news',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'user_id'=> 'aut',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

GET api/v1/test-onesignal-news

Query Parameters

Parameter Status Description
user_id required

Test push notification trouble info

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/test-onesignal-troubleinfo',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'user_id'=> 'et',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

GET api/v1/test-onesignal-troubleinfo

Query Parameters

Parameter Status Description
user_id required

Test push notification installation updated

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/test-onesignal-installation-updated',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'user_id'=> 'non',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

GET api/v1/test-onesignal-installation-updated

Query Parameters

Parameter Status Description
user_id required

Test push notification complaint updated

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/test-onesignal-complaint-updated',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'user_id'=> 'eum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

HTTP Request

GET api/v1/test-onesignal-complaint-updated

Query Parameters

Parameter Status Description
user_id required

My Profile


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/auth/myprofile',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": 1,
    "name": "x",
    "wa": "6285222222",
    "accounts_count": 1,
    "is_complete": false
}

HTTP Request

GET api/v1/auth/myprofile

Update Profile


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://127.0.0.1:8000/api/v1/auth/myprofile',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'quos',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": 1,
    "name": "x",
    "wa": "x"
}

HTTP Request

PUT api/v1/auth/myprofile

Body Parameters

Parameter Type Status Description
name string required

My Notifications


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/auth/notifications',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "data": [
        {
            "id": "06fee15f-eb1d-49f9-a5e9-0f509f1d4231",
            "type": "App\\Notifications\\TroubleInfoNotification",
            "notifiable_type": "App\\MobileUser",
            "notifiable_id": 1,
            "data": {
                "id": 1,
                "title": "x",
                "status": "x",
                "created_at": "x"
            },
            "read_at": "",
            "created_at": "2022-03-10T00:11:22.000000Z",
            "updated_at": "2022-03-10T00:11:30.000000Z"
        },
        {
            "id": "xxx",
            "type": "App\\Notifications\\NewsNotification",
            "notifiable_type": "App\\MobileUser",
            "notifiable_id": 1,
            "data": {
                "id": 1,
                "category_id": "x",
                "category": {
                    "name": "x"
                },
                "title": "x",
                "picture_url": "x",
                "publish_date": "x"
            },
            "read_at": "",
            "created_at": "2022-03-10T00:11:22.000000Z",
            "updated_at": "2022-03-10T00:11:30.000000Z"
        },
        {
            "id": "xxx",
            "type": "App\\Notifications\\InstallationUpdatedNotification",
            "notifiable_type": "App\\MobileUser",
            "notifiable_id": 1,
            "data": {
                "id": 1,
                "message": "x"
            },
            "read_at": "",
            "created_at": "2022-03-10T00:11:22.000000Z",
            "updated_at": "2022-03-10T00:11:30.000000Z"
        }
    ],
    "links": {
        "first": "http:\/\/127.0.0.1:8000\/api\/v1\/auth\/notifictions?page=1",
        "last": "http:\/\/127.0.0.1:8000\/api\/v1\/auth\/notifictions?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/127.0.0.1:8000\/api\/v1\/auth\/notifictions",
        "per_page": 15,
        "to": 14,
        "total": 14
    }
}

HTTP Request

GET api/v1/auth/notifications

Accounts


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/accounts',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

[
    {
        "id": "x",
        "cid": "x",
        "attr": {
            "nama": "x",
            "idpel": "x",
            "alamat": "x",
            "golongan": "x",
            "pekerjaan": "x"
        }
    }
]

HTTP Request

GET api/v1/accounts

Account Add


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/accounts',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'cid' => 'libero',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

{
    "cid": "x"
}

Example response (422):

{
    "message": "x",
    "errors": {
        "cid": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/accounts

Body Parameters

Parameter Type Status Description
cid string required ID Pelanggan

Account Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/accounts/consectetur',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": "x",
    "cid": "x",
    "attr": {
        "nama": "x",
        "idpel": "x",
        "alamat": "x",
        "golongan": "x",
        "pekerjaan": "x"
    }
}

HTTP Request

GET api/v1/accounts/{id}

URL Parameters

Parameter Status Description
id required

Account Delete


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://127.0.0.1:8000/api/v1/accounts/minima',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "success": true
}

HTTP Request

DELETE api/v1/accounts/{id}

URL Parameters

Parameter Status Description
id required

Activities


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/activities',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "data": [
        {
            "id": 1,
            "mobile_user_id": "",
            "entity_id": "x",
            "entity_type": "App\\Installation",
            "entity_data": {
                "id": "x",
                "name": "x",
                "profession": "x",
                "address": "x",
                "installation_address": "x",
                "lat": "x",
                "long": "x",
                "home_status": "x",
                "attr": {
                    "number_of_occupants": "x"
                },
                "status": "new|processing|done",
                "status_date": "2022-08-04 18:00:00"
            }
        },
        {
            "id": 2,
            "mobile_user_id": "",
            "entity_id": "x",
            "entity_type": "App\\Complaint",
            "entity_data": {
                "id": "x",
                "type_id": "x",
                "type": {
                    "name": "x"
                },
                "number": "x",
                "data": {
                    "cid": "x",
                    "cid_data": {
                        "nama": "x",
                        "idpel": "x",
                        "alamat": "x",
                        "golongan": "x",
                        "pekerjaan": "x"
                    },
                    "address": "x",
                    "latitude": "x",
                    "longitude": "x",
                    "picture": "x",
                    "picture_url": {
                        "s": "http:\/\/",
                        "l": "http:\/\/"
                    }
                },
                "status": "new",
                "status_date": ""
            }
        }
    ],
    "links": {
        "first": "http:\/\/127.0.0.1:8000\/api\/v1\/activities?page=1",
        "last": "http:\/\/127.0.0.1:8000\/api\/v1\/activities?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/127.0.0.1:8000\/api\/v1\/activities",
        "per_page": 15,
        "to": 14,
        "total": 14
    }
}

HTTP Request

GET api/v1/activities

Authenticate

Get OTP

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/get-otp',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa' => '6285222222',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

Example response (422):

{
    "message": "x",
    "errors": {
        "wa": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/get-otp

Body Parameters

Parameter Type Status Description
wa string required

Resend OTP

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/resend-otp',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa' => '6285222222',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "success": true
}

Example response (422):

{
    "message": "x",
    "errors": {
        "wa": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/resend-otp

Body Parameters

Parameter Type Status Description
wa string required

Get Access Token

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/get-token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa' => '6285222222',
            'code' => 2,
            'device_info' => [
                'unique_id' => 'nostrum',
                'manufacturer' => 'Apple',
                'model' => 'Iphone x',
                'device_name' => 'Jhon Due',
                'app_version' => '1.0',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "id": 1,
    "name": "x",
    "access_token": "xx"
}

Example response (422):

{
    "message": "x",
    "errors": {
        "wa": [
            "x"
        ],
        "code": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/get-token

Body Parameters

Parameter Type Status Description
wa string required
code integer required The OTP Code.
device_info array required The Device Information.
device_info.unique_id string optional required.
device_info.manufacturer string optional required.
device_info.model string optional required.
device_info.device_name string optional required.
device_info.app_version string optional required.

Logout


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/auth/logout',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "success": true
}

HTTP Request

POST api/v1/auth/logout

General

Data Reference

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/references',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "url_terms_of_service": "http:\/\/xx",
    "url_privacy_policy": "http:\/\/xx",
    "url_google_play": "http:\/\/xx"
}

HTTP Request

GET api/v1/references

Check Bill


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/bills/check',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'cid' => 'consequatur',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "cek_tagihan": {
        "tgl": "2022-07-30",
        "batas_bulan_tagihan": "2022-06-30"
    },
    "data_pelanggan": {
        "idpel": "01-01-00001",
        "nama": "SIMANG JOKO MARTONO",
        "total_angsuran": ".00",
        "bayar_angsuran": "0",
        "komitmen_angsuran": "0"
    },
    "terakhir_bayar": {
        "tgl": "2022-06-04 12:42:59.000",
        "bulan_tagihan": "2022-05-31",
        "kode_loket": "201"
    },
    "list_tagihan": [
        {
            "tahun_bulan": "2022-06",
            "bulan": "06",
            "tahun": "2022",
            "biaya_admin": "3500.00",
            "biaya_pemeliharaan": "5500.00",
            "biaya_materai": ".00",
            "biaya_air": "143250.00",
            "tagihan_air": 152250,
            "denda": 5000,
            "angsuran": 0,
            "total": 157250
        }
    ]
}

Example response (422):

{
    "message": "x",
    "errors": {
        "cid": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/bills/check

Body Parameters

Parameter Type Status Description
cid string required ID Pelanggan

News


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/news',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> 'sit',
            'per_page'=> 'quam',
            'category_id'=> 'consequatur',
            'keyword'=> 'culpa',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "data": [
        {
            "id": 1,
            "category_id": "",
            "category": {
                "name": "x"
            },
            "title": "",
            "picture": "",
            "picture_url": {
                "s": "http:\/\/",
                "l": "http:\/\/"
            },
            "content": "",
            "publish_date": ""
        }
    ],
    "links": {
        "first": "http:\/\/127.0.0.1:8000\/api\/v1\/news?page=1",
        "last": "http:\/\/127.0.0.1:8000\/api\/v1\/news?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/127.0.0.1:8000\/api\/v1\/news",
        "per_page": 15,
        "to": 14,
        "total": 14
    }
}

HTTP Request

GET api/v1/news

Query Parameters

Parameter Status Description
page optional
per_page optional default 15
category_id optional
keyword optional

News Categories


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/news/categories',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> 'ut',
            'keyword'=> 'rerum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

null

HTTP Request

GET api/v1/news/categories

Query Parameters

Parameter Status Description
page optional
keyword optional

News Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/news/nihil',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": 1,
    "category_id": "",
    "category": {
        "name": "x"
    },
    "title": "",
    "picture": "",
    "picture_url": {
        "s": "http:\/\/",
        "l": "http:\/\/"
    },
    "content": "",
    "publish_date": ""
}

HTTP Request

GET api/v1/news/{id}

URL Parameters

Parameter Status Description
id required

Complaint Types


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/complaints/types',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

[
    {
        "id": "x",
        "name": "x"
    },
    {
        "id": "x",
        "name": "x"
    }
]

HTTP Request

GET api/v1/complaints/types

Complaint Type Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/complaints/types/velit',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": "x",
    "name": "x"
}

HTTP Request

GET api/v1/complaints/types/{id}

URL Parameters

Parameter Status Description
id required

Complaints


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/complaints',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> 'consequatur',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "data": [
        {
            "id": "x",
            "mobile_user_id": "x",
            "mobile_user": {
                "id": "x",
                "name": "x",
                "wa": "x"
            },
            "type_id": "x",
            "type": {
                "name": "x"
            },
            "number": "x",
            "data": {
                "cid": "x",
                "cid_data": {
                    "nama": "x",
                    "idpel": "x",
                    "alamat": "x",
                    "golongan": "x",
                    "pekerjaan": "x"
                },
                "address": "x",
                "latitude": "x",
                "longitude": "x",
                "picture": "x",
                "picture_url": {
                    "s": "http:\/\/",
                    "l": "http:\/\/"
                }
            },
            "status": "new",
            "status_date": "",
            "updates": [
                {
                    "status": "new|processing|done",
                    "status_date": "2022-08-04 18:00:00",
                    "message": ""
                }
            ]
        }
    ],
    "links": {
        "first": "http:\/\/127.0.0.1:8000\/api\/v1\/complaints?page=1",
        "last": "http:\/\/127.0.0.1:8000\/api\/v1\/complaints?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/127.0.0.1:8000\/api\/v1\/complaints",
        "per_page": 15,
        "to": 14,
        "total": 14
    }
}

HTTP Request

GET api/v1/complaints

Query Parameters

Parameter Status Description
page optional

Complaint Add


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/complaints',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type_id' => 20,
            'cid' => 'similique',
            'description' => 'ea',
            'picture' => 'voluptatem',
            'address' => 'fugiat',
            'latitude' => 'nam',
            'longitude' => 'iure',
            'new_name' => 'et',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

{
    "id": "x",
    "mobile_user_id": "x",
    "mobile_user": {
        "id": "x",
        "name": "x",
        "wa": "x"
    },
    "type_id": "x",
    "type": {
        "name": "x"
    },
    "number": "x",
    "data": {
        "cid": "x",
        "cid_data": {
            "nama": "x",
            "idpel": "x",
            "alamat": "x",
            "golongan": "x",
            "pekerjaan": "x"
        },
        "address": "x",
        "latitude": "x",
        "longitude": "x",
        "picture": "x",
        "picture_url": {
            "s": "http:\/\/",
            "l": "http:\/\/"
        }
    },
    "status": "new",
    "status_date": ""
}

Example response (422):

{
    "message": "x",
    "errors": {
        "type_id": [
            "x"
        ],
        "cid": [
            "x"
        ],
        "description": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/complaints

Body Parameters

Parameter Type Status Description
type_id integer required
cid string optional ID Pelanggan wajib jika type_id = 1,2,3,5,6,7,8
description string required jika type_id = 1,2,3,4,5,6,8
picture file optional opsional
address string required jika type_id = 4
latitude string required jika type_id = 4
longitude string required jika type_id = 4
new_name string required jika type_id = 7

Complaint Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/complaints/non',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": "x",
    "mobile_user_id": "x",
    "mobile_user": {
        "id": "x",
        "name": "x",
        "wa": "x"
    },
    "type_id": "x",
    "type": {
        "name": "x"
    },
    "number": "x",
    "data": {
        "cid": "x",
        "cid_data": {
            "nama": "x",
            "idpel": "x",
            "alamat": "x",
            "golongan": "x",
            "pekerjaan": "x"
        },
        "address": "x",
        "latitude": "x",
        "longitude": "x",
        "picture": "x",
        "picture_url": {
            "s": "http:\/\/",
            "l": "http:\/\/"
        }
    },
    "status": "new",
    "status_date": "",
    "updates": [
        {
            "status": "new|processing|done",
            "status_date": "2022-08-04 18:00:00",
            "message": ""
        }
    ]
}

HTTP Request

GET api/v1/complaints/{id}

URL Parameters

Parameter Status Description
id required

Trouble Info


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/troubleinfos',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> 'est',
            'per_page'=> 'tenetur',
            'keyword'=> 'voluptas',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "data": [
        {
            "id": 1,
            "title": "",
            "picture": "",
            "picture_url": null,
            "description": "",
            "status": "new",
            "created_at": "2022-03-10T00:11:22.000000Z",
            "updated_at": "2022-03-10T00:11:30.000000Z"
        },
        {
            "id": 2,
            "title": "",
            "picture": "x.jpg",
            "picture_url": {
                "s": "http:\/\/",
                "l": "http:\/\/"
            },
            "description": "",
            "status": "resolved",
            "created_at": "2022-03-10T00:11:22.000000Z",
            "updated_at": "2022-03-10T00:11:30.000000Z"
        }
    ],
    "links": {
        "first": "http:\/\/127.0.0.1:8000\/api\/v1\/troubleinfos?page=1",
        "last": "http:\/\/127.0.0.1:8000\/api\/v1\/troubleinfos?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/127.0.0.1:8000\/api\/v1\/troubleinfos",
        "per_page": 15,
        "to": 14,
        "total": 14
    }
}

HTTP Request

GET api/v1/troubleinfos

Query Parameters

Parameter Status Description
page optional
per_page optional default 15
keyword optional

Trouble Info Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/troubleinfos/placeat',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": 1,
    "title": "",
    "picture": "",
    "picture_url": null,
    "description": "",
    "status": "new",
    "created_at": "2022-03-10T00:11:22.000000Z",
    "updated_at": "2022-03-10T00:11:30.000000Z"
}

HTTP Request

GET api/v1/troubleinfos/{id}

URL Parameters

Parameter Status Description
id required

Offices


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/offices',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

[
    {
        "id": 1,
        "name": "x",
        "address": "x",
        "lat": "x",
        "long": "x",
        "phone": "x"
    }
]

HTTP Request

GET api/v1/offices

Banners


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/banners',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

[
    {
        "id": 1,
        "title": null,
        "description": null,
        "image": "57dbec69-c195-4f3a-9a2b-aa8fd4861a37.png",
        "publish": 1,
        "order": 1,
        "created_at": "2022-03-10T00:11:22.000000Z",
        "updated_at": "2022-03-10T00:11:30.000000Z",
        "url": {
            "s": "http:\/\/127.0.0.1:8000\/storage\/57dbec69-c195-4f3a-9a2b-aa8fd4861a37.png",
            "l": "http:\/\/127.0.0.1:8000\/storage\/lg-57dbec69-c195-4f3a-9a2b-aa8fd4861a37.png"
        }
    }
]

HTTP Request

GET api/v1/banners

Installation Add


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://127.0.0.1:8000/api/v1/installations',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'enim',
            'profession' => 'libero',
            'address' => 'sit',
            'installation_address' => 'qui',
            'lat' => 'accusamus',
            'long' => 'nihil',
            'number_of_occupants' => 3,
            'home_status' => 'deleniti',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

{
    "id": "x",
    "mobile_user_id": "x",
    "mobile_user": {
        "id": "x",
        "name": "x",
        "wa": "x"
    },
    "name": "x",
    "profession": "x",
    "address": "x",
    "installation_address": "x",
    "lat": "x",
    "long": "x",
    "home_status": "x",
    "attr": {
        "number_of_occupants": "x"
    }
}

Example response (422):

{
    "message": "x",
    "errors": {
        "name": [
            "x"
        ],
        "profession": [
            "x"
        ],
        "address": [
            "x"
        ],
        "installation_address": [
            "x"
        ],
        "lat": [
            "x"
        ],
        "long": [
            "x"
        ],
        "number_of_occupants": [
            "x"
        ],
        "home_status": [
            "x"
        ]
    }
}

HTTP Request

POST api/v1/installations

Body Parameters

Parameter Type Status Description
name string required
profession string required
address string required
installation_address string required
lat string required
long string required
number_of_occupants integer required
home_status string required

Installation Detail


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://127.0.0.1:8000/api/v1/installations/illo',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (200):

{
    "id": "x",
    "mobile_user_id": "x",
    "mobile_user": {
        "id": "x",
        "name": "x",
        "wa": "x"
    },
    "name": "x",
    "profession": "x",
    "address": "x",
    "installation_address": "x",
    "lat": "x",
    "long": "x",
    "home_status": "x",
    "attr": {
        "number_of_occupants": "x"
    },
    "status": "new|processing|done",
    "status_date": "2022-08-04 18:00:00",
    "updates": [
        {
            "status": "new|processing|done",
            "status_date": "2022-08-04 18:00:00",
            "message": ""
        }
    ]
}

HTTP Request

GET api/v1/installations/{id}

URL Parameters

Parameter Status Description
id required
php