We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Export emails from Rest api

I'm trying to export emails from the  REST api. 

 

I've used following endpoint

GET Document/{id}/Content

Accept: application/octet-stream

 

I just get text and a lot of server info and stuff so it will be hard to programmatically format the mail. Is there a way to export the emails as JSON-format?

RE: Export emails from Rest api

   GET /api/v1/document/123/content

   Accept: application/json

 

This will return the document content as a base64 encoded string.

 

But you probably meant: "can I get the e-mail as a JSON structured object, with Subject, To, Cc, Body as properties I can wrangle?"

No - not from the Document endpoint.

Av: Christian Mogensen 3. feb 2020

RE: Export emails from Rest api

HI Anders,

We do not support converting the content of an email from one format to another.

What's the format of the original email? If it is already json, of course you can request that content-type. Target that the content-type you want in the Accept header. 

 

If what you really want are the document properties in JSON format, then 

GET .../v1/Document/5
Accept: application/json

Best regards.

Av: Tony Yates 3. feb 2020

RE: Export emails from Rest api

Christian is there any other way to export the emails?

Tony, the mails that I need to export are sent via Superoffice and I need to be able to separate "sent to/from", "cc", "bcc", "subject" and "body/content"

Av: Anders Nyström 3. feb 2020

RE: Export emails from Rest api

Hello,

If the email's are saved in SuperOffice using Maillink they are saved as MSG, The integrated inbox saves email as .somail.

If you just want the metadata of an email saved in SuperOffice, you could use the GetEMailFromDocumentIdWithoutAttachmentStream method from the EmailAgent

Note: the EmailAgent is restricted in SuperOffice online.

Edit, can't link to the method from some reason, link is: https://community.superoffice.com/documentation/sdk/SO.NetServer.Web.Services/html/v1EMailAgent_GetEMailFromDocumentIdWithoutAttachmentStream.htm

Av: David Hollegien 3. feb 2020