Inbox

We'll assume you've already got the API authentication settled and you have our API token with you.

In this area we will tell you how to list list your own emails in inbox.

 

List emails in inbox #

By making GET request to the /api/inbox endpoint, you can list all sent mails in your account.

curl https://privasfer.com/api/inbox \
    -H 'Authorization: Bearer 7xcB5XlinBWGzajPdSW7bHr12erWZICIJN4jk0RpasoLYLpoiD6ErYnVSzld' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

As a result, you get the details for every email in your inbox.

{
    "data": [
        {
            "id": "2ef14b84-87d0-4abb-813f-2351a4251345",
            "identifier": "1Kh2",
            "subject": "Secure files",
            "body": "<p>Mail body</p>",
            "sender": {
                "name": "Sender Name",
                "email": "sender@email.address"
            },
            "received_at": "2019-05-15 14:11:00",
            "opened": true
        }

        // ...
    ]
}

Read more about returned properties here.

Extra parameters #

name value description
include download, download.files, author Include mail related data. Example: /api/inbox?include=download,download.files
sort subject, created_by_email, received_at Include category object. Example: /api/inbox?sort=subject to make reverse sorting use negative value /api/inbox?sort=-subject
keyword search keyword Perform search in identifier, subject, created_by_email and created_by_name fields by given value. Example: /api/inbox?keyword=test

 

Get a specific mail in inbox via the API #

If you want to get specific mail in inbox, you can specify file ID in endpoint. The example below will get the details of sent mail ID 2ef14b84-87d0-4abb-813f-2351a4251345.

curl https://privasfer.com/api/inbox/2ef14b84-87d0-4abb-813f-2351a4251345 \
    -H 'Authorization: Bearer 7xcB5XlinBWGzajPdSW7bHr12erWZICIJN4jk0RpasoLYLpoiD6ErYnVSzld' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

Single inbox mail payload.

{
    "data": {
            "id": "2ef14b84-87d0-4abb-813f-2351a4251345",
            "identifier": "1Kh2",
            "subject": "Secure files",
            "body": "<p>Mail body</p>",
            "sender": {
                "name": "Sender Name",
                "email": "sender@email.address"
            },
            "received_at": "2019-05-15 14:11:00",
            "opened": true
        }
}

Return properties #

  • id: an internal identifier.
  • identifier: unique email identifier.
  • subject: email subject.
  • body: email body. As you can see, body could be plain text of html.
  • sender: user name and email, who created and send this email.
  • received_at: date ant time when mail was received.
  • opened: specifies that mail has been opened.