Contextとは
GTDでよく出てくる概念で、そのタスクを完了すべき状況を指す(ことが多い)。例えば、「仕事」「家庭」「買い物」等々がcontextの例。
contextリストの同期
Syncing contexts is fairly straight forward. The first thing to do is add any new contexts you have created and delete any contexts that you have deleted. Then, look at the "lastedit_context" timestamp returned from Account Info to determine if any changes have happened on the server since the last time you synced. If yes, then you need to fetch the contexts from the server and integrate this into your local copy. This is where you would do conflict resolution if a context was edited in both places. After this, if you have any contexts that you edited, you can send these edits up to the server.
Sync Flowchart
Contextsの取得
- contexts/get.php
- GET,POST
レスポンス
contextの名前とidのリスト(とpravate)
[{"id":123,"name":"Work","private":0},{"id":456,"name":"Home","private":1},{"id":789,"name":"Car","private":0}]
xml形式はf=xmlオプションで取得
Contextsの追加
Add a context using the "contexts/add.php" API call. You can access this via POST. Context names must be unique within an account. If you try to add a context that already exists, you'll get an error. Each user can have up to 1000 contexts. 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 context can be shared. A value of 1 means that this context is private.
name=MyContext
access_token=yourtoken
If the add was successful the new context will be returned.
[{"id":12345,"name":"MyContext","private":0}]
Contextsの編集
Edit a context using the "contexts/edit.php" API call. You can access this via POST. Context names must be unique within an account. If you try to edit the context name to one that already exists, you will get an error. If you try to edit the context, 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 context to edit. (required)
name : A text string up to 32 characters. (required)
private : A boolean value (0 or 1) that describes if this context can be shared. A value of 1 means that this context is private.
id=12345
name=MyContext
access_token=yourtoken
If the edit was successful the edited context will be returned.
[{"id":12345,"name":"MyContext","private":0}]
Contextsの削除
- contexts/delete.php
- POST
- コンテキストのidが必須
削除後、削除されたコンテクストを持っていたタスクは、コンテクストがnoneに設定される。
レスポンス
正常に削除されると以下のようなレスポンスが返ってくる
{"deleted":12345}
エラーコード
Any of the API calls can return error messages. Here is a list of the error messages that you may receive from the contexts API endpoints. If there was an error when editing or deleting a context, the id number that you attempted to edit will be included in the error's "ref" field for your reference.
301 : Your context must have a name.
302 : A context with that name already exists.
303 : Max contexts reached (1000).
304 : Empty id.
305 : Invalid context.
306 : Nothing was edited.
Examples:
{"errorCode":302,"errorDesc":"A context with that name already exists","ref":1234}
<error id="302" ref="1234">A context with that name already exists</error>
最終更新:2015年04月25日 23:27