POST https://api.betterplace.org/de/api_v4/clients/volksfreund/projects/4425/mailing_subscriptions.json
Create or update a mailing subscriptions for a project.
🔒 Only available if authenticated as a client. See betterplace.org clients.
This flow chart describes the process….
A successful request will return HTTP status 201 (created).
If an error occurs the HTTP return code will be 422 (unprocessable entity). More error codes.
Parameter | Example | Required | Description |
---|---|---|---|
language | en |
yes |
The subscription is marked with the language you use in your URL. Newsletter authors write their content in a specific lang which you can target with the subscription lang. To target a lang see api setting lang. |
client_id | volksfreund |
yes |
The betterplace.org-internal client permalink. |
project_id | 4425 |
yes |
Project id as an integer number. |
JSON parameters have to be provided in the body of the request with the Content-Type header set to "application/json". The parameters are part of a flat JSON document without any nesting. Some parameters are required, others are optional.
{
"email": "peter.paul@betterplace.org",
"first_name": "Peter",
"last_name": "Paul",
"active": true
}
Parameter | Example | Types | Required | Description |
---|---|---|---|---|
peter.paul@betterplace.org |
string |
yes |
The email of the user |
|
first_name | Peter |
string |
yes |
The first name of the user |
last_name | Paul |
string |
yes |
The last name of the user |
active | true |
boolean |
yes |
State of the subscription: active/inactive |
Attribute | Types | Example | Description |
---|---|---|---|
status | string |
accepted |
HTTP status code as a descriptive string. For a list of codes, see httpstatus.es. Example: "accepted" for code 202 |
status_code | number |
202 |
HTTP status code as an integer number, e.g. 202. |
Linkname | Description |
---|---|
location |
Location where the created/updated resource can be viewed or more information about it can be gathered. |
{
"status": "created",
"status_code": 201,
"links": [
]
}