Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
protogrid:api_endpoints [2021-12-02 10:57] – [/api/v2/apps/<app_name>/mailsend] dru | protogrid:api_endpoints [2021-12-20 15:37] – [/api/v2/apps/<app_name>/protos/<proto_key>/card-keys] dru | ||
---|---|---|---|
Line 143: | Line 143: | ||
* Example: limit=15 | * Example: limit=15 | ||
* Default value: 10 | * Default value: 10 | ||
- | * descending: If set to true the results will be in descending order. | + | * descending: If set to true the results will be in descending order. If set to true start_key and end_key must be exchanged. |
* Example: descending=true | * Example: descending=true | ||
* Default value: False | * Default value: False | ||
Line 152: | Line 152: | ||
| | ||
- | Note: you may only use either keys or start_key and end_key. | + | Please note: |
+ | * You may only use either | ||
+ | * Key values must be cut off after 300 characters (e. g. string values and sortstrings) because these values are also cut off in the view index. | ||
Details: For more details about the URL parameters see the [[http:// | Details: For more details about the URL parameters see the [[http:// | ||
Line 446: | Line 448: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
], | ], | ||
Line 454: | Line 458: | ||
==== / | ==== / | ||
- | [POST] Send an email using the provided data | + | [POST] Send an email |
- | The following JSON data fields | + | To be able to use this endpoint, the SMTP mail server of your organization must first be configured as the designated mail relay server in your Environment. If this has not been done yet, please contact [[protogrid-customer-support@ategra.ch|Protogrid Support]]. |
+ | |||
+ | Protogrid will fist try to establish a TLS session to the specified mail relay server and authenticate using the supplied credentials. If TLS is not available it will try to connect using SSL. Finally if SSL is not available the function tries to connect using unsecured SMTP protocol. | ||
+ | |||
+ | The mail will be sent according to the currently logged in user (mail address specified in user profile and the field "SMTP Server Password" | ||
+ | |||
+ | The following JSON data fields can be used: | ||
* to: TO addresses (Array of Strings, mandatory) | * to: TO addresses (Array of Strings, mandatory) | ||
* cc: CC addresses (Array of Strings) | * cc: CC addresses (Array of Strings) | ||
* bcc: BCC addresses (Array of Strings) | * bcc: BCC addresses (Array of Strings) | ||
- | * reply_to: ReplyTo addresses (Array of Strings), | + | * reply_to: ReplyTo addresses (Array of Strings) |
* from: From address if other than logged in user (String) | * from: From address if other than logged in user (String) | ||
- | * subject: Subject (String) | + | * subject: Subject (String, mandatory) |
* body_text_plain: | * body_text_plain: | ||
* body_text_html: | * body_text_html: | ||
Line 468: | Line 478: | ||
* attachments: | * attachments: | ||
- | Combinations of JSON data fields | + | Attachments |
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
- | The mail will be sent according | + | By default, users can send a mail to up to 10 recipients. This limit can be increased via the roles assigned |
- | + | ||
- | The function will fist try to establish | + | |
The returned result will include a success message or details about the particular error. | The returned result will include a success message or details about the particular error. | ||
- | |||
Example client-side jQuery request: | Example client-side jQuery request: | ||
Line 482: | Line 495: | ||
url: " | url: " | ||
data: JSON.stringify({ | data: JSON.stringify({ | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
{" | {" | ||
Line 503: | Line 516: | ||
</ | </ | ||
+ | As a response you receive a JSON with the following structure: | ||
+ | * errors [Array]: Contains information if no single email could be sent, otherwise it is empty. | ||
+ | * messages [Array]: Contains information if Protogrid could not establish the connection to the mail server with the most secure transport encryption, otherwise it is empty. | ||
+ | * result [Object]: Contains information regarding individual recipients to whom the email could not be delivered. If the email could be delivered to all recipients equals to { " | ||
- | Example | + | Example |
<code javascript> | <code javascript> | ||
{ | { | ||
- | | + | |
- | " | + | " |
- | "success": | + | [ |
- | } | + | " |
+ | " | ||
+ | ], | ||
+ | | ||
+ | | ||
+ | | ||
+ | [ | ||
+ | 554, | ||
+ | "5.7.1 < | ||
+ | ] | ||
+ | | ||
} | } | ||
</ | </ |