Mail

Mail

Set of operations that allow the creation of a widget for managing messages and contacts from an address associated with SAPO

Free subscription

Technical Overview

Mail Service

This API allows to manage WebMail and Contact services, both available in the same endpoint: http://services.sapo.pt/Mail Therefore, it will be possible with this API to manage users mailbox and contacts.

API Reference

Service Operation Description
Mail AddContact Adds a contact to users list of contacts
DeleteContact Removes a contact from users list of contacts
GetComposeURL Get SAPO Webmail login link and redirect to compose window
GetContact Returns a contact from users list of contacts
GetLastMails Returns the last emails of users mailbox (seen, recent, answered, from, date, subject, size)
GetLoginURL Get SAPO Webmail login link
GetMailbox Returns status and last mails of users mailbox
GetMessageURL Return users webmail login token link to a given message id
GetStatus Returns status information of users mailbox (total, recent and unseen)
ListAllContacts Returns a list of information about contacts (ContactId, Name, Alias, Email, HomeAddress, WorkAddress, WorkPhone, CellPhone, Fax, Title, Company, Notes, PGPPublicKey, SMimePublicKey, FreeBusyURL)
SearchContacts Returns a list of contacts given a search expression
SetContact Updates a contact from users list of contacts

Mail Service

Operations

AddContact

Adds a contact to users list of contacts
Request Parameters
Contact : Contact (optional)
Response Parameters
AddContactResult : string (optional)
Go to top

DeleteContact

Removes a contact from users list of contacts
Request Parameters
ContactID : string (optional)
Response Parameters
DeleteContactResult : boolean (optional)
Go to top

GetComposeURL

Get SAPO Webmail login link and redirect to compose window
Request Parameters
site : string (required)
mailto : string (optional)
Response Parameters
GetComposeURLResult : string (required)
Go to top

GetContact

Returns a contact from users list of contacts
Request Parameters
ContactID : string (optional)
Response Parameters
GetContactResult : Contact (optional)
Go to top

GetLastMails

Returns the last emails of users mailbox (seen, recent, answered, from, date, subject, size)
Request Parameters
page : int (optional)
limit : int (optional)
site : string (optional)
Response Parameters
GetLastMailsResult : ArrayOfLastMail (optional)
Go to top

GetLoginURL

Get SAPO Webmail login link
Request Parameters
site : string (required)
mobile : boolean (optional)
Response Parameters
GetLoginURLResult : string (required)
Go to top

GetMailbox

Returns status and last mails of users mailbox
Request Parameters
page : int (optional)
limit : int (optional)
site : string (optional)
Response Parameters
GetMailboxResult : Mailbox (optional)
Go to top

GetMessageURL

Return users webmail login token link to a given message id
Request Parameters
site : string (required)
msgid : int (required)
Response Parameters
GetMessageURLResult : string (required)
Go to top

GetStatus

Returns status information of users mailbox (total, recent and unseen)
Request Parameters
site : string (optional)
Response Parameters
GetStatusResult : Status (optional)
Go to top

ListAllContacts

Returns a list of information about contacts (ContactId, Name, Alias, Email, HomeAddress, WorkAddress, WorkPhone, CellPhone, Fax, Title, Company, Notes, PGPPublicKey, SMimePublicKey, FreeBusyURL)
Response Parameters
ListAllContactsResult : ArrayOfContact (optional)
Go to top

SearchContacts

Returns a list of contacts given a search expression
Request Parameters
SearchExpression : string (optional)
Response Parameters
SearchContactsResult : ArrayOfContact (optional)
Go to top

SetContact

Updates a contact from users list of contacts
Request Parameters
ContactID : string (optional)
Contact : Contact (optional)
Response Parameters
SetContactResult : boolean (optional)
Go to top

Mail Entities

ArrayOfContact

Attribute Name Description
ContactInfo : ContactInfo
List of Contact : Contact
Go to top

ArrayOfLastMail

Attribute Name Description
PageInfo : PageInfo
List of LastMail : LastMail
Go to top

Contact

Attribute Name Description
ContactId : string
Name : string
Alias : string
Email : string
HomeAddress : string
WorkAddress : string
HomePhone : string
WorkPhone : string
CellPhone : string
Fax : string
Title : string
Company : string
Notes : string
PGPPublicKey : string
SMimePublicKey : string
FreeBusyURL : string
Go to top

ContactInfo

Attribute Name Description
RecordsCount : int
SearchExpression : string (optional)
Go to top

LastMail

Attribute Name Description
MessageId : int
FromName : string
FromEMail : string
Subject : string
Date : string
Size : int
Seen : boolean
Recent : boolean
Answered : boolean
Deleted : boolean
Flagged : boolean
Token : string (optional)
Go to top

Mailbox

Attribute Name Description
Status : Status
ArrayOfLastMail : ArrayOfLastMail
Go to top

PageInfo

Attribute Name Description
PageNumber : int
RecordsCount : int
MaxRecords : int
Go to top

Status

Attribute Name Description
Total : int
Unseen : int
Recent : int
Token : string (optional)
Go to top

SOAP API Authentication

Authenticating SOAP Request

Every request must contain authentication information to establish the identity of whom making the request and a autorization token called ESB Access Key.

ESB Access Key

Correct with the path to the access key

The ESB Access Key is what will authorize the usage of the API and is available when the buying process ends. In the costumer area you can find the product details where you can generate an ESB Access Key for you usage, another user registered on SAPO Services or even for everyone.

The element ESBAccessKey must appear on the message SOAP Header after the complex type ESBCredentials

Example:

ESBCredentials

ESBCredentials is a complex type that is used to pass the credentials in order to authenticate a SOAP request.

Request with username and password
Elements Description
ESBUsername The e-mail of the account that is used to access the API
ESBPassword The password that in combination with the ESBUsername is used to access the corresponding account

Example:

Request with ESBToken

Using a token instead of your username and password can be useful if you don't want to give your credentials to whom is using the API.

In order to generate a ESB Token you must use SAPO Security Token Service (STS). The ESBtoken is valid for 12 hours.

Requesting with an ESBtoken
Go to top