Create a sending¶
POST /integrations/inxmail-professional/mailing-synchronizations/{id}/sendings
This request initiates a sending. It will not block until the sending is completed, so a successful response code is no guarantee that the mailing was actually sent.
The request will perform the following tasks in Inxmail Professional:
- A mailing with all content of the approved New Xperience mailing is created in the according list in Inxmail Professional.
- The mailing in Inxmail Professional will be approved.
- The mailing in Inxmail Professional will be sent or scheduled for sending.
The exact behavior of this endpoint depends on whether a transaction ID is provided. If no transaction ID is provided, the request will only return successfully if the whole setup for the sending was successful. The only possible state of a sending in this case is CREATED. An error response is no guarantee that the mailing wasn't sent. A request without a transaction ID can't safely be retried.
A transaction ID serves as a unique identifier for the sending to provide idempotency. The transaction ID must be unique in the scope of the mailing synchronization.
If a transaction ID is provided, the endpoint will behave as follows:
- If the whole setup for the sending was successful, the endpoint will respond with a 201 Created.
- If the sending is retried with the same transaction ID or there was a server-side error, the endpoint will respond with 200 OK, yielding the regular response body including a state field indicating the current status.
- If there was a client-side error, the endpoint will respond with an error response in the 4xx range.
- If the request couldn't be processed at all, the endpoint will respond with a 500 Internal Server Error.
If you do not receive any response or a 5xx response, retry the request with the same transaction ID to check the outcome.
In the case of a 200 OK response, inspect the state field to derive the next action:
PENDINGmeans the request is still being processed. Retry the request with the same transaction ID to check the outcome.CREATEDmeans the mailing was successfully sent or scheduled for sending, no further action is required.FAILEDmeans the sending definitively failed. Retry the request with a different transaction ID to try again.INDETERMINATE_FAILUREmeans it's uncertain whether the sending went out successfully or not. It is not safe to retry the request. Contact the Inxmail support team for further assistance.
Retries should be performed with a backoff. Sendings with state PENDING should be retried for a total of 5 minutes. Sendings with state FAILED should be recreated with a different transaction ID for at most three times for a total of 15 minutes. If the sending does not reach the CREATED state after these retries, contact the Inxmail support team for further assistance in either case.
A retry with the same transaction ID must use the exact same request payload. Any properties differing from a previously created sending will be ignored.
Note
The Mailing in New Xperience must be approved prior to create a sending. Whether the mailing is approved is indicated by the readyForSending flag in /mailing-synchronizations
Note
Sendings in any state other than CREATED will by default not show up in the sendings collection response. You can explicitly include them by using the query parameter includeAllStates=true.
Request Parameters¶
| Parameter | Required | In | Description |
|---|---|---|---|
| id | yes | path | The ID of the Mailing Synchronization the sending shall be created for |
Payload Structure¶
| Path | Type | Description | Constraints |
|---|---|---|---|
| scheduleDate | Date with time | Optional: if not defined the mailing will be sent immediately |
|
| name | String | Optional: if defined, this value is used as mailing name | |
| subject | String | Optional: if defined, this value is used as mailing subject | |
| transactionId | String | Optional: if defined, this value is used to de-duplicate sending requests |
|
Response Structure¶
| Path | Type | Description |
|---|---|---|
| id | String | The ID of the sending instance |
| creationDate | String | The date and time when the sending instance was created |
| mailingId | String | The ID of the New Xperience mailing created for using the mailing editor |
| scheduleDate | String | The date and time when the sending instance will be or was executed |
| mailingSynchronizationId | String | The ID of the mailing synchronization. |
| state | String | The current state of the sending attempt |
| transactionId | String | The transaction ID used in the request payload, null if none was provided |
| target | Object | The information about the sending target |
| target.mailingId | Number | The ID of the mailing in Inxmail Professional |
| target.sendingId | Number | The ID of the sending in Inxmail Professional |
| _links | Object | The links currently available for this resource |
Links¶
| Name | Description |
|---|---|
| inx:report | The link to open the report for the sending. |
Basic example¶
Request:
$ curl 'https://myka-1.my-api.inxmail.de/integrations/inxmail-professional/mailing-synchronizations/0b405924-a96a-4c52-a20e-488d554f518a/sendings' -i -X POST \
-H 'Content-Type: application/hal+json' \
-H 'Authorization: Basic <base64Encoded user:password>' \
-d '{
}'
Response:
HTTP/1.1 201 Created
Location: https://myka-1.my-api.inxmail.de/integrations/inxmail-professional/mailing-synchronizations/0b405924-a96a-4c52-a20e-488d554f518a/sendings/4379124b-be62-4018-86fa-92b98497d299
Content-Type: application/hal+json;charset=UTF-8
Content-Length: ...
{
"id": "536eb5a9-8e95-4f35-b0dd-21f901af0679",
"mailingSynchronizationId": "0b405924-a96a-4c52-a20e-488d554f518a",
"creationDate": "2021-02-10T09:49:11.051Z",
"scheduleDate": null,
"state": "CREATED",
"transactionId": null,
"target": {
"mailingId": 836,
"sendingId": 24
},
"_links": {
"self": {
"href": "https://myka-1.my-api.inxmail.de/integrations/inxmail-professional/mailing-synchronizations/e12da055-9d95-4287-a13c-a329d9898d09/sendings/536eb5a9-8e95-4f35-b0dd-21f901af0679"
},
"inx:report": {
"href": "https://myka-1.my.inxmail.de/reporting/reports/e12da055-9d95-4287-a13c-a329d9898d09"
},
"curies": [
{
"href": "https://apidocs.inxmail.com/nxp/rest/v1/relations/{rel}",
"name": "inx",
"templated": true
}
]
}
}