From d315e0a4fe092d23683c4de874adf90b768eb14e Mon Sep 17 00:00:00 2001 From: Brandon Ashworth Date: Mon, 1 Jun 2015 09:40:23 -0700 Subject: [PATCH] Updating Readme to have info about querying. --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c1884fa..1d7c0ab 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,46 @@ User `Authorization` header: ( I don't suggest using this unless you have an internal Shotgun sever. ) ``` Basic-user -``` \ No newline at end of file +``` + +## Query String + +- page (int): Page of results to return. +- limit (int): Number of results per page to return +- fields (comma seperated listed of string): The fields/columns to return. +- q (string): The query to execute. Syntax below. + + +## Query Syntax + +There are 3 formats for the query but they all have the same basic structures for the filters themselves. Each filter is defined by an array of 3 values. + +``` +[, , ] +``` + +- Name and relation are both string. +- Values can be either a value (string, int, bool, etc) or an array of values. + +### Format 1 + +``` +q=and([, , ],...) +q=or([, , ],...) +``` + +### Format 2 + +``` +q={"logical_operator":"and", "conditions":[[, , ],...]} +``` + +### Format 3 + +**This format is currently has a bug.** + +This format the logical_operator is always assumed to be "and". + +``` +q=[[, , ],...] +```