User Tools

Site Tools


api:mailbox:list

API : Mailbox List

Introduction

This request will return the list of mailbox messages in the in- or out-box.

The inbox contains all system received e-mails and faxes that has not been automatically assigned.

The outbox contains all e-mails and faxes that are about to be sent or has been sent within the last 6 months.

Request

URL https://api.telecomx.dk/mailbox
Method GET
Access level RESELLER_ADMIN with PORTING feature.
Query offset [optional] Index of the first message to return, default 0.
limit [optional] The number of messages to return, default 100, min 1, max 500.
mailbox Mailbox to use: 'IN' for received messages or 'OUT' for messages waiting to be sent, 'SENT' for messages that has been sent.
from If mailbox='IN' this specifies an e-mail address or fax number the messages should be received from, to be included in the result.
to If mailbox='OUT' this specifies an e-mail address or fax number the messages should be sent to, to be included in the result.

Query examples

https://api.telecomx.dk/mailbox?mailbox=IN&from=+4570305051
https://api.telecomx.dk/mailbox?mailbox=IN&from=+4570305051
https://api.telecomx.dk/mailbox?mailbox=OUT&to=donald@duck.com
https://api.telecomx.dk/mailbox

Response

JSON object
offset Index of the first message returned.
limit Number of messages to return. Note that the actual number of messages returned may be lower.
total Number of messages that can be returned when offset and limit is not considered. This is to be used for paging through the data.
mails Array of messages, see definition below.
Mail message object if mailbox='IN' (JSON)
_id Id Unique id of message.
received Date Date and time when the message was received.
from String If the message is an e-mail, then the e-mail address of the sender.
If the message is a fax, then the phone number it was sent from.
fromName String If the message is an e-mail, then the name of the sender.
subject String If the message is an e-mail then the e-mail subject. If the message is an e-mail and a PDF is attached which contains a porting QRCode or it's a fax PDF which contains a porting QRCode, and it was not automatically linked to a porting, then this is the QRCode found.
message String If the message is an e-mail, then this is the body of the mail in HTML or plaintext if HTML is not available.
files Number The number of attachments to the e-mail or number of pages in the fax.
Mail message object if mailbox='OUT' (JSON)
_id Id Unique id of the message.
queued Date Date and time when it was queued for transmission.
to String If the message is an e-mail, then the e-mail address to send it to.
If the message is a fax then the fax number to send it to.
toName String If the message is an e-mail, then this is the name of the recipient (if set).
subject String If the message is an e-mail, then this is the subject.
message String If the message is an e-mail, then this is the body of the mail.
files Number Number of documents to send (attachments if e-mail or pages if fax).
deleteFiles Boolean If true then files attached or faxes will be deleted after transmission.
status String Status of the transmission: NEW, SENDING, RETRYING, SENT, CANCELLED.
when Date Date and time the e-mail or fax was sent.

Note that properties holding no value may be omitted from the object.

Example - mailbox='IN'

{
  offset: 10,
  limit: 15,
  total: 25,
  mails:
  [
    {
      _id: '123457890ABCDEF12345678',
      received: '2014-01-01T12:34:56.789Z',
      from: 'donald@duck.com',
      subject: 'Network drawing',
      message: '....mailbody....',
      files: 2
    },
    {
      ...
    }
  ]
}

Example - mailbox='OUT'

{
  offset: 10,
  limit: 15,
  total: 25,
  mails:
  [
    {
      _id: '1234567890ABCDEF12345678',
      queued: '2014-01-01T12:34:56.789Z',
      to: 'donald@duck.com',
      toName: 'Donald Duck',
      subject: 'Porting documents to sign',
      message: '..... messagebody .....',
      files: 4,
      deleteFiles: false,
      status: 'SENDING',
      when: null
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/mailbox/list.txt · Last modified: 2023/10/30 14:02 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki