{"_id":"54ac1f4bec3be11400c8afa7","user":"54343147fa5527080064f43f","category":{"_id":"54ac1d36de18cc1400226e01","project":"54343170fa5527080064f449","__v":3,"pages":["54ac1decde18cc1400226e05","54ac1f4bec3be11400c8afa7","54ac246ade18cc1400226e17"],"version":"54343531bfaa3d0800c4d4af","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-06T17:36:54.457Z","from_sync":false,"order":11,"slug":"search","title":"Search"},"parentDoc":null,"project":"54343170fa5527080064f449","__v":4,"version":{"_id":"54343531bfaa3d0800c4d4af","project":"54343170fa5527080064f449","__v":28,"forked_from":"54343170fa5527080064f44c","createdAt":"2014-10-07T18:47:13.086Z","releaseDate":"2014-10-07T18:47:13.086Z","categories":["54343531bfaa3d0800c4d4b0","543435b1edce040800409240","543435b9edce040800409241","543435bcedce040800409243","543435bfedce040800409244","543435c2edce040800409245","54370cc426469424002a6dfa","54370cf026469424002a6dfd","5437129d26469424002a6e2f","543712d226469424002a6e30","5480c8fd74904f1a00053c86","54aafc6eefb39016009e4d71","54ac1d36de18cc1400226e01","54ad59369219922100751732","54b41bcf4f25cb1600518d2c","54b533a3a806f40c0050d53c","54b54bbf96fe3c0b00d38d2a","54b688a27379a90c00f53a8a","54b699efbc1a46160005edfa","54b8191691011f0b00068804","54bfb002d03bfc0d0000e814","54bfb33ed03bfc0d0000e816","55a3e94e912a6e2300882cdb","55a56c370f354f0d00fd02a8","55e85ad034516037002e9325","5638ecb62fc5520d001a4cf9","572cba2fc310640e008f63d5","596e6e42c5b53b00509791b1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-06T17:45:47.188Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets created before October 14, 2014\"\n}\n[/block]\nFor this example, we use the Less Than operator and the lowest possible timestamp for the date we are querying against (October 14, 2014 at 00:00:00). Any timestamp lower than the one given will satisfy our requirement.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?datecreated={\\\"lt\\\":\\\"1413244800000\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets created on or before October 14, 2014\"\n}\n[/block]\nIn this example, we use the Between operator with no lower limit (i.e. nothing before the ..) and an upper limit of the highest possible timestamp for the date we are querying against (October 14, 2014 at 23:59:59). Any timestamp that is lower than the one given will satisfy our requirement.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?datecreated={\\\"bt\\\":\\\"..1413331199999\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Get all assets modified between October 1, 2014 and October 14, 2014\"\n}\n[/block]\nIn this example, we use the Between operator with a lower limit of the lowest possible timestamp for the low date (October 1, 2014 at 00:00:00), and an upper limit of the highest possible timestamp for the high date (October 14, 2014 at 23:59:59). Any timestamp that is within this range will satisfy our requirement.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?datemodified={\\\"bt\\\":\\\"1412121600000..1413331199999\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets that are video or audio files\"\n}\n[/block]\nFor this example, we use the In operator and provide values in a comma-separated list.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?type={\\\"in\\\":\\\"video,audio\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets that do not have any ratings, but do have comments\"\n}\n[/block]\nFor this example, we use the Equality operator for multiple query parameters.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?hasrating={\\\"eq\\\":\\\"false\\\"}&hascomments={\\\"eq\\\":\\\"true\\\"}\\n \",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets with the word 'foo' in the filename (exact word)\"\n}\n[/block]\nFor this example, we use the Equality operator. This will return any asset with the word foo in the title. It will return files with names like foo.mp4, foos.jpg, foo-bar.wav and bar_foo.zip. It will not return assets with filenames like food_menu.pdf (see below for an example of a word prefix search).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?filename={\\\"eq\\\":\\\"foo\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get all assets with the word 'foo' in the filename (partial match)\"\n}\n[/block]\nFor this example, we use the Contains operator. This will return any asset with the word prefix foo in the title. It will return assets with filenames like foo.mp4, foos.jpg, foo-bar.wav and bar_foo.zip, as well as food_menu.pdf which contains a word that start with 'foo'.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /v3/assets?filename={\\\"ct\\\":\\\"foo\\\"}\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]","excerpt":"Search examples","slug":"examples-1","type":"basic","title":"Examples"}

Examples

Search examples

[block:api-header] { "type": "get", "title": "Get all assets created before October 14, 2014" } [/block] For this example, we use the Less Than operator and the lowest possible timestamp for the date we are querying against (October 14, 2014 at 00:00:00). Any timestamp lower than the one given will satisfy our requirement. [block:code] { "codes": [ { "code": "GET /v3/assets?datecreated={\"lt\":\"1413244800000\"}", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get all assets created on or before October 14, 2014" } [/block] In this example, we use the Between operator with no lower limit (i.e. nothing before the ..) and an upper limit of the highest possible timestamp for the date we are querying against (October 14, 2014 at 23:59:59). Any timestamp that is lower than the one given will satisfy our requirement. [block:code] { "codes": [ { "code": "GET /v3/assets?datecreated={\"bt\":\"..1413331199999\"}", "language": "http" } ] } [/block] [block:api-header] { "type": "basic", "title": "Get all assets modified between October 1, 2014 and October 14, 2014" } [/block] In this example, we use the Between operator with a lower limit of the lowest possible timestamp for the low date (October 1, 2014 at 00:00:00), and an upper limit of the highest possible timestamp for the high date (October 14, 2014 at 23:59:59). Any timestamp that is within this range will satisfy our requirement. [block:code] { "codes": [ { "code": "GET /v3/assets?datemodified={\"bt\":\"1412121600000..1413331199999\"}", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get all assets that are video or audio files" } [/block] For this example, we use the In operator and provide values in a comma-separated list. [block:code] { "codes": [ { "code": "GET /v3/assets?type={\"in\":\"video,audio\"}", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get all assets that do not have any ratings, but do have comments" } [/block] For this example, we use the Equality operator for multiple query parameters. [block:code] { "codes": [ { "code": "GET /v3/assets?hasrating={\"eq\":\"false\"}&hascomments={\"eq\":\"true\"}\n ", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get all assets with the word 'foo' in the filename (exact word)" } [/block] For this example, we use the Equality operator. This will return any asset with the word foo in the title. It will return files with names like foo.mp4, foos.jpg, foo-bar.wav and bar_foo.zip. It will not return assets with filenames like food_menu.pdf (see below for an example of a word prefix search). [block:code] { "codes": [ { "code": "GET /v3/assets?filename={\"eq\":\"foo\"}", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get all assets with the word 'foo' in the filename (partial match)" } [/block] For this example, we use the Contains operator. This will return any asset with the word prefix foo in the title. It will return assets with filenames like foo.mp4, foos.jpg, foo-bar.wav and bar_foo.zip, as well as food_menu.pdf which contains a word that start with 'foo'. [block:code] { "codes": [ { "code": "GET /v3/assets?filename={\"ct\":\"foo\"}", "language": "http" } ] } [/block]