已比較的版本

索引鍵

  • 此行已新增。
  • 此行已移除。
  • 格式已變更。

建立目錄

  • 伺服器:InfoRelay

  • 目的:此 API 可供客戶端建立目錄。客戶端建立目錄時,須先指定父目錄(Parent Folder) 為何。被建立的目錄名稱是經 Base64(UTF-8) 編碼後的結果。

POST /folder/create/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<create>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <parent>{ Parent Folder ID }</parent>    <!-- 系統資料夾本身不能成為 /folder/create/ 群組編輯功能指定的目錄 -->
    <isencrypted>[ 0 | 1 ]</isencrypted>
    <display>{ 以Base64(UTF-8)編碼的目錄名稱 }</display>    <!-- 若您使用的開發語言為 Ruby,請用 Base64.strict_encode64,避免“\n”在編碼之後出現。-->
    <attribute>{ Data }</attribute>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay分享功能簡介」的說明 -->
</create>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<create>
    <status>{ Status Code }</status>
    <id>{ Folder ID }</id>
</create>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

3

Payload is not validate

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

200

唯讀權限,無法進行操作。

211

名稱為空白。

213

名稱長度超過限制。

214

欲建立的目錄與同目錄下的子目錄或檔案名稱重複。

218

父目錄(Parent Folder)不存在或已刪除。

999

General Error。


移動目錄

  • 伺服器:InfoRelay

  • 目的:此API可供客戶端移動指定目錄至目的地目錄之下。目錄名稱為經 Base64(UTF-8)編碼的結果。

POST /folder/move/

Input

程式碼區塊
languagexml
<!--?xml version="1.0" encoding="utf-8" ?-->
<move>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ Folder ID }</id>
    <display>{ 以 Base64(UTF-8) 編碼的目錄名稱 }</display>    <!-- 被移動的指定目錄名稱。若您使用的開發語言為 Ruby,請用 Base64.strict_encode64,避免“\n”在編碼之後出現。 -->
    <parent>{ New Parent Folder ID }</parent>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay 分享功能簡介」的說明 -->
</move>

Output

程式碼區塊
languagexml
<!--?xml version="1.0" encoding="utf-8" ?-->
<move>
    <status>{ Status Code }</status>
</move>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

213

上傳目錄名稱長度超過 255。

214

欲移動的目錄與同目錄下的子目錄或檔案名稱重複。

215

移動的目的地與來源目錄的上一層為同一目錄。

216

目的地目錄不存在。

218

被移動的指定目錄不存在。

225

上傳參數錯誤。

233

指定被移動的目錄與目的地目錄不在同一目錄樹下。

235

上傳參數的操作要求錯誤。

999

General Error。


移除目錄

  • 伺服器:InfoRelay

  • 目的:此 API 供客戶端刪除指定的目錄,並且可以批次刪除。預設情況下,參數 ischildonly 為 0,系統將刪除掉客戶端指定的目錄及其之下的子目錄和檔案;然而,當參數 ischildonly 設定為 1 時,只刪除指定目錄之下的子目錄及檔案,不刪除指定目錄本身。

POST /folder/remove/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<remove>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ Folder ID1, Folder ID2, Folder ID3… }</id>    <!-- 最多500個-->
    <ischildonly>[ 0 | 1 ]</ischildonly>    <!-- 0:全刪,包括指定目錄本身以及指定目錄下的子目錄和檔案(預設值) | 1:只刪子目錄不刪本身 -->
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay分享功能簡介」的說明 -->
</remove>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<remove>
    <status>{ Status Code }</status>
</remove>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

200

唯讀權限,無法進行操作。

218

要刪除的指定目錄不存在或已刪除(一次刪除多目錄時不會有這個錯誤)。

999

General Error。


移動檔案

  • 伺服器:InfoRelay

  • 目的:此 API 可供客戶端移動指定的檔案至指定的目錄下。

POST /file/move/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<move>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ File ID }</id>
    <parent>{ New Parent Folder ID }</parent>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay分享功能簡介」的說明 -->
</move>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<move>
    <status>{ Status Code }</status>
</move>


回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

214

欲移動的檔案與同目錄下的子目錄或檔案名稱重複。

215

移動的目的地與來源目錄之上一層為同一個目錄。

216

移動的目的地目錄不存在。

218

目錄不存在或已刪除。

219

檔案不存在或已刪除。

225

上傳參數錯誤。

233

指定被移動的目錄與目的地目錄不在同一目錄樹下。

235

上傳參數的操作要求錯誤。

999

General Error。


移除檔案

  • 伺服器:InfoRelay

  • 目的:接受客戶端要求,刪除客戶端指定的檔案。可一次指定多個檔案來刪除,若刪除任何一個檔案失敗,則將恢復異動前的狀態。

POST /file/remove/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<remove>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ File ID1, File ID2, File ID3…以逗點分隔欲刪除的File ID }</id>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay 分享功能簡介」的說明 -->
</remove>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<remove>
    <status>{ Status Code }</status>
</remove>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

200

唯讀權限,無法進行操作。

219

要處理的檔案不存在或已刪除。

999

General Error。


複製檔案

  • 伺服器:InfoRelay

  • 目的:此API可供客戶端複製一個或多個檔案至目的地目錄下。

資訊

指定檔案皆須屬於同一目錄下。

POST /file/copy/

Input

