Forum Home › Forums › Uncategorized Issues › HTTP driver
- This topic has 8 replies, 2 voices, and was last updated 1 year, 5 months ago by
Mikhail.
-
AuthorPosts
-
June 4, 2024 at 9:38 am #14624
ibrahim eren
ParticipantHello, I am trying to send SMS via API using the DrvHttpNotif driver, but in large systems, we need to send different SMS messages to multiple recipients. As you can imagine, writing separate code blocks for each user is impractical in systems with a thousand users. Is there a way to dynamically modify the code? Thank you.
June 4, 2024 at 11:58 am #14630
MikhailModeratorHello,
How the system should define what user should be selected as a recipient for an alarm?June 4, 2024 at 12:10 pm #14631ibrahim eren
ParticipantCan the phone number of the recipient and the content of the message to be sent be changed? Additionally, I could not integrate the SMS API service. NetGSM has shared a sample PHP code. How can I integrate this? Here is the code:
$curl = curl_init();curl_setopt_array($curl, array(
CURLOPT_URL => ‘https://api.netgsm.com.tr/sms/send/get’,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => ”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => ‘POST’,
CURLOPT_POSTFIELDS => array(‘usercode’ => ‘850XXXXXXX’,’password’ => ‘XXXX’,’gsmno’ => ‘5XXXXXXXXXX’,’message’ => ‘testmesajı’,’msgheader’ => ‘mesajbaşlığı’,’filter’ => ‘0’,’startdate’ => ‘230520221650’,’stopdate’ => ‘230520221830’,’appkey’=>’xxx’),
));$response = curl_exec($curl);
curl_close($curl);
echo $response;June 4, 2024 at 2:39 pm #14634ibrahim eren
ParticipantAnd also my SMS API provider said they not support json frame for sending sms, they support soap and xml
June 5, 2024 at 10:15 am #14637
MikhailModeratorCan the phone number of the recipient and the content of the message to be sent be changed?
Yes. When command is send by Automatic Control module, the phone number is taken from the address book, and the text can contain variables.
June 5, 2024 at 10:18 am #14638
MikhailModeratorTry to configure DrvHttpNotif according to the provider requirements.
CURLOPT_POSTFIELDS probably should be specified on the request body.June 7, 2024 at 6:45 am #14643ibrahim eren
ParticipantMy providers requirements here https://www.netgsm.com.tr/dokuman#xml-post-sms-g%C3%B6nderme I have no idea how to integrate it.
June 7, 2024 at 10:15 am #14646
MikhailModeratorContact the provider’s technical support and ask for an example of content type and body of the POST request. Then use it in the device properties.
June 7, 2024 at 10:17 am #14647
MikhailModeratorAlso you can send a request according to the instructions and analyze it by Wireshark.
-
AuthorPosts
- You must be logged in to reply to this topic.