{
  "notice": {
    "n0": "This file is produced by CirrusWave line of products and platform.",
    "n1": "By producing this file and using this product you are agreeing to the terms and conditions outlined in the CirrusWave Enterprise License",
    "n2": "Please make sure that you read CirrusWave license at https://www.cirruswave.com/eula.html"
  },
  "loglevel": "trace",
  "servicename": "email",
  "routes": [
    {
      "route": "/images",
      "type": "static",
      "configured": true,
      "routeclass": "./images",
      "description": "app specific images are served from the directory ./images under "
    },
    {
      "route": "/email/v1/mailboxes",
      "type": "get",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "getEmailV1Mailboxes",
      "description": "get method for route /email/v1/mailboxes",
      "examples": [
        {
          "param": "/email/v1/mailboxes"
        }
      ]
    },
    {
      "route": "/email/v1/mailboxes/",
      "type": "post",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "postEmailV1Mailboxes",
      "description": "post method for route /email/v1/mailboxes/:mailboxesid/messages",
      "bodyschema": {
        "type": "object",
        "required": [
          "to",
          "subject"
        ],
        "oneOf": [
          {
            "required": [
              "text"
            ]
          },
          {
            "required": [
              "html"
            ]
          }
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "cc": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "examples": [
        {
          "param": "/email/v1/mailboxes",
          "payload": {
            "to": "phansr phani@cirruswave.com",
            "cc": "phani phani@cirruswave.com",
            "subject": "mail with no from address",
            "html": "<p><b>Testing</b> with from <i>missing</i></p><p>end of paragraph</>"
          }
        },
        {
          "param": "/email/v1/mailboxes",
          "payload": {
            "from": "bpvcube <b.pvcube@gmail.com>",
            "to": "vish vish@cirruswave.com",
            "cc": "phani phani@cirruswave.com",
            "subject": "PWC-CW ppt",
            "text": "Hi Phani, This email is sent from email service to you - also this one has a pwc presentation. Check it out",
            "attachments": [
              {
                "filename": "PwC-CirrusWave.pptx",
                "path": "./PwC-CirrusWave.pptx"
              }
            ]
          }
        },
        {
          "param": "/email/v1/mailboxes",
          "payload": {
            "from": "bpvcube <b.pvcube@gmail.com>",
            "to": "phani@cirruswave.com",
            "subject": "PWC-CW ppt",
            "text": "Hi Phani, This email is sent from email service to you - also this one has a pwc presentation. Check it out",
            "attachments": [
              {
                "filename": "PwC-CirrusWave.pptx",
                "path": "/Users/phani/imapservice/imapread/PwC-CirrusWave.pptx"
              }
            ]
          }
        }
      ]
    },
    {
      "route": "/email/v1/mailboxes/:mailboxesid",
      "type": "get",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "getEmailV1MailboxesMailboxesid",
      "description": "Gets messages from start to end in sequence. If start and end are not given gets the first 20 messages.",
      "paramschema": {
        "additionalProperties": false,
        "type": "object",
        "required": [
          "mailboxesid",
          "start",
          "count"
        ],
        "properties": {
          "mailboxesid": {
            "description": "value for mailboxesid",
            "type": "string"
          },
          "start": {
            "description": "Fetch message from start as per message number sequence(msn). If positive fetch next count messsage from start and if negative will fetch from end previous count messages, if start is 0, treated as 1",
            "type": "integer"
          },
          "count": {
            "description": "number of messages to fetch from start. if 0 don't fetch messages",
            "type": "intger",
            "minnimum": 0
          }
        }
      },
      "examples": [
        {
          "param": "/email/v1/mailboxes/INBOX?start=1&count=5"
        },
        {
          "param": "/email/v1/mailboxes/INBOX?start=1&count=5&start1=foo"
        },
        {
          "param": "/email/v1/mailboxes/INBOX?start=-1&count=5"
        }
      ]
    },
    {
      "route": "/email/v1/mailboxes/:mailboxesid/search",
      "type": "get",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "getEmailV1MailboxesMailboxesidSearch",
      "description": "search mailbox for criteria",
      "paramschema": {
        "type": "object",
        "required": [
          "name",
          "value",
          "filter"
        ],
        "properties": {
          "name": {
            "description": "value for name",
            "type": {
              "enum": [
                "SUBJECT",
                "SINCE",
                "BEFORE",
                "ON",
                "SENTBEFORE",
                "SENTON",
                "SENTSINCE",
                "FROM",
                "TO",
                "CC",
                "BCC"
              ]
            }
          },
          "value": {
            "description": "value for value",
            "type": "string"
          },
          "filter": {
            "description": "value for filter",
            "type": {
              "enum": [
                "ALL",
                "ANSWERED",
                "DELETED",
                "DRAFT",
                "FLAGGED",
                "NEW",
                "SEEN",
                "RECENT",
                "OLD",
                "UNANSWERED",
                "UNDELETED",
                "UNDRAFT",
                "UNFLAGGED",
                "UNSEEN"
              ]
            }
          },
          "fetchattachments": {
            "type": "boolean",
            "description": "fetch attachments and store them in the storage given in initoptions"
          },
          "maxresults": {
            "type": "integer",
            "description": "maximum number of results to fetch. Has to be at least 1",
            "minimum": 1
          }
        }
      },
      "examples": [
        {
          "param": "/email/v1/mailboxes/INBOX/search/?filter=ALL&name=SUBJECT&value=cirruswave.ppt"
        },
        {
          "param": "/email/v1/mailboxes/INBOX/search/?filter=ALL&name=SINCE&value=Mar 20, 2020"
        },
        {
          "param": "/email/v1/mailboxes/INBOX/search/?filter=UNSEEN&name=SINCE&value=Mar 20, 2020&fetchattachments=true&maxresults=2"
        }
      ]
    },
    {
      "route": "/email/v1/mailboxes/:mailboxesid/messages",
      "type": "get",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "getEmailV1MailboxesMailboxesidMessages",
      "description": "get method for route /email/v1/mailboxes/:mailboxesid/messages",
      "paramschema": {
        "type": "object",
        "required": [
          "mailboxesid"
        ],
        "properties": {
          "mailboxesid": {
            "description": "value for mailboxesid",
            "type": "string"
          },
          "fetchattachments": {
            "type": "boolean",
            "description": "fetch attachments and store them in the storage given in initoptions"
          }
        }
      },
      "examples": [
        {
          "param": "/email/v1/mailboxes/INBOX/messages"
        },
        {
          "param": "/email/v1/mailboxes/INBOX/messages?fetchattachments=true"
        }
      ]
    },
    {
      "route": "/email/v1/mailboxes/:mailboxesid/messages/:messagesid",
      "type": "get",
      "configured": true,
      "routeclass": "email.js",
      "routefunction": "getEmailV1MailboxesMailboxesidMessagesMessagesid",
      "description": "get method for route /email/v1/mailboxes/:mailboxesid/messages/:messagesid",
      "paramschema": {
        "type": "object",
        "required": [
          "mailboxesid",
          "messagesid"
        ],
        "properties": {
          "mailboxesid": {
            "description": "value for mailboxesid",
            "type": "string"
          },
          "messagesid": {
            "description": "value for messagesid",
            "type": "integer"
          },
          "fetchattachments": {
            "type": "boolean",
            "description": "fetch attachments and store them in the storage given in initoptions"
          }
        }
      },
      "examples": [
        {
          "param": "/email/v1/mailboxes/INBOX/messages/1"
        },
        {
          "param": "/email/v1/mailboxes/INBOX/messages/2"
        },
        {
          "param": "/email/v1/mailboxes/INBOX/messages/2?fetchattachments=true"
        }
      ]
    }
  ]
}