It is possible to trigger the sending of an API trigger campaign programmatically via API thanks to the endpoint /v1/campaigns/{id}/sends.
Trigger a send
To trigger a send via API, you'll first need the ID of the campaign you wish to send. This can be obtained in two ways:
- Either directly in the campaign URL of the campaign in question in Sendingly .
- Either in response to the API call enabling the creation of a campaign with the endpoint
/v1/campaigns
Once you have the campaign ID, use the POST method with the endpoint /v1/campaigns/{id}/sends. You'll also need to add a unique identifier to the call to identify this send.
This endpoint works identically for the email channel and the SMS channel.
Once the call has been made, the campaign send is triggered and this with the parameters defined when it was created.
In response to the API call is sent an identifier corresponding to the send order. It is possible to query the endpoint /v1/campaigns/{id}/sends (GET method) to find out its progress in real time.
Conclusion
It is possible at any time to send an Email or SMS campaign programmatically via API.