Results 1 to 3 of 3

Thread: REST API date format.

  1. #1
    Join Date
    Dec 2009
    Posts
    19
    Rep Power
    5

    Default REST API date format.

    I've been trying to export a mailbox between two dates. From the REST documentation in /opt/zimbra/docs/rest.txt (no online documentation available since version 6 apparently, and I'm running 8.0 ....), I have been trying various things.

    I can get relative dates to work OK.
    Code:
    zmmailbox -z -m account@domain.com getRestURL "//?fmt=tgz&start=-1mon&end=0day" > /tmp/archive-lastmonth.tgz
    The absolute dates should apparently be in the format
    mm/dd/yyyy (i.e., 12/25/1998)
    yyyy/dd/mm (i.e., 1989/12/25)
    ... (dear god why?), but anyway even when against my better judgement I switch days and months around, the export fails with a message about not being able to access the URL. Has someone got this to work. eg
    Code:
    zmmailbox -z -m account@domain.com getRestURL "//?fmt=tgz&start=20130102&end=20130319" > /tmp/archive-daterange.tgz
    I notice that the Preferences > Export page uses num milliseconds format. I suppose I could use that, but really I'd prefer something I can do without having to resort to a calculator every time.

    Also, bonus question. I assume I can also use the date ranges when I'm importing with postRestURL?

    And in case this helps someone out ... I initially had a full export fail as it got stuck at 5.1Gb. Didn't figure out what was happening until I logged into the admin webmail and saw a zillion messages telling me the disk had filled up. So, moral of the story is don't blindly follow examples which tell you to export into /tmp/output.tgz!

  2. #2
    Join Date
    Mar 2013
    Posts
    10
    Rep Power
    2

    Default

    Sorry, not an answer but a 'me too'. I've also not been able to get this working using explicit dates.

  3. #3
    Join Date
    Dec 2009
    Posts
    19
    Rep Power
    5

    Default

    Quote Originally Posted by plutocrat View Post
    Also, bonus question. I assume I can also use the date ranges when I'm importing with postRestURL?
    To answer my own question, no you can't limit the date ranges to import. If you dump an entire mailbox and then try to limit import with start=-1mon end=0day it imports the whole thing. Shame, this would be useful for testing.

    Also, in view of this, I'd love to get the date range thing working for export, so that I could dump mailboxes month by month to get smaller files.

    Jim

Similar Threads

  1. REST API: get email in eml format
    By mdesign in forum Developers
    Replies: 3
    Last Post: 07-01-2013, 02:57 AM
  2. Using REST API to get specific user emails by date.
    By TheAlfred in forum Developers
    Replies: 0
    Last Post: 06-27-2012, 10:50 AM
  3. Using REST API to get specific user emails by date.
    By TheAlfred in forum Developers
    Replies: 0
    Last Post: 06-27-2012, 10:33 AM
  4. UK Date format
    By MikeStewart in forum Administrators
    Replies: 7
    Last Post: 09-26-2007, 07:04 AM
  5. UK date format
    By jamesregional in forum I18N/L10N - Translations
    Replies: 14
    Last Post: 06-09-2006, 06:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •