Child pages
  • SendEmail
Skip to end of metadata
Go to start of metadata

Description


The SendEmail API allows the Account Owner to send email messages, with attachments if desired. Typically, this API will be used from a server script. For enhanced security, the "from" address of any email message must be either the account owner's email address or the current user's email address.

Specific Request Parameters

(Refer to Common Request Parameters)

Name

Description

Required

Default

Possible Values

apsma.from

The sender email address e.g., john.smith@apstrata.com

No

 

Limited to the account owner address or the address of the current request user

apsma.to

The recipient(s) email addresses

 

 

 

apsma.cc

The CC recipient(s) email addresses

 

 

 

apsma.bcc

The BCC recipient(s) email addresses

 

 

 

apsma.replyTo

The reply to email address

 

 

 

apsma.senderNameThe name of the sender e.g., John Smith   

apsma.subject

The email subject

 

 

 

apsma.body

The email body to send in content type text/plain

 

 

 

apsma.htmlBody

The email body to send as content type text/html. If both apsma.body as well as this parameter are set, apsma.body will be ignored.

 

 

 

apsma.attachment.[attachmentNumber].type

The type of this file attachment (inline/document)

 

 

inline,
document

apsma.attachment.[attachmentNumber].file

File attachment to be sent with the email

 

 

 

apsma.attachment.[attachmentNumber].fileName

For 'inline' attachment type: The name of the file to be sent in the email. This does not have to be the original file nam
For 'document' attachment type: The name of the file in the apstrata database document field

 

 

 

apsma.attachment.[attachmentNumber].store

The store name from which to get the file

 

 

 

apsma.attachment.[attachmentNumber].documentKey

The universally unique document identifier

 

 

 

apsma.attachment.[attachmentNumber].fieldName

The name of the field, of type file, whose file is to be attached

 

 

 

apsdb.authTokenThis parameter is used to sign the request with a token that was initially obtained by calling VerifyCredentials  API. For more details on signing requests, please refer to the page entitled Authentication .No  

Specific Response Elements

(Refer to Common Response Elements)

Specific Logical Errors

(Refer to Common Logical Error Codes)

Error

Message

Status Code

RECIPIENTS_REQUIRED

One or more recipients are required in either the TO, CC, or BCC fields.

404

FROM_FIELD_REQUIRED

The request is missing the apsma.from required parameter.

404

INVALID_EMAIL_ADDRESS

Email [] is invalid.

400

FROM_FIELD_REQUIRED

The request is missing the apsma.from required parameter.

400

INVALID_FROM_FIELD

The apsma.from value [] is not a valid email address.

400

INVALID_FROM_FIELD

The apsma.from field must be the email of the account owner or the current user. Both of them do not have registered emails.

400

INVALID_FROM_FIELD

The apsma.from field must be the email of the account owner or the current user.

400

INVALID_PARAMETER

The parameter [apsma.from] is not allowed in REST requests for the SendEmail API. It is required from scripts only.

400

INVALID_USER_EMAIL

The email of the current user is invalid. Please register it.

400

INVALID_USER_EMAIL

The email of the account owner is invalid. Please register it.

400

INVALID_USER_EMAIL

The user's email [] is not a valid email address.

400

INVALID_TO_FIELD

The apsma.to value [] is not a valid email address.

400

INVALID_CC_FIELD

The apsma.cc value [] is not a valid email address.

400

INVALID_BCC_FIELD

The apsma.bcc value [] is not a valid email address.

400

MAX_ATTACHMENTS_NUMBER_EXCEEDED

The attachment number [] exceeds the maximum permitted value of [].

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.file].

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.file]. Exactly one file may be sent per attachment. Multiple attachments may be sent by specifying different attachments.

400

INVALID_PARAMETER

An attachment of type [inline] must not provide the apsma.attachment.#.store field.

400

INVALID_PARAMETER

An attachment of type [inline] must not provide the apsma.attachment.#.documentKey field.

400

INVALID_PARAMETER

An attachment of type [inline] must not provide the apsma.attachment.#.fieldName field.

400

INVALID_PARAMETER

An attachment of type [document] must not provide the file field.

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.store].

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.documentKey].

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.fieldName].

400

PARAMETER_REQUIRED

Missing required parameter [apsma.attachment.#.fileName].

400

INVALID_DOCUMENT_KEY

 

400

INVALID_ATTACHMENT_TYPE

The attachment type [] is invalid. It must be either [inline] or [document].

400

INVALID_ATTACHMENT_NUMBERS

The request must contain apsma.attachment.#.type. Attachments must be contiguous, i.e. 1, 2, 3 rather than: 1, 4, 7.

400

MAX_BODY_SIZE_EXCEEDED

The body size [] is larger than the maximum allowed size [].

400

MAX_ATTACHMENTS_EXCEEDED

Maximum number of attachments in an email [] has been exceeded.

400

MAX_ATTACHMENTS_SIZE_EXCEEDED

Maximum size of all attachments in an email [] has been exceeded.

400

FILE_NOT_FOUND

Could not read the requested file [].

400

MAX_ATTACHMENTS_SIZE_EXCEEDED

Maximum attachments size [] bytes per email has been exceeded.

400

MAX_RECIPIENTS_NUMBER_EXCEEDED

The recipients number [] exceeds the maximum permitted value of [].

400

INVALID_REPLY_TO_FIELD

The apsma.replyTo value [] is not a valid email address.

400

DOCUMENT_NOT_FOUND

Document with key [] was not found.

400

NOT_A_FILE

The requested field [] is not a file field.

400

INVALID_FILE_NAME

 

400

HOURLY_EMAILS_SIZE_EXCEEDED

The maximum allowed number of emails per hour [] has been exceeded.

400

HOURLY_ATTACHMENTS_SIZE_EXCEEDED

The maximum allowed size of attachments per hour [] has been exceeded.

400

DAILY_EMAILS_SIZE_EXCEEDED

The maximum allowed number of emails per day [] has been exceeded.

400

DAILY_ATTACHMENTS_SIZE_EXCEEDED

The maximum allowed size of attachments per day [] has been exceeded.

400

Examples

Sample Request

Request URL: http://sandbox.apstrata.com/apsdb/rest/[AuthenticationKey]/SendEmail?apsws.time=[timestamp]&apsws.authSig=[signature]



POST parameters:

apsma.from=sami.lopez@lodos.com
apsma.to=karmen@bottleneck.com
apsma.cc=frankApo@bottleneck.com
apsma.bcc=erica.fattoum@lodos.com
apsma.subject=[subject_as_text]
apsma.body=[body_as_text]



Sample XML Response

Success XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata>
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>success</status>        
    </metadata>
</response>



Failure XML:

<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd">
    <metadata>
        <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId>
        <status>failure</status>
        <errorCode>[errorCode]</errorCode>
        <errorMessage>[failMsg]</errorMessage>
    </metadata>
</response>



Sample JSON Response

{"response": {
  "metadata": {
    "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "status": "success"
  }
}} 


 

 

  • No labels