title: Clickatell API will send message successfully but I can never receive the message
body: <p>I am testing the Clickatell API to integrate SMS confirmations in my php based app, I've used their rest api to send the message to myself to test but the messages never arrive.</p>
  
  <p><strong>My Attempts</strong></p>
  
  <p>I used this <a href="https://www.clickatell.com/developers/api-docs/get-coverage-rest/" rel="nofollow">https://www.clickatell.com/developers/api-docs/get-coverage-rest/</a> to check the coverage and this was the JSON response:</p>
  
  <pre><code>object(stdClass)[54]
    public 'data' =&gt; 
      object(stdClass)[57]
        public 'routable' =&gt; boolean true
        public 'destination' =&gt; string ' 21655609125' (length=12)
        public 'minimumCharge' =&gt; float 0.8
  </code></pre>
  
  <p>I've also made sure the message is actually sent by checking status; and this was the JSON response:</p>
  
  <pre><code>object(stdClass)[54]
    public 'data' =&gt; 
      object(stdClass)[57]
        public 'charge' =&gt; float 0.8
        public 'messageStatus' =&gt; string '004' (length=3)
        public 'description' =&gt; string 'Received by recipient' (length=21)
        public 'apiMessageId' =&gt; string 'b57f4a28dece65a134b56be2010c8a78' (length=32)
        public 'clientMessageId' =&gt; string '' (length=0)
  </code></pre>
  
  <p>I've then tried their own website for sent messages reports and that's what I see:</p>
  
  <blockquote>
    <p>MESSAGE CONTENT Thanks for testing Clickatell's gateway coverage. You
    will be able to change the content of your message after your initial
    purchase of message credits.</p>
    
    <p>Mobile Network Tunisia:Orange To 21655609125</p>
  </blockquote>
  
  <p><strong>Received by recipient (status 4)</strong></p>
  
  <p>But I never receive the message myself. What could be the issue?</p>
  
  <p><strong>Edit: here is the full class i use in my app currently</strong></p>
  
  <pre><code>&lt;?php
  
  if ( ! defined( 'ABSPATH' ) ) {
      exit; // Exit if accessed directly
  }
  
  /**
   * MC_SMS class
   */
  class MC_SMS {
  
      public  $rest_uri   = 'https://api.clickatell.com/rest';
      public  $method     = 'post';
      public  $args       = array();
  
      /**
       * Constructor
       */
      public function __construct( $action, $data = null ) {
  
          $this-&gt;data = $data;
          $this-&gt;init();
  
          switch( $action ) :
  
              // Send message
              case 'send' :
  
                  $this-&gt;endpoint = '/message';
                  $this-&gt;method = 'post';
  
                  break;
  
              // Message status
              case 'status' :
  
                  $this-&gt;endpoint = '/message/' . $data;
                  $this-&gt;method = 'get';
  
                  break;
  
              // Network coverage
              case 'coverage' :
  
                  $this-&gt;endpoint = '/coverage/' . $data;
                  $this-&gt;method = 'get';
  
                  break;
  
              // Account balance
              case 'balance' :
  
                  $this-&gt;endpoint = '/account/balance';
                  $this-&gt;method = 'get';
  
                  break;
  
          endswitch;
  
          $this-&gt;queried_uri = $this-&gt;rest_uri . $this-&gt;endpoint;
          $this-&gt;do_request();
  
          $this-&gt;response = ( isset( $this-&gt;response_body['body'] ) ) ? json_decode( $this-&gt;response_body['body'] ) : null;
      }
  
      /**
       * Init.
       */
      public function init() {
          $this-&gt;headers = array(
                  'X-Version'     =&gt; 1,
                  'Authorization' =&gt; 'Bearer ClHrbIEo_LwAlSVTSMemBIA5Gmvz8HNb5sio3N9GVDdAO_PPJPaZKzdi8Y8cDSmrs4A4',
                  'Content-Type'  =&gt; 'application/json',
                  'Accept'        =&gt; 'application/json'
          );
  
          $this-&gt;data = ( ! empty( $this-&gt;data ) &amp;&amp; is_array( $this-&gt;data ) ) ? json_encode( $this-&gt;data ) : null;
  
          $this-&gt;args['headers'] = $this-&gt;headers;
  
          if ( $this-&gt;data ) {
              $this-&gt;args['body'] = $this-&gt;data;
          }
      }
  
      /**
       * Do the API request
       */
      public function do_request() {
  
          if ( $this-&gt;method == 'get' ) {
              $this-&gt;response_body = wp_remote_get( $this-&gt;queried_uri, $this-&gt;args );
          }
  
          if ( $this-&gt;method == 'post' ) {
              $this-&gt;response_body = wp_remote_post( $this-&gt;queried_uri, $this-&gt;args );
          }
      }
  
  }
  </code></pre>