How to make a simple SearchRequest?
- barrydegraaff
- Zimbra Employee
- Posts: 242
- Joined: Tue Jun 17, 2014 3:31 am
- Contact:
How to make a simple SearchRequest?
I will dig into it on Monday
--
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/
- barrydegraaff
- Zimbra Employee
- Posts: 242
- Joined: Tue Jun 17, 2014 3:31 am
- Contact:
How to make a simple SearchRequest?
In Zimbra there is always multiple ways getting from a to b.
In your case, I think I would have tried using:
https://wiki.zimbra.com/wiki/Zimbra_RES ... Get_Folder
https://myzimbra.com//home/admin/inline-pgp.xml
Where `admin` is my username and `inline-pgp` is my folder name.
then select any of xml, json,rss... etc and then style that xml response.
Since I read you don't want that, maybe I would open my browsers console and see
what request is fired when a users opens the `folderana` folder, in my case:
{"Header":{"context":{"_jsns":"urn:zimbra","userAgent":{"name":"ZimbraWebClient - FF40 (Linux)","version":"8.6.0_GA_1153"},"session":{"_content":118,"id":118},"account":{"_content":"admin@myzimbra.com","by":"name"},"csrfToken":"0_0abdd95b468ad525e7a54e10a0d2573ee316fd97"}},"Body":{"SearchRequest":{"_jsns":"urn:zimbraMail","sortBy":"dateDesc","header":[{"n":"List-ID"},{"n":"X-Zimbra-DL"},{"n":"IN-REPLY-TO"},{"n":"Content-Type"},{"n":"Content-Transfer-Encoding"}],"tz":{"id":"Europe/Berlin"},"locale":{"_content":"en_AU"},"offset":0,"limit":100,"query":"in:"inline-pgp"","types":"conversation","recip":"0","fullConversation":1,"needExp":1}}}
When you create that request using soap (browser does that when clicking in the web interface), I get a Zimbra mail view with the inline-pgp folder shown, with all messages in that folder.
Otherwise what you need is:
https://files.zimbra.com/docs/soap_api/ ... earch.html
SOAP is a bit tricky to figure out, so I would probably go with the REST-API and write regular JavaScript to handle that.
You are now trying to build using the JS/Zimlet framework or whatever it is called, and that is the hardest way to figure out,
there may be a way, but I don't know it yet. So REST-API or SOAP is my advise, (and toss the current code)
Barry
In your case, I think I would have tried using:
https://wiki.zimbra.com/wiki/Zimbra_RES ... Get_Folder
https://myzimbra.com//home/admin/inline-pgp.xml
Where `admin` is my username and `inline-pgp` is my folder name.
then select any of xml, json,rss... etc and then style that xml response.
Since I read you don't want that, maybe I would open my browsers console and see
what request is fired when a users opens the `folderana` folder, in my case:
{"Header":{"context":{"_jsns":"urn:zimbra","userAgent":{"name":"ZimbraWebClient - FF40 (Linux)","version":"8.6.0_GA_1153"},"session":{"_content":118,"id":118},"account":{"_content":"admin@myzimbra.com","by":"name"},"csrfToken":"0_0abdd95b468ad525e7a54e10a0d2573ee316fd97"}},"Body":{"SearchRequest":{"_jsns":"urn:zimbraMail","sortBy":"dateDesc","header":[{"n":"List-ID"},{"n":"X-Zimbra-DL"},{"n":"IN-REPLY-TO"},{"n":"Content-Type"},{"n":"Content-Transfer-Encoding"}],"tz":{"id":"Europe/Berlin"},"locale":{"_content":"en_AU"},"offset":0,"limit":100,"query":"in:"inline-pgp"","types":"conversation","recip":"0","fullConversation":1,"needExp":1}}}
When you create that request using soap (browser does that when clicking in the web interface), I get a Zimbra mail view with the inline-pgp folder shown, with all messages in that folder.
Otherwise what you need is:
https://files.zimbra.com/docs/soap_api/ ... earch.html
SOAP is a bit tricky to figure out, so I would probably go with the REST-API and write regular JavaScript to handle that.
You are now trying to build using the JS/Zimlet framework or whatever it is called, and that is the hardest way to figure out,
there may be a way, but I don't know it yet. So REST-API or SOAP is my advise, (and toss the current code)
Barry
--
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/