Trigger a Polling Channel
#
Manually trigger a polling channelThe polling is configured in the same way as we do for normal channel configuration, however, we don't supply a urlPattern
to match an incoming request on as the polling channel is triggered internally from the OpenHIM core based on the supplied cron pattern.
To manually trigger a polling channel request you will need to make a TLS request to the OpenHIM API for the below method and endpoint.
#
ExampleBefore we can send our request to the OpenHIM API we need to ensure that we construct our valid HTTP headers to successfully authenticate with the OpenHIM API.
- NodeJS
- Bash
Copy the below code at the bottom of your nodejs script that handles the authentication of the OpenHIM headers as described in the authentication section.
Replace the openhimOptions
values with the correct implementation details
Execute the below command in your terminal to run the nodejs script
Ensure that you have created your bash script to construct the HTTP authentication headers and send the request to the OpenHIM API as described in the authentication section.
Execute the below command in your terminal where the file is located with the required arguments. Replace the placeholder arguments with the correct implementation details
The response status code will be 201
if successful.