API
The API of the me-scheduler-service provides 3 endpoints:
-
Scheduling of a launch related to a segment
-
Deletion of a launch
-
Sending of a test message
Scheduling of a launch
The service is creating a new job with a new (unique) job ID and then adding this job with the respective delay (based on the specified scheduledAt date).
|
If the flipper |
Deletion of a launch
The service is simply calculating the unique ID of the job and then checking if such a job exists in the init queue and the jobe never has been triggered before. In this case, the job entry is simply removed from the init queue.
If the pre run segmentation is active (see flipper USE_PRE_RUN_SEGMENTATION), then also the launches and dispatch queue are taken into account.
Sending test messages
For test messages the service acts as a proxy and simply forwards the request to the respective endpoint of the message generator.
All API triggers except the one for a test message cause an access to the init Bull queue. Test messages that are not triggered by segment are simply forwarded to the respective message generator endpoint.
Test messages that are triggered by segment are added to launches queue that resolves contacts id’s from that segment and then calls message generator endpoint. Max limit of contacts that segment can have is passed from push in variable maxTestMessageContacts.