Send Mail

API Type

REST

HTTP Method

POST

Description

Sends an email through AgilePoint Server.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/SendMail

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/SendMail

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

Attachments

Definition:
File attachments included with the email.
Type
string
Allowed Values:
A valid path and file name on the AgilePoint Server.

This parameter must use a file path from the file system (for example, C:\file.txt) on the machine where AgilePoint Server is installed.

If there is no attachment, you can pass null or String.Empty.

Body

Definition:
Specifies the body portion of an email.
Type
string
Allowed Values:
Free text.

CC

Definition:
Specifies the CC portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

From

Definition:
Specifies the From portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

Subject

Definition:
The subject of an email.
Type
string
Allowed Values:
A single line of text.

To

Definition:
Specifies the To portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

These properties are based on the class SendMailHelper

JavaScript Code Example

$("#btnSendMail").click(function () {

  var JSONObject = { To: "susan.miller@mydomain.com",
    CC: null, 
    From: "susan.miller@mydomain.com",
    Subject: "REST Test App",
    Body: "REST Test App Body",
    Attachments: null
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/SendMail",
    data: JSON.stringify(JSONObject)
  });

});

Java Code Example

public String SendMail(String To, 
  String CC, String From, String Subject,
  String Body, String Attachments) {

  String URI = "http://mydomain:9011/AgilePointServer/Workflow/SendMail";

  HTTPOperations ops = new HTTPOperations(domain, this.userName,
                       password, appID, locale);

  JSONObject postData = new JSONObject();
  try {
    postData.put("To", To);
    postData.put("CC", CC);
    postData.put("From", From);
    postData.put("Subject", Subject);
    postData.put("Body", Body);
    postData.put("Attachments", Attachments);

    return ops.POSTMethod(URI, postData.toString());
  } catch (JSONException e1) {
    e1.printStackTrace();
  }
  return "";
}

C# Code Example

public string SendMail()
  {
    string URI = "http://mydomain:9011/AgilePointServer/Workflow/SendMail";

    string jsonRequestdata = "{
      \"To\":\"" + "milindg90@ymail.com" + "\",
      \"CC\":\"" + null + "\",
      \"From\":\"" + "milind.gunjan@agilepoint.com" + "\",
      \"Subject\":\"" + "milindg90" + "\",
      \"Body\":\"" + "com" + "\",
      \"Attachments\":\"" + null + "\"}";

    HTTPOperations ops = new HTTPOperations(domain, this.userName, 
                         password, appID, locale);

    return ops.POSTMethod(URI, "");
  }

Output

None.

JSON Response Body Example

{
  "Attachments":"String content",
  "Body":"String content",
  "CC":"String content",
  "From":"String content",
  "Subject":"String content",
  "To":"String content"
}

Supported Versions

AgilePoint BPMS v5.0 R2 and higher