Toodledo > API > Folders

下位ページ

Content

Folder(フォルダ)とは?

  • タスクやノートをグループで管理する手段の一つ。
  • 違うプロジェクトや役割を分けるために用いられることが多い。

Jump To:

   Retrieving Folders
   Adding Folders
   Editing Folders
   Deleting Folders
   Errors

同期

至極単純。
  1. (クライアント側で)新しく作ったフォルダを加えて、(クライアント側で)削除したフォルダを削除する。
  2. 最終更新の時間を確認して、サーバ上に何か変更が加えられているか確認する
    1. YESなら、サーバ上の情報を取得し、ローカル(クライアント)にコピーする。サーバ、クライアント(と別のクライアント)で変更が加えられていた場合の、コンフリクト解消のため。
  3. この後、何かフォルダが編集されたら、編集情報をサーバに送信。

フォルダの取得

  • http://api.toodledo.com/3/&bold(){folders/get.php}?access_token=yourtoken
  • アクセス方法 : GET or POST.
  • The 'private' boolean value indicates that the user does not want the folder to be shared with other people. The 'archived' boolean value indicates that the user no longer wants to see this folder, but wants to retain it for historical purposes.
  • The 'order' integer represents the user's preferred order for listing folders with ord=1 being the top.

レスポンス

JSON

[{"id":123,"name":"Shopping","private":0,"archived":0,"ord":1},{"id":456,"name":"Home Repairs","private":0,"archived":0,"ord":2},{"id":789,"name":"Vacation PLanning","private":0,"archived":0,"ord":3}]

XML



<folders>
<folder><id>123</id><private>0</private><archived>0</archived>
<order>1</order><name>Shopping</name></folder>
<folder><id>456</id><private>0</private><archived>0</archived>
<order>2</order><name>Home Repairs</name></folder>
<folder><id>789</id><private>1</private><archived>0</archived>
<order>3</order><name>Vacation Planning</name></folder>
</folders>

Adding Folders

Add a folder using the "folders/add.php" API call. You can access this via POST. Folder names must be unique within an account. If you try to add a folder that already exists, you'll get an error. Each user can have up to 1000 folders. If you try to add more than this, you will get an error.

   name : A text string up to 32 characters. (required)
   private : A boolean value (0 or 1) that describes if this folder can be shared. A value of 1 means that this folder is private.


name=MyFolder
access_token=yourtoken

If the add was successful the new folder will be returned.


[{"id":12345,"name":"MyFolder","private":0,"archived":0,"ord":1}]


<folders>
<folder><id>12345</id><private>0</private><archived>0</archived>
<order>1</order><name>MyFolder</name></folder>
</folders>

Editing Folders

Edit a folder using the "folders/edit.php" API call. You can access this via POST. Folder names must be unique within an account. If you try to edit the folder name to one that already exists, you will get an error. If you try to edit the folder, but pass in the same values that already exist on the server, you will get an error. You should avoid making unnecessary edits.

   id : The id number of the folder to edit. (required)
   name : A text string up to 32 characters.
   private : A boolean value (0 or 1) that describes if this folder can be shared. A value of 1 means that this folder is private.
   archived : A boolean value (0 or 1) that describes if this folder is archived.


id=12345
name=MyFolder
private=0
access_token=yourtoken

If the edit was successful the edited folder will be returned.

[{"id":12345,"name":"MyFolder","private":0,"archived":0,"ord":1}]


<folders>
<folder><id>12345</id><private>0</private><archived>0</archived>
<order>1</order><name>MyFolder</name></folder>
</folders>

Deleting Folders

The "folders/delete.php" API call will allow you to permanently delete a folder. You can access this via POST. Any tasks or notes that currently have this folder will have their folder set to 0 (none).

   id : The id number of the folder to delete. (required)


id=12345
access_token=yourtoken

If the delete was successful you will get the following message.

{"deleted":12345}



<deleted>12345</deleted>

Error Codes

Any of the API calls can return error messages. Here is a list of the error messages that you may receive from the folder API endpoints. If there was an error when editing or deleting a folder, the id number that you attempted to edit will be included in the error's "ref" field for your reference.

   201 : Your folder must have a name.
   202 : A folder with that name already exists.
   203 : Max folders reached (1000).
   204 : Empty id.
   205 : Invalid folder.
   206 : Nothing was edited.



Examples:

JSON:
{"errorCode":202,"errorDesc":"A folder with that name already exists","ref":1234}


XML:
<error id="202" ref="1234">A folder with that name already exists</error>
最終更新:2015年10月12日 23:51