程式碼區塊
languagexml
<!--?xml version="1.0" encoding="utf-8" ?-->
<copy>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <parent>{ New Parent Folder ID }</parent>    <!-- fileid element可以重覆多次 -->
    <fileid>{ File ID#1 }</fileid>
    <fileid>{ File ID#2 }</fileid>
    <fileid>{ …… }</fileid>
    <fileid>{ File ID#N }</fileid>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay 分享功能簡介」的說明 -->
</copy>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8"?-->
<copy>
    <status>{ Status Code }</status>
    <fileid>{ File ID#1 }</fileid>    <!-- fileid:複製成功後新的 File ID -->
    <fileid>{ File ID#2 }</fileid>
    <fileid>{ …… }</fileid>
    <fileid>{ File ID#N }</fileid>
    <failid>{ File ID#1 }</failid>    <!-- failid:複製失敗的 File ID -->
    <failid>{ File ID#2 }</failid>
    <failid>{ …… }</failid>
    <failid>{ File ID#N }</failid>
</copy>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

216

目的地目錄不存在。

218

要處理的目錄不存在或已刪除。

219

檔案不存在或已刪除。

225

上傳參數錯誤。

234

欲複製的檔案,其父目錄不一致(例如:/file/copy/ 一次指定多個檔案,所有檔案的父目錄必須相同)。

235

上傳參數的操作要求錯誤。

999

General Error。


重新命名目錄

  • 伺服器:InfoRelay

  • 目的:此 API 可供客戶端賦予指定目錄新的名稱。目錄名稱為經 Base64(UTF-8) 編碼的結果。

POST /folder/rename/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<rename>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ Folder ID }</id>
    <isencrypted>[ 0 | 1 ]</isencrypted>
    <display>{ 以Base64(UTF-8) 編碼的目錄名稱 }</display>    <!-- 若您使用的開發語言為 Ruby,請用 Base64.strict_encode64,避免“\n”在編碼之後出現。-->
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay分享功能簡介」的說明 -->
</rename>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<rename>
    <status>{ Status Code }</status>
</rename>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

211

目錄的名稱是空值。

213

目錄的名稱長度超過255。

214

欲重新命名的目錄與同目錄下的子目錄或檔案名稱重複。

218

欲重新命名的目錄不存在。

225

輸入參數錯誤(例如:id 參數值未傳)。

235

參數的操作要求錯誤。

999

General Error。


重新命名檔案

伺服器:InfoRelay伺服器:InfoRelay

目的:此 API 可供客戶端賦予指定檔案新的名稱。檔案名稱為經 Base64(UTF-8) 編碼的結果。

POST /file/rename/

Input

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<rename>
    <token>{ token }</token>
    <userid>{ User ID }</userid>
    <id>{ File ID }</id>
    <display>{ 以 Base64(UTF-8) 編碼後的新檔案名稱 }</display>    <!-- 若您使用的開發語言為 Ruby,請用 Base64.strict_encode64,避免“\n”在編碼之後出現。-->
    <isencrypted>[ 0 | 1 ]</isencrypted>
    <isgroupaware>[ 0 | 1 ]</isgroupaware>    <!-- 1:啟用協同合作資料夾功能。詳情請參考「InfoRelay分享功能簡介」的說明 -->
</rename>

Output

程式碼區塊
<!--?xml version="1.0" encoding="utf-8" ?-->
<rename>
    <status>{ Status Code }</status>
</rename>

回傳的狀態碼(Status Code)

狀態碼

狀態描述

0

Success。

2

Authentication Fail。

5

Developer Authentication Fail。(例如:sid 不存在或 ProgKey 驗證失敗。)

211

欲重新命名的指定檔案名稱是空值。

213

欲重新命名的指定檔案名稱長度超過255。

214

欲重新命名的檔案與同目錄下的子目錄或檔案名稱重複。

219

欲重新命名的指定檔案不存在。

225

上傳參數錯誤(例如:id參數值未傳)。

235

上傳參數的操作要求錯誤。

999

General Error。


其他注意事項

資訊

協同合作 資料夾

如欲使用協同合作資料夾功能時,其操作之客戶端應用程式(Client Application) 必須在 HTTP Header 中提供 SID及ProgKey(必須採用 Authorization 的方式,Authorization Header 請參見 ServiceGateway 技術文件的 /member/acquiretoken/),當 SID 及 ProgKey 通過 OmniStore Server 的認證後,方能啟用協同合作資料夾功能(如欲詳知 OmniStor 系統所提供的分享功能,請參照本文件「分享功能簡介」)。

資訊

我的收藏 資料夾

{package}是從 AcquireToken API 所回傳的 XML Payload 中取得,為 package 參數中的 display 參數值(請參閱文件「ServiceGateway Technical Spec」)。

資訊

屬性(Attribute)

用以儲存檔案/目錄描述資訊,亦可加入各 App 對檔案/目錄獨有的資訊,以 XML 型式儲存,至少須包含以下三個內容:

  • creationtime : 建立時間

  • lastaccesstime : 最後一次存取時間

  • lastwritetime : 最後一次變更時間

  • 以上三個時間皆是從1970年至今的秒數。

    Ex: 131305412313130541231313054123

※ 由於 Attribute 內容,除了上述三個時間外,可能因不同應用而加上不同的內容。於修改內容時,請僅針對三個時間,或是您自訂的內容做修改,其他的請務必保留。

資訊

合法的標示代碼(Mark ID)

開放客戶端對指定檔案/目錄做特殊的標示記號,用以標註該檔案/目標的特殊意義 (例如:重要或書籤)。

目前 OmniStor 開放標示代碼為:

  • 1 表示星號 - 即服務顯示之星號標記

群組編輯

目前 OmniStor 系統未提供跨服務區域使用群組編輯的功能。

附註

若您為 Ruby 開發者

若您使用的開發語言為 Ruby,請用 Base64.strict_encode64,避免 \n 在編碼之後出現。

系統資料夾ID列表

類別

名稱

Folder ID

system.{package}.home.root

我的收藏

0

system.backup.root

我的備份

-3

system.sync.root

同步中心

-5

目錄
indent20px
stylecircle