1 // TODO:
  2 // to edit the html in this file, go to https://docs.google.com/document/d/1fVOmWVPGQrQ-13F6Blctfv0KoDWEKdXrbuJcpPtQE30/edit?usp=sharing
  3 // edit the doc
  4 // File > Download as > Web Page
  5 // Copy the contents of the html file into @description below.
  6 // Run the ant target javadoc-rest-v2
  7 // open /mb3/javadoc-REST-v2.zip and open the containing index.html in your browser
  8 // you'll probably need to mess with the css to get it to look right.
  9 // I needed to edit the CSS for the class on the body element so the width isn't limited by a pixel size.
 10 
 11 /**
 12  * @name AAAAA
 13  * @class A Brief intro to the REST API V2
 14  * @description
 15  <html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ul.lst-kix_hv3qygwbefbd-1{list-style-type:none}ul.lst-kix_hv3qygwbefbd-2{list-style-type:none}ul.lst-kix_hv3qygwbefbd-3{list-style-type:none}ul.lst-kix_hv3qygwbefbd-4{list-style-type:none}ul.lst-kix_hv3qygwbefbd-5{list-style-type:none}ul.lst-kix_hv3qygwbefbd-6{list-style-type:none}ul.lst-kix_hv3qygwbefbd-7{list-style-type:none}ul.lst-kix_hv3qygwbefbd-8{list-style-type:none}.lst-kix_hv3qygwbefbd-7>li:before{content:"-  "}ul.lst-kix_hv3qygwbefbd-0{list-style-type:none}.lst-kix_hv3qygwbefbd-6>li:before{content:"-  "}.lst-kix_hv3qygwbefbd-4>li:before{content:"-  "}.lst-kix_hv3qygwbefbd-5>li:before{content:"-  "}.lst-kix_hv3qygwbefbd-2>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-0>li:before{content:"-  "}.lst-kix_hv3qygwbefbd-3>li:before{content:"-  "}.lst-kix_tdos6h61szbi-5>li:before{content:"-  "}.lst-kix_tdos6h61szbi-4>li:before{content:"-  "}.lst-kix_tdos6h61szbi-6>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-0>li:before{content:"-  "}.lst-kix_tdos6h61szbi-8>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-1>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-3>li:before{content:"-  "}.lst-kix_tdos6h61szbi-7>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-2>li:before{content:"-  "}ul.lst-kix_7gtzdxitpym-0{list-style-type:none}ul.lst-kix_7gtzdxitpym-1{list-style-type:none}.lst-kix_hv3qygwbefbd-8>li:before{content:"-  "}ul.lst-kix_7gtzdxitpym-8{list-style-type:none}.lst-kix_t8js42q2zh0c-3>li:before{content:"-  "}ul.lst-kix_7gtzdxitpym-6{list-style-type:none}ul.lst-kix_7gtzdxitpym-7{list-style-type:none}.lst-kix_t8js42q2zh0c-4>li:before{content:"-  "}ul.lst-kix_7gtzdxitpym-4{list-style-type:none}ul.lst-kix_7gtzdxitpym-5{list-style-type:none}ul.lst-kix_7gtzdxitpym-2{list-style-type:none}ul.lst-kix_7gtzdxitpym-3{list-style-type:none}.lst-kix_t8js42q2zh0c-6>li:before{content:"-  "}.lst-kix_t8js42q2zh0c-5>li:before{content:"-  "}.lst-kix_t8js42q2zh0c-7>li:before{content:"-  "}.lst-kix_7gtzdxitpym-7>li:before{content:"-  "}.lst-kix_7gtzdxitpym-8>li:before{content:"-  "}.lst-kix_t8js42q2zh0c-8>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-2>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-3>li:before{content:"-  "}ul.lst-kix_h1da3dpe7bt6-8{list-style-type:none}.lst-kix_5waxs6cc25ma-1>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-5>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-4>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-6>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-7>li:before{content:"-  "}.lst-kix_5waxs6cc25ma-8>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-8>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-7>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-0>li:before{content:"-  "}ul.lst-kix_h1da3dpe7bt6-5{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-4{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-7{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-6{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-1{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-0{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-3{list-style-type:none}ul.lst-kix_h1da3dpe7bt6-2{list-style-type:none}.lst-kix_f5y5lgg82dq7-1>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-2>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-3>li:before{content:"-  "}ul.lst-kix_7x5vd9rru26c-8{list-style-type:none}ul.lst-kix_7x5vd9rru26c-6{list-style-type:none}.lst-kix_f5y5lgg82dq7-5>li:before{content:"-  "}ul.lst-kix_7x5vd9rru26c-7{list-style-type:none}ul.lst-kix_7x5vd9rru26c-4{list-style-type:none}.lst-kix_f5y5lgg82dq7-4>li:before{content:"-  "}.lst-kix_f5y5lgg82dq7-6>li:before{content:"-  "}ul.lst-kix_7x5vd9rru26c-5{list-style-type:none}ul.lst-kix_7x5vd9rru26c-2{list-style-type:none}ul.lst-kix_7x5vd9rru26c-3{list-style-type:none}ul.lst-kix_7x5vd9rru26c-0{list-style-type:none}.lst-kix_7gtzdxitpym-6>li:before{content:"-  "}ul.lst-kix_7x5vd9rru26c-1{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-3{list-style-type:none}.lst-kix_7gtzdxitpym-5>li:before{content:"-  "}ul.lst-kix_f5y5lgg82dq7-2{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-5{list-style-type:none}ul.lst-kix_5waxs6cc25ma-1{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-4{list-style-type:none}ul.lst-kix_5waxs6cc25ma-0{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-7{list-style-type:none}.lst-kix_7gtzdxitpym-3>li:before{content:"-  "}ul.lst-kix_5waxs6cc25ma-3{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-6{list-style-type:none}ul.lst-kix_5waxs6cc25ma-2{list-style-type:none}.lst-kix_7gtzdxitpym-4>li:before{content:"-  "}ul.lst-kix_5waxs6cc25ma-5{list-style-type:none}ul.lst-kix_f5y5lgg82dq7-8{list-style-type:none}ul.lst-kix_5waxs6cc25ma-4{list-style-type:none}.lst-kix_t8js42q2zh0c-2>li:before{content:"-  "}.lst-kix_7gtzdxitpym-1>li:before{content:"-  "}ul.lst-kix_5waxs6cc25ma-7{list-style-type:none}ul.lst-kix_5waxs6cc25ma-6{list-style-type:none}.lst-kix_t8js42q2zh0c-1>li:before{content:"-  "}ul.lst-kix_5waxs6cc25ma-8{list-style-type:none}.lst-kix_t8js42q2zh0c-0>li:before{content:"-  "}.lst-kix_7gtzdxitpym-2>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-5>li:before{content:"-  "}.lst-kix_h1da3dpe7bt6-1>li:before{content:"-  "}.lst-kix_h1da3dpe7bt6-3>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-7>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-4>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-8>li:before{content:"-  "}.lst-kix_7gtzdxitpym-0>li:before{content:"-  "}.lst-kix_h1da3dpe7bt6-2>li:before{content:"-  "}.lst-kix_tdos6h61szbi-1>li:before{content:"-  "}.lst-kix_tdos6h61szbi-2>li:before{content:"-  "}.lst-kix_tdos6h61szbi-3>li:before{content:"-  "}.lst-kix_7x5vd9rru26c-6>li:before{content:"-  "}ul.lst-kix_f5y5lgg82dq7-1{list-style-type:none}.lst-kix_h1da3dpe7bt6-0>li:before{content:"-  "}ul.lst-kix_f5y5lgg82dq7-0{list-style-type:none}ul.lst-kix_tdos6h61szbi-1{list-style-type:none}ul.lst-kix_tdos6h61szbi-0{list-style-type:none}.lst-kix_hv3qygwbefbd-0>li:before{content:"-  "}.lst-kix_hv3qygwbefbd-1>li:before{content:"-  "}.lst-kix_h1da3dpe7bt6-6>li:before{content:"-  "}.lst-kix_h1da3dpe7bt6-5>li:before{content:"-  "}ul.lst-kix_t8js42q2zh0c-5{list-style-type:none}ul.lst-kix_t8js42q2zh0c-4{list-style-type:none}ul.lst-kix_t8js42q2zh0c-7{list-style-type:none}.lst-kix_tdos6h61szbi-0>li:before{content:"-  "}ul.lst-kix_t8js42q2zh0c-6{list-style-type:none}ul.lst-kix_t8js42q2zh0c-8{list-style-type:none}.lst-kix_h1da3dpe7bt6-4>li:before{content:"-  "}ul.lst-kix_t8js42q2zh0c-1{list-style-type:none}ul.lst-kix_t8js42q2zh0c-0{list-style-type:none}ul.lst-kix_t8js42q2zh0c-3{list-style-type:none}ul.lst-kix_t8js42q2zh0c-2{list-style-type:none}ul.lst-kix_tdos6h61szbi-8{list-style-type:none}ul.lst-kix_tdos6h61szbi-7{list-style-type:none}ul.lst-kix_tdos6h61szbi-6{list-style-type:none}.lst-kix_h1da3dpe7bt6-7>li:before{content:"-  "}ul.lst-kix_tdos6h61szbi-5{list-style-type:none}ul.lst-kix_tdos6h61szbi-4{list-style-type:none}.lst-kix_h1da3dpe7bt6-8>li:before{content:"-  "}ul.lst-kix_tdos6h61szbi-3{list-style-type:none}ul.lst-kix_tdos6h61szbi-2{list-style-type:none}ol{margin:0;padding:0}table td,table th{padding:0}.c3{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c13{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-family:"Arial";font-style:normal}.c2{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c16{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:center}.c12{color:#000000;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c7{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial"}.c14{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-family:"Arial"}.c19{text-decoration-skip-ink:none;-webkit-text-decoration-skip:none;color:#1155cc;text-decoration:underline}.c18{background-color:#ffffff;max-width:1000px;padding:72pt 72pt 72pt 72pt}.c1{padding:0;margin:0}.c9{margin-left:72pt;padding-left:0pt}.c5{margin-left:36pt;padding-left:0pt}.c10{color:inherit;text-decoration:inherit}.c17{text-indent:36pt}.c20{font-size:18pt}.c15{font-size:10.5pt}.c6{height:11pt}.c0{font-style:italic}.c4{font-size:10pt}.c8{font-weight:700}.c11{margin-right:9pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c18"><div><p class="c2 c6 c11"><span class="c3"></span></p></div><p class="c16"><span class="c13 c20">REST V2 Quick Start Guide</span></p><p class="c16 c6"><span class="c3"></span></p><p class="c2"><span class="c8 c12">Accepted Request Methods</span></p><p class="c2"><span>The MediaBeacon REST API accepts GET, POST and PUT requests interchangeably.  One thing to keep in mind when making a request is the parameter type and length.  </span><span class="c3"> GET requests are limited to 2,048 characters and do not accept file parameters, so larger requests can only be performed by POST or PUT requests.</span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2"><span>Encoding characters properly according to RFC 7230 and RFC 3986 is also important (at least when deployed with Tomcat at present, </span><span class="c19"><a class="c10" href="https://www.google.com/url?q=https://stackoverflow.com/questions/50361171/how-to-allow-character-in-urls-for-tomcat-8-5&sa=D&ust=1533592656045000">https://stackoverflow.com/questions/50361171/how-to-allow-character-in-urls-for-tomcat-8-5</a></span><span class="c3">).  If a 400 error occurs when using the bracket characters and tomcat, there are configuration changes you can make to allow those characters again (see above link, but the jist is to add relaxedQueryChars and relaxedPathChars parameters in the tomcat’s server.xml on the connector elements, like: </span></p><p class="c2"><span class="c7 c0"><Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" relaxedQueryChars='[]' relaxedPathChars='[]'/></span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2"><span> </span></p><p class="c2"><span class="c8">Authentication</span></p><p class="c2"><span>There are three ways to authenticate with MediaBeacon when making a REST Call.  The first is adding a username and a password to the request with the parameters </span><span class="c0">user</span><span> and </span><span class="c0">pass</span><span class="c3">.  This is not a secure way to authenticate because the user's password will be in plain text, but it is a quick way to authenticate if you are running a request by hand.</span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2"><span class="c3">The second way to authenticate is Basic Auth.  Basic Auth is a standardized authentication process where the username and password are are encrypted together and added as a header to the request.  The header should look something like this.</span></p><p class="c2"><span class="c3">        </span></p><p class="c2"><span>        </span><span class="c0 c7">Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l</span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2"><span>The most common way to authenticate is using an API key.  API keys identify a single user in MediaBeacon.  An API key can be generated by first logging into MediaBeacon with the user you want to associate with the key.  Next navigate to Manage > System Status > API Keys.  Near the bottom there is an option to </span><span class="c0">Create API Key</span><span>.  This key can be used as a parameter in the url or the body of requests under the key name </span><span class="c0">apikey</span><span>.</span></p><p class="c2 c6"><span class="c3"></span></p><p class="c2 c17"><span class="c0 c4">/wf/restapi/v2/assets?apikey=978FFEF6-A668-4219-AA1D-268178B767E8&</span><span class="c0 c15">ids=[201629291]</span></p><p class="c2 c6"><span class="c14 c0 c4"></span></p><p class="c2"><span class="c8">Groups/ACLs</span></p><p class="c2"><span>The REST API will run in a users default Group/ACL unless an ACL Id is specified. To specify an ACL Id, set the </span><span class="c0">acl_id</span><span> parameter to the desired Id.  ACL Id’s can be collected by running the </span><span class="c0"><><a href="../symbols/Groups.html">Groups</a></span><span class="c3"> endpoint.</span></p><p class="c2"><span class="c3">        </span></p><p class="c2"><span class="c0 c4">/wf/restapi/v2/assets?apikey=978FFEF6-A668-4219-AA1D-268178B767E8&acl_id=</span><span class="c14 c15 c0">0_6_19C23781-5F8A-459F-A98F-7A83031775D0&ids=[201629291]</span></p><p class="c2 c6"><span class="c4 c13"></span></p><p class="c2"><span class="c12 c8">Common Request Parameters</span></p><p class="c2"><span class="c0">p</span><span class="c7 c0">retty</span></p><ul class="c1 lst-kix_f5y5lgg82dq7-0 start"><li class="c2 c5"><span class="c0">true</span><span> or </span><span class="c7 c0">false (default is false)</span></li><li class="c2 c5"><span>If </span><span class="c0">pretty</span><span class="c3"> is set to true the JSON response will be formatted with newlines and indentation.</span></li><li class="c2 c5"><span>If </span><span class="c0">pretty</span><span class="c3"> is false then the response will be more compact due to the lack of whitespace characters.</span></li></ul><p class="c2"><span class="c0">v</span><span class="c7 c0">erbose</span></p><ul class="c1 lst-kix_7x5vd9rru26c-0 start"><li class="c2 c5"><span class="c0">true</span><span> or </span><span class="c0">false (default is false)</span></li><li class="c2 c5"><span>If </span><span class="c0">verbose</span><span class="c3"> is false or undefined the response will only contain a limited set of data.</span></li></ul><ul class="c1 lst-kix_7x5vd9rru26c-1 start"><li class="c2 c9"><span class="c3">Assets only display id’s and directories their paths</span></li></ul><ul class="c1 lst-kix_7x5vd9rru26c-0"><li class="c2 c5"><span>If </span><span class="c0">verbose</span><span class="c3"> is true the response will contain a larger data set for each asset/directory</span></li></ul><ul class="c1 lst-kix_7x5vd9rru26c-1 start"><li class="c2 c9"><span>n</span><span class="c3">ame, path, height, width, bytes, …</span></li></ul><p class="c2"><span class="c3">Filters</span></p><ul class="c1 lst-kix_t8js42q2zh0c-0 start"><li class="c2 c5"><span class="c3">Filters allow users to restrict which results are returned in the response.</span></li><li class="c2 c5"><span>Filtering can be done on the properties added by </span><span class="c0">verbose</span><span class="c3">.</span></li></ul><ul class="c1 lst-kix_t8js42q2zh0c-1 start"><li class="c2 c9"><span class="c0">verbose</span><span class="c3"> needs to be set to true for filtering to occur</span></li></ul><ul class="c1 lst-kix_t8js42q2zh0c-0"><li class="c2 c5"><span class="c3">Filters are only available for REST endpoints that collect data.</span></li></ul><ul class="c1 lst-kix_t8js42q2zh0c-1 start"><li class="c2 c9"><span class="c3">ex. /wf/restapi/v2/delete doesn’t allow filtering.  It will always return the assets/directories that it affected.</span></li></ul><ul class="c1 lst-kix_t8js42q2zh0c-0"><li class="c2 c5"><span class="c3">Filters are applied after the operation of the REST call which may affect results in unexpected ways.</span></li></ul><ul class="c1 lst-kix_t8js42q2zh0c-1 start"><li class="c2 c9"><span class="c3">For search operations, consider using search criteria instead of filters for more control over results and paging.</span></li></ul><p class="c2"><span class="c7 c0">fields</span></p><ul class="c1 lst-kix_5waxs6cc25ma-0 start"><li class="c2 c5"><span class="c0">fields</span><span class="c3"> is an array of fieldId’s, or the namespace and field.  </span></li></ul><ul class="c1 lst-kix_5waxs6cc25ma-1 start"><li class="c2 c9"><span class="c7 c0">["http://purl.org/dc/elements/1.1/ title","http://purl.org/dc/elements/1.1/ subject"]</span></li></ul><ul class="c1 lst-kix_5waxs6cc25ma-0"><li class="c2 c5"><span class="c3">Every asset that is returned by a REST endpoint will have the field values added to its object. </span></li></ul><p class="c2 c6"><span class="c3"></span></p><p class="c2"><span class="c12 c8">Usage Examples</span></p><p class="c2 c6"><span class="c12 c8"></span></p><p class="c2 c6"><span class="c3"></span></p></body></html>
 16  @example A basic request with verbose, and fields not defined.
 17  /wf/restapi/v2/assets
 18  *
 19  * Parameters:
 20  * ids=[201629291,201629290]
 21  *
 22  Response:
 23  [
 24 	 {
 25 	   "id": 201629291
 26 	 },
 27 	 {
 28 	   "id": 201629290
 29 	 }
 30  ]
 31  * @example A request for an asset with two field values.
 32  * /wf/restapi/v2/assets
 33  *
 34  * Parameters:
 35  * ids=[201629291]
 36  * fields=["http://purl.org/dc/elements/1.1/ title","http://purl.org/dc/elements/1.1/ subject"]
 37  *
 38  Response:
 39  [
 40 	 {
 41 	   "id": 201629291,
 42 	   "fields": {
 43 		 "http://purl.org/dc/elements/1.1/ title": "DC title field",
 44 		 "http://purl.org/dc/elements/1.1/ subject": [
 45 		   "check",
 46 		   "1",
 47 		   "2"
 48 		 ]
 49 	   }
 50 	 }
 51  ]
 52  * @example A request with verbose=true.
 53  * /wf/restapi/v2/assets
 54  *
 55  * Parameters:
 56  * ids=[201629291]
 57  * verbose=true
 58  *
 59  Response:
 60  [
 61 	 {
 62 	   "id": 201629291,
 63 	   "name": "asset4.xmp",
 64 	   "path": "RESTTest/assets/inner/asset4.xmp",
 65 	   "height": 1,
 66 	   "width": 1,
 67 	   "bytes": 4096,
 68 	   "lastModified": 1507813578000,
 69 	   "mimeType": "application/octet-stream",
 70 	   "previews": {
 71 		 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323931",
 72 		 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323931",
 73 		 "downloadUrl": "../servlet/dload?id=pe_323031363239323931"
 74 	   }
 75 	 }
 76  ]
 77 
 78  * @example A request with verbose=true and fields.
 79  * /wf/restapi/v2/assets
 80  *
 81  * Parameters:
 82  * ids=[201629291]
 83  * verbose=true
 84  * fields=["http://purl.org/dc/elements/1.1/ title","http://purl.org/dc/elements/1.1/ subject"]
 85  *
 86  Response:
 87  [
 88 	 {
 89 	   "id": 201629291,
 90 	   "name": "asset4.xmp",
 91 	   "path": "RESTTest/assets/inner/asset4.xmp",
 92 	   "height": 1,
 93 	   "width": 1,
 94 	   "bytes": 4096,
 95 	   "lastModified": 1507813578000,
 96 	   "mimeType": "application/octet-stream",
 97 	   "previews": {
 98 		 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323931",
 99 		 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323931",
100 		 "downloadUrl": "../servlet/dload?id=pe_323031363239323931"
101 	   },
102 	   "fields": {
103 			 "http://purl.org/dc/elements/1.1/ title": "DC title field",
104 			 "http://purl.org/dc/elements/1.1/ subject": [
105 			   "check",
106 			   "1",
107 			   "2"
108 			 ]
109 		   }
110 	 }
111  ]
112 
113  * @example A request without filtering.
114  * /wf/restapi/v2/directories
115  *
116  * Parameters: none
117  *
118  Response:
119  [
120     all Directories...
121  ]
122  * @example A request filtering on name.  This will return all directories where the name equals "test"
123  * /wf/restapi/v2/directories
124  *
125  * Parameters:
126  * name=test
127  *
128  Response:
129  [
130 	 {
131 		"name": "test",
132 		"path": "test/folder/",
133 		"resolver": "directory://182",
134 		"assets": [
135 		  {
136 			"id": 201628794
137 		  }
138 		]
139 	  }
140  ]
141 
142  * @example  A request filtering on name.  This will return all directories where the name starts with "test".
143  * /wf/restapi/v2/directories
144  *
145  * Parameters:
146  * name=test*
147  *
148  Response:
149  [
150 	 {
151 		"name": "test2",
152 		"path": "test/test2/",
153 		"resolver": "directory://256",
154 		"assets": []
155 	  },
156 	 {
157 		"name": "test",
158 		"path": "test/",
159 		"resolver": "directory://179",
160 		"assets": [
161 			{
162 				"id": 201629305
163 			}
164 		]
165 	 }
166  ]
167 
168  * @example  A request filtering on name.  This will return all directories where the name ends with "test2".
169  * /wf/restapi/v2/directories
170  *
171  * Parameters:
172  * name=*test2
173  *
174  Response:
175  [
176 	 {
177 		"name": "test2",
178 		"path": "test/test2/",
179 		"resolver": "directory://256",
180 		"assets": []
181 	  },
182 	 {
183 	   "name": "test",
184 	   "path": "test/",
185 	   "resolver": "directory://179",
186 	   "assets": [
187 			{
188 				"id": 201629305
189 			}
190 	   ]
191 	 }
192  ]
193 
194  * @example A request filtering on height equal to 1
195  * /wf/restapi/v2/assets
196  *
197  * Parameters:
198  * ids=[201629291]
199  * height=1
200  * verbose=true
201  *
202  Response:
203  [
204 	 {
205 	   "id": 201629291,
206 	   "name": "asset4.xmp",
207 	   "path": "RESTTest/assets/inner/asset4.xmp",
208 	   "height": 1,
209 	   "width": 1,
210 	   "bytes": 4096,
211 	   "lastModified": 1507813578000,
212 	   "mimeType": "application/octet-stream",
213 	   "previews": {
214 		 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323931",
215 		 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323931",
216 		 "downloadUrl": "../servlet/dload?id=pe_323031363239323931"
217 	   }
218 	 }
219  ]
220 
221  * @example A request filtering on bytes greater than 4095
222  * /wf/restapi/v2/assets
223  *
224  * Parameters:
225  * ids=[201629291]
226  * bytes=>4095
227  * verbose=true
228  *
229  Response:
230  [
231 	 {
232 	   "id": 201629291,
233 	   "name": "asset4.xmp",
234 	   "path": "RESTTest/assets/inner/asset4.xmp",
235 	   "height": 1,
236 	   "width": 1,
237 	   "bytes": 4096,
238 	   "lastModified": 1507813578000,
239 	   "mimeType": "application/octet-stream",
240 	   "previews": {
241 		 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323931",
242 		 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323931",
243 		 "downloadUrl": "../servlet/dload?id=pe_323031363239323931"
244 	   }
245 	 }
246  ]
247  * @example A request filtering on bytes less than 4097
248  * /wf/restapi/v2/assets
249  *
250  * Parameters:
251  * ids=[201629291]
252  * bytes=<4097
253  * verbose=true
254  *
255  Response:
256  [
257 	 {
258 	   "id": 201629291,
259 	   "name": "asset4.xmp",
260 	   "path": "RESTTest/assets/inner/asset4.xmp",
261 	   "height": 1,
262 	   "width": 1,
263 	   "bytes": 4096,
264 	   "lastModified": 1507813578000,
265 	   "mimeType": "application/octet-stream",
266 	   "previews": {
267 		 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323931",
268 		 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323931",
269 		 "downloadUrl": "../servlet/dload?id=pe_323031363239323931"
270 	   }
271 	 }
272  ]
273  */
274 function main() {}
275 main();
276