Table of Contents

  1. Send SMS
  2. Send Fax
  3. Send Email
  4. Voice Broadcasting

Send SMS

In order to send SMS, we first need to create the text SMS which we need to send, and then we will use the text message to send it to a particular contact.

Create New Text SMS

REST API for Creating new Text SMS

    POST http://ictcore.example.com/api/messages/texts

SMS Object

    name: string // required
    data: string // required - It contains the actual message 
    type: string // unicode or plain or binary
    description: string

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/texts");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"name\",
      \"data\": \"Data\",
      \"type\": \"type\",
      \"description\": \"Description\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the text_id of the recently created record.

Send SMS program

Prepare given SMS for the provided account, and make it ready to be sent

REST API for Creating Send SMS Program

    POST http://ictcore.example.com/api/programs/sendsms

Program Object

    name: string
    text_id: number // text_id of SMS text for which this program is being created

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/programs/sendsms");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"name\",
      \"text_id: 1 (number ) - text_id of SMS text for which this program is being created\": \"\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the program_id of the recently created record.

Create SMS transmission

Now send the SMS to the particular contact and enter the destination detail

REST API for Creating SMS transmission

    POST http://ictcore.example.com/api/transmissions

Transmission Object

    title: string
    program_id: number
    phone: number
    origin: string
    direction: string

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"title\": \"title\",
      \"phone\": 1234231,
      \"program_id\": 1,
      \"origin\": \"origin\",
      \"direction\": \"direction\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the transmission_id of the recently created record.

Send SMS Transmission

Now the transmission is successfully created, now the next step is to send that transmission.

REST API for Send SMS Transmission

    POST http://ictcore.example.com/api/transmissions/transmission_id/send

Required parameters

    transmission_id: number // ID of the transmission in the form of an integer

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions/transmission_id/send");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Now the SMS will be sent to the particular contact. So this way you can send SMS to the particular contact.

Send Fax

Mostly businesses often use fax. Fax is the more secure and reliable way to share the documents instead of the instant messaging.

You must have configured a provider in ICTCore for sending fax. If you don’t know how to configure a provider view this link.

Step 1: Create Fax Document

Firstly create your fax document and than upload it to ICTCore.

REST API for creating fax document

    POST http://ictcore.example.com/api/messages/documents

Document Object

    name: string
    description: string

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/documents");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"group name\",
      \"description\": \"Description\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the document_id of recently created record.

Step 2: Upload Document File

Upload media / pdf file for an existing document, this method should be called followed by POST messages/documents. Supported file types are pdf, jpg, jpeg and png.

REST API for uploading document file

    PUT http://ictcore.example.com/messages/documents/document_id/media

Required parameter

    document_id: ID of the document in the form of an integer

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/documents/document_id/media");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");

    curl_setopt($ch, CURLOPT_POSTFIELDS,  Pdf file content here);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/pdf"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the document_id of recently updated record.

Step3: Create Send Fax program

Now we need to create the send fax program and and make it ready to be sent

REST API for Send Fax program

    POST http://ictcore.example.com/api/programs/sendfax

Program Object

    name: string
    document_id: number // document_id of fax document for which this program is being created

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/programs/sendfax");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"name\",
      \"document_id: 1 (number ) - document_id of fax document for which this program is being created\": \"\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the program_id of recently created record.

Step4: Create Send Fax transmission

REST API for Creating Fax transmission

    POST http://ictcore.example.com/api/transmissions

Transmission Object

    title: string
    program_id: number
    phone: number
    origin: string
    direction: string

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"title\": \"title\",
      \"phone\": 1234231,
      \"program_id\": 1,
      \"origin\": \"origin\",
      \"direction\": \"direction\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the transmission_id of recently created record.

Send Fax Transmission

Now the transmission is successfully created, now next step is to send that transmission.

REST API for Send Fax Transmission

    POST http://ictcore.example.com/api/transmissions/transmission_id/send

Required parameters

    transmission_id : number // ID of the transmission in the form of an integer

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions/transmission_id/send");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Now the document will be forwarded to the particular contact.

Send Email

Email marketing is the use of email to promote products or services while developing relationships with potential customers or clients. It is essentially direct mail done electronically instead of through the postal service.

You must have configured a provider in ICTCore for sending email.

Step 1: Create Email template

Firstly create your email template and than upload it to ICTCore.

REST API for creating email template

    POST http://ictcore.example.com/api/messages/templates

Template Object

    name: string
    description: string
    subject: string //required
    body: string // required field, it contains the HTML message
    body_alt: string // it contains the plain message
    type: string // three digit file extension representing file type

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/templates");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
     \"name\": \"name\",
     \"description\": \"Description\",
     \"subject\": \"Subject\",
     \"body\": \"body\",
     \"body_alt\": \"body alt\",
     \"type\": \"file extension\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the template_id of recently created record.

