# URI-B-06C Inquiry Product API
###### tags: `bizAdd`
> [name=RoyHuang]
------------------------------------------------------------------------
## API 清單
No | API | Desc | 執行順序 | 執行條件
:-:|----------|------------------|:--------:|----------
1 | URI-B-06 | Prepare biz data | 1 | page init
------------------------------------------------------------------------
## Prepare biz data
- Inquiry Product 商機所需顯示的資料
### URL
- {TT API 網址}/business/prepare/inquiry-product/{ productId }/{ langId }
- method : GET
- body : application/json;charset=UTF-8
- query : None
### Input JSON Path
欄位名稱 | 欄位說明 | 資料型態 | 是否必填 | 備註
------------|----------|--------|:-------:|-------------------
productId | 型錄id | number | Y | 1.透過 url 取得<br>2.整數,long type<br>EX: 2147483647
langId | 語系id | number | Y | 1.透過 header 取得<br>(目前頁面的語系)<br>2.整數,int type
### Output JSON Path
```json=
{
"code" : <number> , // 代碼,0:ok、 < 0: error 使用
"errorMsg" : <string> , // 錯誤訊息
"data" : {
"productId" : <number>, // 型錄id
"productName" : <string>, // 型錄名稱
"productImgUrl" : <string>, // 型錄圖片url
"productImgDesc" : <string>, // 型錄圖片說明
"productCpUrl" : <string>, // 型錄CP url
"companyId" : <number> , // 公司id
"companyName" : <string> , // 公司名稱
"contactTitleName" : <string>, // 公司聯絡人稱呼
"contactName" : <string>, // 公司聯絡人名稱
}
}
```
欄位名稱 | 欄位說明 | 資料型態 | 是否空值 | 備註
------------|----------|--------|:-------:|-------------------
code | 代碼 | number | N | 代碼,0:ok、 < 0: error 使用
errorMsg | 錯誤訊息 | string | N | 代碼 < 0 時,會紀錄錯誤訊息
data | 資料集合 | Object | N | [準備商機的頁面資料(Object)](#準備商機的頁面資料)
#### 準備商機的頁面資料
欄位名稱 | 欄位說明 | 資料型態 | 是否空值 | 備註
------------|----------|--------|:-------:|-------------------
productId | 型錄id | number | N | 整數,long type<br>EX: 2147483647
productName | 型錄名稱 | string | N |
productImgUrl | 型錄圖片url | string | Y | 圖檔不存在時,前台請用預設圖
productImgDesc | 型錄圖片說明 | string | N |
productCpUrl | 型錄CP url | string | N |
companyId | 公司id | number | N | 整數,long type<br>EX: 2147483647
companyName | 公司名稱 | string | N |
contactTitleName | 公司聯絡人稱謂 | string | N |
contactName | 公司聯絡人名稱 | string | N |
- 範例
```json=
{
"code" : 0
"errorMsg" : ""
"data" : {
"productId" : 1896775,
"productName" : "販售型錄",
"productImgUrl" : "https://im01.ttstaging.com.tw/5b175743-69d8-4efd-a427-45ea0af8f8c3/0546db0d-3ce8-4805-9fa6-6ca7b67392e5_33_201500014734_L-100x100.jpg",
"productImgDesc" : "販售型錄",
"productCpUrl" : "https://hyweb.en.ttstaging.com.tw/product/販售型錄-1896775.html",
"companyId" : 147927,
"companyName" : "HYWEB TECHNOLOGY CO., LTD.",
"contactTitleName" : "Mrs.",
"contactName" : "李***",
}
}
```
### SQL
[參考](https://hackmd.io/kQegnS_oTGCx5MN1LOVDFQ?both#Inquiry-product-Prepare-template-data)