Toodledo > API > Task > Saved Search


Toodledoにはタスクを探す検索ページ(API)がある。一度検索を行ったら、保存して素早くアクセスできるようになる。APIは自分で作成したSaved Searchへのアクセスを提供する。

検索規則

規則はブール演算子で繋がれる。rule1 と rule2 がrootレベルの規則で、 rule3 and rule4 がグルーピングされた規則である場合、
rule1 AND rule2 AND (rule3 OR rule4).

検索の取り出し

ユーザーの検索式を次のGETリクエストで取り出すことができる。
結果はJSONにエンコードされて返ってくる。パラメータにf=xmlを付加すれば、XMLで返すことも可能。

JSON:
  • "id":1234
  • "name":"MySearch"
  • "bool":"All",
  • "search":
    • "root":[{"field":"checked","type":"no","value":""},{"field":"title","type":"contains","value":"laundry"}],
    • "1":[{"field":"tag","type":"is","value":"tag"},{"field":"folder","type":"is not","value":"12345"}]
  • "id":1235
  • "name":"Another Search"
  • "bool":"Any",
  • "search":{
    • "root":[{"field":"checked","type":"yes","value":""},{"field":"tag","type":"does not contain","value":"urgent"}]}

Explanation of result terms:

key 内容 制約
id 検索式のid番号。ユーザーの中ではユニーク。
name 検索式の名前(表示名) 最大32文字
bool "Match"オプションの状態。2状態があり、"All" は全てのroot式とgroup式が一致する。グループ内に対しては OR、グループ外、つまりrootとgroupをつなぐのはAND(和積標準型)。"Any" はroot式とgroup式のどれかに一致する。グループ内に対しては AND、グループ外、つまりrootとgroupをつなぐのはOR(積和標準型).
search In the JSON return format, this contains the nested rules for the saved search. Each group will have a numerical index (which may or may not be consecutive). Order does not matter.
root root規則の配列
group XML形式での返信結果にて、グループ規則の配列
field 検索されるフィールド名
type : The type of search being performed (see below).
value : The value to search with.

フィールド名


検索タイプ

contains : Matches a string if it contains this substring
yes : Boolean true
is : Exact value match
begins with : Matches a string if it starts with this substring
ends with : Matches a string if it ends with this substring
does not contain : Matches a string if it does not contain this substring
no : Boolean false
is not : Exact value mismatch
is after : Matches a date if it comes after this value
is more than : Matches a number if it comes after this value
is before : Matches a date if it comes before this value
is less than : Matches a number if it comes before this value
was in the last : Matches a date if it was in the last X days
was not in the last : Matches a date if it was not in the last X days
is in the next : Matches a date if it is in the next X days
is not in the next : Matches a date if it is not in the next X days
is in : Matches a date if it is in exactly X days
is not in : Matches a date if it is not in exactly X days
was : Matches a date if it was exactly X days ago
was not : Matches a date if it was not exactly X days ago
exists : Matches if the field has a non-zero value
does not exist : Matches if the field is empty or zero

エラーコード

Any of the API calls can return error messages. The saved search calls may return some of the general error codes.
最終更新:2015年04月25日 18:47