Step 2: Upload Template File

Upload media / attachment for an existing template, this method should be called followed by POST messages/templates

REST API for uploading template file

    PUT http://ictcore.example.com/api/messages/templates/template_id/media

Required parameter

    template_id: ID of the template in the form of an integer

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/templates/template_id/media");       
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");

    $fields = &lt;&lt;&lt;EOT
      file content here
    EOT;
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: text/plain"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the template_id of recently updated record.

Step3: Create Send Email program

Now we need to create the send email program and and make it ready to be sent

REST API for Send Email program

    POST http://ictcore.example.com/api/programs/sendemail

Program Object

    name: string
    template_id: 1 (number ) - template_id of email template for which this program is being created

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/programs/sendemail");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
    \"name\": \"name\",
    \"template_id: 1 (number ) - template_id of email template for which this program is being created\": \"\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the program_id of recently created record.

Step4: Create Send Email transmission

REST API for Creating Email transmission

    POST http://ictcore.example.com/api/transmissions

Transmission Object

    title: string
    program_id: number
    phone: number
    origin: string
    direction: string

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"title\": \"title\",
      \"phone\": 1234231,
      \"program_id\": 1,
      \"origin\": \"origin\",
      \"direction\": \"direction\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the transmission_id of recently created record.

Send Email Transmission

Now the transmission is successfully created, now next step is to send that transmission.

REST API for Send Email Transmission

    POST http://ictcore.example.com/api/transmissions/transmission_id/send

Required parameters

    transmission_id : number // ID of the transmission in the form of an integer

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions/transmission_id/send");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Now the email will be forwarded to the particular contact.

Voice Broadcasting

How can you reach the thousand of the customers at all once with your messaging service? Voice broadcasting facilitates this type of communication. It is the automation of the business at its finest.

Through voice broadcasting, you can send the message to your customers easily and target them so this way they will remember your name whenever they want to purchase.

ICTCore supports both

  • Sending recorded message to a single contact (Transmission)
  • Sending recorded message to number of contacts (Campaign)

So let’s get started to send our recorded message to particular contact.

You must have configured a provider in ICTCore for voice broadcasting. If you don’t know how to configure a provider view this link.

Step 1: Create Voice recording

Firstly create your voice recorded message and than upload it to ICTCore.

REST API for creating new recording

    POST http://ictcore.example.com/api/messages/recordings

Recording Object

    name: string
    description: string

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/recordings");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"group name\",
      \"description\": \"Description\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the recording_id of recently created record.

Step 2: Upload Voice recording File

Upload media / wav file for an existing recording, this method should be called followed by POST messages/recording.

REST API for uploading recording file

    PUT http://ictcore.example.com/api/messages/recordings/recording_id/media

Required parameter

    recording_id: ID of the recording in the form of an integer

REST API Example using PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/messages/recordings/recording_id/media");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");

    curl_setopt($ch, CURLOPT_POSTFIELDS,  Wav file content here);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: audio/wav"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the recording_id of recently updated record.

Step3: Create Voice recording program

Now we need to create the voice recording program and and make it ready to be played during call

REST API for Creating Voice recording program

    POST http://ictcore.example.com/api/programs/voicemessage

Program Object

    name: string
    recording_id: number // recording_id of voice recording for which this program is being created

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/programs/voicemessage");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"name\": \"name\",
      \"recording_id: 1 (number ) - recording_id of voice recording for which this program is being created\": \"\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the program_id of recently created record.

Step4: Create Voice transmission

REST API for Creating Voice transmission

    POST http://ictcore.example.com/api/transmissions

Transmission Object

    title: string
    program_id: number
    phone: number
    origin: string
    direction: string

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_POSTFIELDS, "[
    {
      \"title\": \"title\",
      \"phone\": 1234231,
      \"program_id\": 1,
      \"origin\": \"origin\",
      \"direction\": \"direction\"
    }
    ]");

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

Response

It will return the transmission_id of recently created record.

Send Voice Call Transmission

Now the transmission is successfully created, now next step is to send that transmission.

REST API for Voice Call Transmission

    POST http://ictcore.example.com/api/transmissions/transmission_id/send

Required parameters

    transmission_id : number // ID of the transmission in the form of an integer

REST API EXAMPLE USING PHP

    <?php
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, "http://ictcore.example.com/api/transmissions/transmission_id/send");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_POST, TRUE);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      "Content-Type: application/json"
    ));

    $response = curl_exec($ch);
    curl_close($ch);

    var_dump($response);

<

p>Now the Call will be forwarded to the particular contact and voice recorded message will be played during the call.