Now Hiring: Are you a driven and motivated 1st Line IT Support Engineer?

Get messages and their current status – PHP Integration

Get messages and their current status – PHP Integration

  • </pre>
    <pre class="prettyprint prettyprinted"><span class="kwd">try</span> <span class="pun">{</span>
        <span class="com">// Get a message using the ID.</span><span class="pln">
        $msg </span><span class="pun">=</span><span class="pln"> getMessageByID</span><span class="pun">(</span><span class="lit">1</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$msg</span><span class="pun">);</span>
    
        <span class="com">// Get messages using the Group ID.</span><span class="pln">
        $msgs </span><span class="pun">=</span><span class="pln"> getMessagesByGroupID</span><span class="pun">(</span><span class="str">')V5LxqyBMEbQrl9*J$5bb4c03e8a07b7.62193871'</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$msgs</span><span class="pun">);</span>
        
        <span class="com">// Get messages received in last 24 hours.</span><span class="pln">
        $msgs </span><span class="pun">=</span><span class="pln"> getMessagesByStatus</span><span class="pun">(</span><span class="str">"Received"</span><span class="pun">,</span> <span class="kwd">null</span><span class="pun">,</span> <span class="kwd">null</span><span class="pun">,</span><span class="pln"> time</span><span class="pun">()</span> <span class="pun">-</span> <span class="lit">86400</span><span class="pun">);</span>
        
        <span class="com">// Get messages received on SIM 1 of device ID 8 in last 24 hours.</span><span class="pln">
        $msgs </span><span class="pun">=</span><span class="pln"> getMessagesByStatus</span><span class="pun">(</span><span class="str">"Received"</span><span class="pun">,</span> <span class="lit">8</span><span class="pun">,</span> <span class="lit">0</span><span class="pun">,</span><span class="pln"> time</span><span class="pun">()</span> <span class="pun">-</span> <span class="lit">86400</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$msgs</span><span class="pun">);</span>
    <span class="pun">}</span> <span class="kwd">catch</span> <span class="pun">(</span><span class="typ">Exception</span><span class="pln"> $e</span><span class="pun">)</span> <span class="pun">{</span><span class="pln">
        echo $e</span><span class="pun">-></span><span class="pln">getMessage</span><span class="pun">();</span>
    <span class="pun">}</span></pre>
    <pre>

Leave your thought here

Your email address will not be published. Required fields are marked *