How to make a simple SearchRequest?

Interested in talking about Mash-up's? This is the place.
User avatar
barrydegraaff
Advanced member
Advanced member
Posts: 67
Joined: Tue Jun 17, 2014 3:31 am
Contact:

How to make a simple SearchRequest?

Postby barrydegraaff » Fri Aug 28, 2015 10:34 am

I will dig into it on Monday


--
Barry de Graaff
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/
Developer of Zimbra OpenPGP Zimlet, Zimbra ownCloud Zimlet and more.
A Zetalliance Founder http://www.zetalliance.org/
User avatar
barrydegraaff
Advanced member
Advanced member
Posts: 67
Joined: Tue Jun 17, 2014 3:31 am
Contact:

How to make a simple SearchRequest?

Postby barrydegraaff » Sun Aug 30, 2015 3:52 am

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_REST_API_Reference: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/8.6.0/api-reference/zimbraMail/Search.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
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/
Developer of Zimbra OpenPGP Zimlet, Zimbra ownCloud Zimlet and more.
A Zetalliance Founder http://www.zetalliance.org/

Return to “Zimlets”

Who is online

Users browsing this forum: No registered users and 3 guests