Dokumentasi API : Product – Color

Pada halaman ini, akan dijelaskan penggunaaan API untuk berinterakasi dengan tabel lookup Color.


API List

Method ini digunakan untuk mendapatkan data color yang tersedia.

Request

METHODURL
GEThttp://apiv2.mitrabunso.com/public/product/color/list/{id_user}/{offsite}/{limit}

Parameter yang digunakan pada method ini adalah sebagai berikut:

METHODParameterWajibTipeKeterangan
GETid_userYASTRING36 digit id user
GEToffsiteYAintoffsite data
GETlimitYAintlimit data
HEADAuthorizationYABearer TokenBearer Token Login
GETqTIDAKSTRINGParameter untuk pencarian
GETorderByTIDAKSTRINGParameter untuk pengurutan berdasarkan data

Response

{
    "message": "Data retrieved successfully",
    "show": "1",
    "total": 41,
    "data": [
        {
            "deleted_at": null,
            "id": "52cc50d1-7b9f-4339-aecb-eef60eea9312",
            "code": "OLG",
            "name": "Olive Green",
            "created": {
                "date": "2022-05-31 16:19:20.000000",
                "timezone_type": 3,
                "timezone": "Asia/Bangkok"
            },
            "updated": {
                "date": "2022-05-31 16:19:20.000000",
                "timezone_type": 3,
                "timezone": "Asia/Bangkok"
            },
            "createdBy": "5dff9be2-c24d-41dc-8078-1ebf9e3448f6",
            "updatedBy": "",
            "createdByName": "Albert Sebastian",
            "updatedByName": null
        }
    ]
}

API Create

Method ini digunakan untuk memasukan data color.

Request

METHODURL
POSThttp://apiv2.mitrabunso.com/public/product/color/create/{id_user}

Parameter yang digunakan pada method ini adalah sebagai berikut:

METHODParameterWajibTipeKeterangan
GETid_userYASTRING36 digit id user
HEADAuthorizationYABearer TokenBearer Token Login
POSTnameYASTRINGNama untuk color
POSTcodeYASTRINGCode untuk color

Response

{
    "message": "Data added successfully",
    "data": {
        "deleted_at": null,
        "id": "5a777adc-cd88-4ca6-b1ff-13e6dcce17b2",
        "code": "CL098",
        "name": "color blue",
        "created": {
            "date": "2022-10-08 11:32:10.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "updated": {
            "date": "2022-10-08 11:32:10.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "createdBy": "eb94482d-804e-43e2-a802-b2792ebe74c7",
        "updatedBy": "",
        "createdByName": null,
        "updatedByName": null
    }
}

API Update

Method ini digunakan untuk mengubah data color.

Request

METHODURL
POSThttp://apiv2.mitrabunso.com/public/product/color/update/{id_user}/{id_color}

Parameter yang digunakan pada method ini adalah sebagai berikut:

METHODParameterWajibTipeKeterangan
GETid_userYASTRING36 digit id user
GETid_colorYASTRING36 digit id color
HEADAuthorizationYABearer TokenBearer Token Login
POSTnameYASTRINGNama untuk color
POSTcodeYASTRINGCode untuk color

Response

{
    "message": "Data updated successfully",
    "data": {
        "deleted_at": null,
        "id": "5a777adc-cd88-4ca6-b1ff-13e6dcce17b2",
        "code": "cl098",
        "name": "color blue edited",
        "created": {
            "date": "2022-10-08 11:32:10.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "updated": {
            "date": "2022-10-08 11:33:29.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "createdBy": "eb94482d-804e-43e2-a802-b2792ebe74c7",
        "updatedBy": "eb94482d-804e-43e2-a802-b2792ebe74c7",
        "createdByName": null,
        "updatedByName": null
    }
}

API Details

Method ini digunakan untuk mendapatkan data details color.

Request

METHODURL
POSThttp://apiv2.mitrabunso.com/public/product/color/details/{id_user}/{id_color}

Parameter yang digunakan pada method ini adalah sebagai berikut:

METHODParameterWajibTipeKeterangan
GETid_userYASTRING36 digit id user
GETid_colorYASTRING36 digit id color
HEADAuthorizationYABearer TokenBearer Token Login

Response

{
    "message": "Data retrieved successfully",
    "data": {
        "deleted_at": null,
        "id": "5a777adc-cd88-4ca6-b1ff-13e6dcce17b2",
        "code": "cl098",
        "name": "color blue edited",
        "created": {
            "date": "2022-10-08 11:32:10.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "updated": {
            "date": "2022-10-08 11:33:29.000000",
            "timezone_type": 3,
            "timezone": "Asia/Bangkok"
        },
        "createdBy": "eb94482d-804e-43e2-a802-b2792ebe74c7",
        "updatedBy": "eb94482d-804e-43e2-a802-b2792ebe74c7",
        "createdByName": null,
        "updatedByName": null
    }
}

API Delete

Method ini digunakan untuk menghapus data color.

Request

METHODURL
DELETEhttp://apiv2.mitrabunso.com/public/product/color/delete/{id_user}/{id_color}

Parameter yang digunakan pada method ini adalah sebagai berikut:

METHODParameterWajibTipeKeterangan
GETid_userYASTRING36 digit id user
GETid_colorYASTRING36 digit id color
HEADAuthorizationYABearer TokenBearer Token Login

Response

{
    "message": "data deleted successfully"
}

Leave a Reply