HTTP and JSON Integration for Clickatell Messaging API


Clickatell provides a REST-based messaging API that replaces traditional SMPP access. The IPWorks HTTP and JSON components can be used together to construct and send properly formatted JSON requests for message delivery.

Sending a Message Using HTTP and JSON

The message payload is created using the JSON component and then sent through an HTTP POST request to the Clickatell endpoint.

      //c#
      Http http = new Http();
      http.OnTransfer += (obj, ev) =>
      {
        if (ev.Direction == 1)
          Debug.WriteLine("Response:\r\n" + ev.Text);
      };
      Json json = new Json();
      json.StartObject();
      json.PutProperty("content", "Hi! This is a test message.", 2);
      json.PutName("to");
      json.StartArray();
      json.PutValue("15555555555", 2);
      json.EndArray();
      // json.PutProperty("from", "15555555555", 2); 
      // If your integration supports two-way messaging, set the from number here.
      json.PutProperty("binary", "false", 4);
      json.PutProperty("clientMessageId", "uuid", 2);
      json.EndObject();
      json.Flush();
      string request = json.OutputData;
      Debug.WriteLine(json.OutputData);
      http.Authorization = "Your API Key Here";
      http.ContentType = "application/json";
      http.Accept = "application/json";
      http.PostData = request;
      http.Post("https://platform.clickatell.com/messages");

The JSON structure defines message content, recipients, and optional parameters such as client message ID. The HTTP component handles authentication and transmission to the Clickatell REST endpoint.

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.