MassNotification
Add a new MassUserNotification
POST/api/notification/mass_notification
Request body application/json
dataMassUserNotificationShow fields (16)
send_pushbooleanWhether push notifications should be sent.
send_mailbooleanWhether e-mails should be sent.
send_letterbooleanWhether letters should be sent.
send_smsbooleanWhether SMS messages should be sent.
send_whatsappbooleanWhether WhatsApp messages should be sent.
reference_class_namestringClass name of the records the notification refers to.
reference_idsarray<string>IDs of the records the notification refers to.
textstringThe headline of the notification
long_textstringThe text of the notification
html_textstringThe html text of the notification, overrides the long text
attachmentsarray<Attachment12>Attachments of the mass notification.
templateFlexibleLatexTemplate3Template used for the mass notification.
save_as_attachmentbooleanWhether the notification is saved as an attachment.
check_for_duplicatesbooleanWhether duplicate recipients are checked.
create_questionnaire_draftbooleanIf true, a MediaQuestionnaireAnswer draft is created (or reused) for each referenced BaseEventSignUp recipient, and its fill link is exposed as a template placeholder.
questionnaire_draft_questionnaireMediaQuestionnaire3The result-list questionnaire the per-recipient drafts are created for.
Responses
200Add a new MassUserNotificationMassUserNotification2
Show fields (20)
idintegerPrimary key of the mass notification. Internal ID.
processedbooleanWhether the mass notification has been processed.
send_pushbooleanWhether push notifications should be sent.
send_mailbooleanWhether e-mails should be sent.
send_letterbooleanWhether letters should be sent.
send_smsbooleanWhether SMS messages should be sent.
send_whatsappbooleanWhether WhatsApp messages should be sent.
reference_class_namestringClass name of the records the notification refers to.
reference_idsarray<string>IDs of the records the notification refers to.
textstringThe headline of the notification
long_textstringThe text of the notification
html_textstringThe html text of the notification, overrides the long text
attachmentsarray<Attachment22>Attachments of the mass notification.
Show fields (26)
idintegerPrimary key of the attachment. Internal ID.
filenamestringOriginal file name.
filesizestringSize of the file in bytes.
mimetypestringMIME type of the file.
createdbyusernamestringName of the user who uploaded the file, as text.
createdstring (date-time)Point in time the attachment was created.
googleidstringID of the file in Google Drive.
googledownloadlinkstringDownload link of the file in Google Drive.
scopestringScope that controls who can see the attachment.
ocr_document_typestringDocument type recognized by OCR.
ocr_from_namestringSender name recognized by OCR.
ocr_from_companystringSender company recognized by OCR.
ocr_from_addressstringSender address recognized by OCR.
ocr_from_emailstringSender e-mail address recognized by OCR.
ocr_from_phonestringSender phone number recognized by OCR.
ocr_to_namestringRecipient name recognized by OCR.
ocr_to_companystringRecipient company recognized by OCR.
ocr_to_addressstringRecipient address recognized by OCR.
ocr_to_emailstringRecipient e-mail address recognized by OCR.
ocr_to_phonestringRecipient phone number recognized by OCR.
ocr_summarystringSummary of the document created by OCR.
ocr_statusstringOCR processing status: null=not processed, pending, processing, done, error
ocr_errorstringReason of the last failed or incomplete OCR run, null when it went through
ocr_processed_atstring (date-time)Point in time OCR processing finished.
virus_checkedboolean1 once the virus scan has passed for this file. The scan runs in the background (AttachmentVirusScanCommand), so a freshly uploaded file starts at 0 and stays there until it was really checked. An infected file never reaches 1 - it is deleted instead. UIs use this to decide whether a file may be handed to a user, so it must stay false until proven otherwise.
virus_checked_atstring (date-time)When the virus scan passed. Null while the file is still waiting.
templateFlexibleLatexTemplateTemplate used for the mass notification.
Show fields (35)
predefinedbooleanTrue for templates shipped by the servercontrolpanel (PredefinedFlexibleTemplateMap). Their IDs are referenced by code, so the UI offers to duplicate ("Vorlage anpassen") instead of editing them.
data_typestringData type (reference class key) the template is rendered and checked with. For predefined templates (tag IW_PFLT) this is the data type of the code that uses them.
data_type_labelstringHuman readable name of the assigned data type, null for tags that are not a known data type.
template_modestringSerialized mode so clients do not have to know that null means standard.
last_check_statusstringSummary of the last template check for list views, the full result is admin detail only.
idstringPrimary key of the template. Internal ID. Used as a string identifier.
namestringName of the template.
tagstringTag used to group templates.
mass_messagebooleanWhether the template is used for mass messages.
default_store_as_pdfbooleanWhether the generated document is stored as PDF by default.
security_scopestringScope that controls who can use the template.
security_user_access_typeintegerAccess type required to use the template.
param1stringValue of parameter 1 used in the template.
param2stringValue of parameter 2 used in the template.
param3stringValue of parameter 3 used in the template.
param4stringValue of parameter 4 used in the template.
param5stringValue of parameter 5 used in the template.
param6stringValue of parameter 6 used in the template.
param7stringValue of parameter 7 used in the template.
param8stringValue of parameter 8 used in the template.
param9stringValue of parameter 9 used in the template.
param10stringValue of parameter 10 used in the template.
default_value_param1stringDefault value of parameter 1.
default_value_param2stringDefault value of parameter 2.
default_value_param3stringDefault value of parameter 3.
default_value_param4stringDefault value of parameter 4.
default_value_param5stringDefault value of parameter 5.
default_value_param6stringDefault value of parameter 6.
default_value_param7stringDefault value of parameter 7.
default_value_param8stringDefault value of parameter 8.
default_value_param9stringDefault value of parameter 9.
default_value_param10stringDefault value of parameter 10.
deletedbooleanThis property is used to mark an entity as deleted / archived
createdstring (date-time)Point in time the entity was created.
updatedstring (date-time)Point in time the entity was last updated.
save_as_attachmentbooleanWhether the notification is saved as an attachment.
check_for_duplicatesbooleanWhether duplicate recipients are checked.
create_questionnaire_draftbooleanIf true, a MediaQuestionnaireAnswer draft is created (or reused) for each referenced BaseEventSignUp recipient, and its fill link is exposed as a template placeholder.
questionnaire_draft_questionnaireMediaQuestionnaireThe result-list questionnaire the per-recipient drafts are created for.
Show fields (34)
idintegerPrimary key of the questionnaire. Internal ID.
questionnaire_typestringType of the questionnaire, for example registration or survey.
tokenstringPublic token of the questionnaire. Used instead of the ID.
public_copyrightstringCopyright text shown with the questionnaire.
public_language_codestringLanguage of the questionnaire, for example de.
complexity_levelintegerComplexity level of the questionnaire.
public_authorstringAuthor shown to the public.
show_free_textbooleanShow a free text field.
show_attachmentbooleanShow an upload field for attachments.
require_attachmentbooleanAn attachment must be uploaded.
with_paginationbooleanShow the questionnaire page by page.
one_entry_per_personbooleanIf true, only one entry per person is allowed - only for logged-in users and table results
require_addressbooleanThe address must be entered.
require_contactbooleanContact details must be entered.
require_agebooleanThe age must be entered.
require_grade_levelbooleanThe school grade level must be entered.
start_timestring (date-time)Start of the availability of the questionnaire.
end_timestring (date-time)End of the availability of the questionnaire.
age_groupstringAge group the questionnaire is intended for.
min_ageintegerMinimum age in years.
max_ageintegerMaximum age in years.
min_grade_levelintegerMinimum school grade level.
max_grade_levelintegerMaximum school grade level.
age_toleranceintegerYears by which the age may be outside the range and still be accepted.
group_allowedbooleanWhether the questionnaire is limited to a group.
allow_self_registerbooleanWhether people can register themselves to answer the questionnaire.
allow_self_download_result_templatebooleanWhether answerers can download their own result.
clarification_enabledbooleanSecond loop after the AI comparison: answers the AI does not rate as fulfilled become clarification points (MediaQuestionnaireClarification) that are discussed with the customer and decided before the result template is created. Without it the result template follows the AI comparison directly.
createdstring (date-time)Point in time the entity was created.
updatedstring (date-time)Point in time the entity was last updated.
deletedbooleanThis property is used to mark an entity as deleted / archived
image_urlstringURL of the image of the entity.
namestringName of the entity.
slug_identifierstringSlug used in URLs of the entity.
createdstring (date-time)Point in time the entity was created.
updatedstring (date-time)Point in time the entity was last updated.
curl --request POST \
--url https://your-instance.iw-erp.de/api/notification/mass_notification \
--header 'content-type: application/json' \
--header 'x-iw-jwt-token: <TOKEN>' \
--data '
{
"data": {
"send_mail": true,
"reference_class_name": "Beispiel",
"text": "Text",
"long_text": "Text",
"html_text": "Text",
"send_push": true
}
}
'const options = {
method: 'POST',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({
data: {
send_mail: true,
reference_class_name: 'Beispiel',
text: 'Text',
long_text: 'Text',
html_text: 'Text',
send_push: true
}
})
};
fetch('https://your-instance.iw-erp.de/api/notification/mass_notification', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/notification/mass_notification"
payload = { "data": {
"send_mail": True,
"reference_class_name": "Beispiel",
"text": "Text",
"long_text": "Text",
"html_text": "Text",
"send_push": True
} }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-instance.iw-erp.de/api/notification/mass_notification', [
'body' => '{"data":{"send_mail":true,"reference_class_name":"Beispiel","text":"Text","long_text":"Text","html_text":"Text","send_push":true}}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/notification/mass_notification"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"data\":{\"send_mail\":true,\"reference_class_name\":\"Beispiel\",\"text\":\"Text\",\"long_text\":\"Text\",\"html_text\":\"Text\",\"send_push\":true}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"send_mail\":true,\"reference_class_name\":\"Beispiel\",\"text\":\"Text\",\"long_text\":\"Text\",\"html_text\":\"Text\",\"send_push\":true}}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/notification/mass_notification")
.post(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/notification/mass_notification"
payload := strings.NewReader("{\"data\":{\"send_mail\":true,\"reference_class_name\":\"Beispiel\",\"text\":\"Text\",\"long_text\":\"Text\",\"html_text\":\"Text\",\"send_push\":true}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/mass_notification_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
import 'package:iw_erp_api/model/mass_notification.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await MassNotificationController.post(MassNotification.fromJson({
"send_mail": true,
"reference_class_name": "Beispiel",
"text": "Text",
"long_text": "Text",
"html_text": "Text",
"send_push": true
}));
if (result.success) {
print(result.data);
}{
"id": 42,
"send_mail": true,
"reference_class_name": "Beispiel",
"text": "Text",
"long_text": "Text",
"html_text": "Text",
"processed": true,
"send_push": true,
"send_letter": true,
"send_sms": true
}Get a list of SimpleReference
GET/api/notification/mass_notification/simple_references
Query parameters
classNamerequiredstring | The className to get the references for. e.g. person |
Responses
200Get a list of SimpleReferencearray<SimpleReference>
Show fields (3)
class_namestringidstringnamestring
curl --request GET \
--url 'https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string' \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/notification/mass_notification/simple_references?className=string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/mass_notification_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await MassNotificationController.getSimpleReferences();
if (result.success) {
print(result.data);
}[
{
"class_name": "Beispiel",
"id": "42",
"name": "Beispiel"
}
]Return the list of Twig placeholders available for a given reference class or for one of the settings backed mail templates. Used by the template editor / mass-notification editor and by the mail template settings screens to power click-to-insert chips.
GET/api/notification/mass_notification/placeholders
Exactly one of className / templateKey has to be given.
Query parameters
classNamestring | FQCN or short name of the reference class (e.g. 'CRMPerson' or full FQCN). |
templateKeystring | Settings key of a mail template (e.g. 'templates_mail_ticket_created_txt_twig'). |
Responses
default
curl --request GET \
--url https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/notification/mass_notification/placeholders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/mass_notification_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await MassNotificationController.getPlaceholders();
if (result.success) {
print(result.data);
}