---
# System prepended metadata

title: Document Specification API
tags: [API]

---


# Document Specification API
###### tags: `API`
## MasterID.API
- Prepared By : 
- Date : 18 Agustus 2021
- Name : 
- Email : 
- Division : 
- Office ID : 
- Cost Center : 

## Revision History
|Version|Author|Issue Date|Changes|
|---|---|---|---|
|1.0|Sekar Minati|11 May 2021|Initial Document|
|2.0|Widianto Purnomo|18 Agustus 2021|Add “is_etb” object on GetMasterID response|
|3.0|Sekar Minati|17 December 2021|Add “old_master_id” object on GetMasterID response|
			
## API-MASTERID: GetMasterID
Proses mendapatkan Master ID dari data user

**URL API Call**
|HTTP REQUEST|METHOD|
|---|---|
|[IP_ADDRESS] /master_id/|POST|

**Path Parameters**
|Parameter Name|Data Type|Format|Decription|
|---|---|---|---|
||||
:::danger
:exclamation:Do not supply a path parameter with this method.
:::

**Request Body**
|Property Name|Data Type|Format|Required|Description|
|---|---|---|---|---|
|masterId|String|GUID||Existing MasterID|
|cif|String||Y (optional)|User CIF number|
|ktp|String||Y (optional)|User KTP number|
|phone|String||Y (optional)|User phone number|
|email|String||Y (optional)|User email address|
|isPhoneVerified|Boolean|||Default value: true or false|
|||||true: if phone number is verified|
|||||false: if phone number is unverified|
|isEmailVerified|Boolean|||Default value: true or false|
|||||true: if email address is verified|
|||||false: if email address is unverified|
|source|String|||Ex: ProCIF, CRM, etc.
|executionDate|String|YYYY/MM/DD||For custom running backdated by scheduler|
:::success
:bulb:Please supply content body with this following structure.
:::

**Contoh :**
```json=
{
    "masterId": "90E693C0AC6940CABFA8065EF0A584E6",
    "cif": "50101",
    "ktp": "3171089999990014",
    "phone": "6281011728239",
    "email": "CONTOH.EMAIL33@ASDASD.COM",
    "isPhoneVerified": true,
    "isEmailVerified": true,
    "source": "ProCIF",
    "executionDate": "2021/05/10"
}
```

```json= 
{
    "cif": "50101",
    "ktp": "",
    "email": "CONTOH.EMAIL33@ASDASD.COM",
    "isEmailVerified": true,
    "source": "ProCIF"
}
```

**Dev URL :**
http://10.255.4.156:8000/master_id

**Response**
Success Response Example:
```json=
{
    "msg": "OK",
    "data": {
        "master_id": "0100EEEA3D5045B78869079A8DE62623",
        "status": "NEW",
        "is_etb": True
    }
}
```

```json=
{
    "msg": "OK",
    "data": {
        "master_id_parent": "CC4DDFDB4F0D496C8B7AA61C0909350E",
        "master_id": "19C00C1C23204491ADB00D67801DE859",
        "status": "NEW",
        "is_etb": False
    }
}
```

```json=
{
    "msg": "OK",
    "data": {
        "deleted_master_id": [
            "CC4DDFDB4F0D496C8B7AA61C0909350E"
        ],
        "status": "UPDATED",
        "master_id": "5B661E0ADE0F4C5C91EBCC49692D942C",
        "is_etb": True
    }
}
```

```json=
{
    "msg": "OK",
    "data": {
        "status": "EXISTING",
        "master_id": "79CEA48AD4C548678D8DAC2C8C569189",
        "is_etb": true,
        "old_master_id": [
            "FD24CA5D5CD24ED3A3213A12E4AE6D77"
        ]
    }
}
```

```json=
{
    "msg": "INVALID_PHONE",
    "data": {
        "master_id": "0D364F664C964A01912FEF5F8A65FC2B",
        "status": "NEW",
        "is_etb": False
    }
}
```

|Property Name|Data Type|Format|Decription|
|---|---|---|---|
msg|String|OK | 
|||INVALID_CIF|
|||INVALID_KTP
|||INVALID_PHONE
|||INVALID_EMAIL
|||INPUT_REQUIRED	
data|Object		
status|String|NEW
|||UPDATED
|||EXISTING	|Whether the contact is newly created/ updating the current contact/ nor already exist in MasterID
master_id|	String		
master_id_parent	|String		
deleted_master_id	|Array		
is_etb	|Boolean|	True
|||False	


Response ini akan muncul jika – HTTP Response Status Code : 200 (OK)

Contoh response failed:
1.
```json=
{
    "msg": "INVALID_EMAIL"
}
```

2.
```json=
{
    "msg": "INVALID_CIF AND INVALID_KTP AND INVALID_EMAIL AND INVALID_PHONE"
}
```

3.
```json=
{
    "msg": "INPUT_REQUIRED"
}
```

|Property Name|Data Type|Format|Decription|
|---|---|---|---|
|msg|String||OK|
|||INVALID_CIF|
|||INVALID_KTP|
|||INVALID_PHONE|
|||INVALID_EMAIL|
|||INPUT_REQUIRED
:::info
:bulb:Response ini akan muncul jika – HTTP Response Status Code : 400 (BAD REQUEST)
:::

 
## API-REKON: GetMasterIDDetail
Populate data detail sebuah Master ID

**URL API Call**
|HTTP REQUEST|METHOD|
|---|---|
|[IP_ADDRESS] /master_id/{master_id}|GET|

**Path Parameters**
Parameter| Name|	Data Type|	Format|	Decription
|---|---|----|---|---|
master_id|String|GUID	

**Request Body**
Property Name|Data Type|Format|Required|Decription
|---|---|---|---|---|
Do not supply content body with this method.

**Contoh :**
```/master_id/128E5D0531794BB2BBEC12E58411E261```

**Dev URL:**
http://10.255.4.156:8000/master_id/{master_id}

**Response**
Contoh response success : 
```json=
{
    "msg": "DATA_FOUND",
    "is_changed": true,
    "data": {
        "master_id": "0623C40C66EE4FD48D5CFABA1A91AB09",
        "phone": [
            {
                "number": "6281011728239",
                "is_verified": true,
                "created_at": "2021-05-07T15:12:37.124000",
                "updated_at": "2021-05-07T15:12:41.255000"
            }
        ],
        "cif": "60606",
        "email": [
            {
                "address": "CONTOH.EMAIL33@ASDASD.COM",
                "is_verified": true,
                "created_at": "2021-05-07T15:12:41.255000"
            }
        ],
        "old_master_id": [
            "128E5D0531794BB2BBEC12E58411E261"
        ]
    }
}
```
```json=
Contoh response failed 1:
{
    "msg": "DATA_NOT_FOUND",
    "data": null
}
```

Property Name	|Data Type|	Format	|Decription
|---|---|---|---|
msg	|String	|DATA_FOUND
|||DATA_NOT_FOUND	
is_changed|	Boolean		|Default value: true or false
||||true: jika master id yang dicari telah terganti
||||false: jika master id yang dicari tidak terganti
data|	Object


Response ini akan muncul jika – HTTP Response Status Code : 200 (OK)

