# URI046 SEO Metadata (General) API > [name=Tony Fan] ###### tags: `舊API` `API規格` SEO Metadata (General) ## (CP案)擴充項目清單 - 擴充代碼:參考 [SEO頁面分類 CP案新增](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469&range=A20) ## 網址 - path : `${TT-API網址}/domains/seo/{seoType}/{pageType}/{did}/{rowId}` ## Input JSON Path - path : `${TT-API網址}/domains/seo/{seoType}/{pageType}/{did}/{rowId}` - method : GET - query : 無 - body : 無 ### 輸入參數說明 | 欄位名稱 | 欄位說明 | 型態 | 是否必要欄位 | | -------- | -------- | -------- | -------- | | seoType | SEO型態 | String | Y | | pageType | 頁面代碼 | String | Y | | did | 網別代碼 | int | Y | | rowId | SEO資料ID | int | Y | * seoType : 切分為 normal / others 兩種型態,篩選條件如下: * normal : 只抓 metaTypeId:1 (一般類型) * [metaTypeId參考](#SEO項目欄位) * others: 只抓 metaTypeId:2 / 3 / 4 / 5 * [metaTypeId參考](#SEO項目欄位) * pageType : 頁面代碼種類參考 [SEO頁面分類](#SEO頁面分類)所示的`頁面代碼`欄位 * did : 網別代碼參考 [URI001](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=0&range=A2) * rowId : 要輸入的資料ID請參考 [SEO頁面分類](#SEO頁面分類)所示的`ROWID`欄位 #### SEO頁面分類 參考 [SEO頁面分類](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469),篩選 API類 為 `General` 的SEO項目 CP案新增頁面需要用的項目請見 [SEO頁面分類 CP案新增](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469&range=A16) ## Output JSON Path ```=json { "meta": [ { "seoLevel": <seoLevel>, "metaTypeId": <metaTypeId>, "did": <did>, "property": <property>, "propertyName": <propertyName>, "seoContent": <seoContent> } ] } ``` ### 輸出參數說明 SEO輸出欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- | -------- | | meta | SEO項目列表 | [`SEO項目欄位(Array)`](#SEO項目欄位) | Y | #### SEO項目欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- |-------- | | seoLevel | SEO層級 | String | N | | metaTypeId | SEO類型 | int | N | | did | SEO屬性 | int | N | | property | SEO屬性識別名 | String | Y | | propertyName | SEO屬性名稱 | String | N | | seoContent | SEO內容 | String | Y | - seoLevel : - S : 客製SEO / G : 公版SEO - metaTypeId : - 1 一般類型 / 2 Html5 Semantic Elements / 3 Microdata(Schema.org) / 4 Community tag (OG/Google+) / 5 自訂Tag - did : - 2 標題屬性 / 3 敘述屬性 / 4 關鍵字屬性 / null (只有一般類型有屬性,其餘類型的屬性都是null) ## API 邏輯 參考 [URI046 API邏輯](https://hackmd.io/K5O53524Sa-p6f-akhyOvw) (需有權限才能瀏覽) ## 範例 參考 [URI046 測試案例](https://docs.google.com/spreadsheets/d/1Wbn-NFDS-jZBqtfyGnDpeokW4UfNRffxmHF9AtCaGFY/edit#gid=762893995) ------ # URI047 SEO Metadata (Keyword) API > [name=Tony Fan] ###### tags: `舊API` `API規格` SEO Metadata (LP) ## 網址 - path : `${TT-API網址}/domains/seokey/{seoType}/{pageType}/{did}/{catalogId}/{keyword}` ## Input JSON Path - path : `${TT-API網址}/domains/seokey/{seoType}/{pageType}/{did}/{catalogId}/{keyword}` - method : GET - query : 無 - body : 無 ### 輸入參數說明 | 欄位名稱 | 欄位說明 | 型態 | 是否必要欄位 | | -------- | -------- | -------- | -------- | | seoType | SEO型態 | String | Y | | pageType | 頁面代碼 | String | Y | | did | 網別代碼 | int | Y | | catalogId | 產業別代碼 | int | Y | | keyword | 關鍵字 | String | Y | * seoType : 切分為 normal / others 兩種型態,篩選條件如下: * normal : 只抓 metaTypeId:1 (一般類型) * [metaTypeId參考](#SEO項目欄位) * others: 只抓 metaTypeId:2 / 3 / 4 / 5 * [metaTypeId參考](#SEO項目欄位) * pageType : 頁面代碼種類參考 [SEO頁面分類](#SEO頁面分類)所示的`頁面代碼`欄位 * did : 網別代碼參考 [URI001](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=0&range=A2) * catalogId : 要輸入的資料ID請參考 [SEO頁面分類](#SEO頁面分類)所示的`catalogId`欄位 * keyword : 要輸入的資料ID請參考 [SEO頁面分類](#SEO頁面分類)所示的`KEYWORD`欄位 #### SEO頁面分類 參考 [SEO頁面分類](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469),篩選 API類 為 `LP` 的SEO項目 CP案新增頁面需要用到的項目為: - Trading Post列表頁 - POST_LIST:請參考 [SEO頁面分類](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469&range=C16) - 正式機範例:[UC-047-03](https://docs.google.com/spreadsheets/d/1IhJHOsr3p5OmAPdj-LDG1DF3fO055RHmtX-CXXBNxkY/edit#gid=762893995&range=A4) - 測試機範例: - https://tt-api.ttstaging.com.tw/domains/seokey/normal/POST_LIST/2/-1 - 由SEO頁面分類 來看,catalogId 無作用,所以輸入-1或0都可以 - Trading Post搜尋結果頁 - POST_SEARCH:請參考 [SEO頁面分類](https://docs.google.com/spreadsheets/d/12U90GlZtqTFVemxzp5lFCv5l_eAZchVlOJN6xbRxDLI/edit#gid=204866469&range=C17) - 正式機範例:[UC-047-04](https://docs.google.com/spreadsheets/d/1IhJHOsr3p5OmAPdj-LDG1DF3fO055RHmtX-CXXBNxkY/edit#gid=762893995&range=A5) - 測試機範例: - https://tt-api.ttstaging.com.tw/domains/seokey/normal/POST_SEARCH/2/-1/nalu - 由SEO頁面分類 來看,catalogId 無作用,所以輸入-1或0都可以 ## Output JSON Path ```=json { "meta": [ { "seoLevel": <seoLevel>, "metaTypeId": <metaTypeId>, "did": <did>, "property": <property>, "propertyName": <propertyName>, "seoContent": <seoContent> } ] } ``` ### 輸出參數說明 SEO輸出欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- | -------- | | meta | SEO項目列表 | [`SEO項目欄位(Array)`](#SEO項目欄位) | Y | #### SEO項目欄位 | 欄位名稱 | 欄位說明 | 型態 | 是否可為空值 | | -------- | -------- | -------- |-------- | | seoLevel | SEO層級 | String | N | | metaTypeId | SEO類型 | int | N | | did | SEO屬性 | int | N | | property | SEO屬性識別名 | String | Y | | propertyName | SEO屬性名稱 | String | N | | seoContent | SEO內容 | String | Y | - seoLevel : - S : 客製SEO / G : 公版SEO - metaTypeId : - 1 一般類型 / 2 Html5 Semantic Elements / 3 Microdata(Schema.org) / 4 Community tag (OG/Google+) / 5 自訂Tag - did : - 2 標題屬性 / 3 敘述屬性 / 4 關鍵字屬性 / null (只有一般類型有屬性,其餘類型的屬性都是null) ## API 邏輯 參考 [URI047 API邏輯](https://hackmd.io/d2vTatPoRU2jt6HLDTPgTA) (需有權限才能瀏覽) ## 範例 參考 [URI047 測試案例](https://docs.google.com/spreadsheets/d/1IhJHOsr3p5OmAPdj-LDG1DF3fO055RHmtX-CXXBNxkY/edit#gid=762893995)