This imports an e-mail to a participant.
curl -X POST "https://api.example.com/restapi/v1/mail/participant/123" \
-H "Content-Type: application/json" \
-d '{
"subject": "example_string",
"mailBody": "example_string",
"cid": 123,
"mailFrom": "example_string",
"mailTo": "example_string"
}'
import requests
import json
url = "https://api.example.com/restapi/v1/mail/participant/123"
headers = {
"Content-Type": "application/json"
}
data = {
"subject": "example_string",
"mailBody": "example_string",
"cid": 123,
"mailFrom": "example_string",
"mailTo": "example_string"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/restapi/v1/mail/participant/123", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"subject": "example_string",
"mailBody": "example_string",
"cid": 123,
"mailFrom": "example_string",
"mailTo": "example_string"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"subject": "example_string",
"mailBody": "example_string",
"cid": 123,
"mailFrom": "example_string",
"mailTo": "example_string"
}`)
req, err := http.NewRequest("POST", "https://api.example.com/restapi/v1/mail/participant/123", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/restapi/v1/mail/participant/123')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"subject": "example_string",
"mailBody": "example_string",
"cid": 123,
"mailFrom": "example_string",
"mailTo": "example_string"
}'
response = http.request(request)
puts response.body
[
{
"leadId": 123,
"taskNr": "example_string",
"taskId": 123
}
]
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Error",
"message": "Method not allowed",
"code": 405
}
POST
/mail/participant/{participantId}POST
Base URLstring
Target server for requests. Edit to use your own host.
path
participantIdinteger
RequiredThe mail gets imported to the participant with the participant-ID.
Content-Typestring
RequiredThe media type of the request body
Options: application/json
Request Preview
Response
Response will appear here after sending the request
Path Parameters
participantIdinteger
RequiredThe mail gets imported to the participant with the participant-ID.
Responses
leadIdinteger
taskNrstring
taskIdinteger
Was this page helpful?