HTTP driver

Forum Home Forums Uncategorized Issues HTTP driver

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #14624
    ibrahim eren
    Participant

    Hello, 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.

    #14630
    Mikhail
    Moderator

    Hello,
    How the system should define what user should be selected as a recipient for an alarm?

    #14631
    ibrahim eren
    Participant

    Can 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;

    #14634
    ibrahim eren
    Participant

    And also my SMS API provider said they not support json frame for sending sms, they support soap and xml

    #14637
    Mikhail
    Moderator

    Can 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.

    #14638
    Mikhail
    Moderator

    Try to configure DrvHttpNotif according to the provider requirements.
    CURLOPT_POSTFIELDS probably should be specified on the request body.

    #14643
    ibrahim eren
    Participant

    My providers requirements here https://www.netgsm.com.tr/dokuman#xml-post-sms-g%C3%B6nderme I have no idea how to integrate it.

    #14646
    Mikhail
    Moderator

    Contact 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.

    #14647
    Mikhail
    Moderator

    Also you can send a request according to the instructions and analyze it by Wireshark.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.