How to create a recipient group
Example of json data for a query:
{
"title":"My Recipients"
}
Example of an HTTP request itself:
curl -X POST https://api.msndr.net/v1/email/lists \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $API_TOKEN' \
-d '...JSON...'
POST method and /email/lists link is used here
An example of the response if the request is successful
{
"id":1,
"title":"My Recipients"
}
Let's look at the parameters of the request. Below is information about these parameters: name, description and whether this parameter is mandatory or not
Parameter |
Description |
Mandatory |
title |
The title of the recipient group. Must be unique |
yes |
Let's look at the name and description of the server response json attributes:
Attribute |
Description |
id |
identification of the created group |
title |
group name |
Getting a list of groups
An example HTTP request is as follows::
curl -X GET https://api.msndr.net/v1/email/lists \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $API_TOKEN'
The GET method and the /email/lists link are used here
This method supports paginated output.
If the request is successful you will get the following json response:
{
"total_count":3,
"total_pages":1,
"page_number":1,
"page_size":25,
"collection":[
{
"id":1,
"title":"My Recipients"
},
{
"id":2,
"title":"My Recipients #2"
},
{
"id":3,
"title":"My Recipients #3"
}
]
}
The response contains a collection of recipient groups. Each element has the following parameters:
Attribute |
Description |
id |
identification of the group |
title |
name of the group |
Getting information about the group
Example of http request:
curl -X GET https://api.msndr.net/v1/email/lists/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $API_TOKEN'
Here the GET method and the /email/lists/:id link are used
where :id is the group identifier for the information request.
An example of a response in case of success
{
"id":1,
"title":"My Recipients"
}
Here is a description of the attributes in the server's json response:
Attribute |
Description |
id |
identifier of the group |
title |
name of the group |
Deleting a group
HTTP request example:
curl -X DELETE https://api.msndr.net/v1/email/lists/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $API_TOKEN'
The DELETE method and the /email/lists/:id link are used here
where :id is the group identifier for the information request
If the deletion is successful, the server will return an empty response with status 204.
Editing a group
Example of json data for the request:
{
"title":"New Title"
}
Example of HTTP request:
curl -X PATCH https://api.msndr.net/v1/email/lists/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $API_TOKEN'
-d '...JSON...'
The PATCH method and the /email/lists/:id link are used here
where :id is the group identifier for the information request
Example of a successful response
{
"id":1,
"title":"New Title"
}
Below is the table with description of HTTP request parameters::
Parameter |
Description |
Mandatory |
title |
The name of the recipient group. Must be unique |
yes |
Below is a table describing the attributes of the json response from the server:
Attribute |
Description |
id |
Identifier of the created group |
title |
name of the group |