Integration to Wordpress, Is it possible


#1

I have wordpress website & FTP
I want to integrate the bulk sms service with my wordpress website. is it possible to we do this...

What I have?

UNIQUE TOKEN ID
API
MOBILE NO.
MESSEGE, SENDERID (6 digit)

API format: http://api.websitename.com/sms.php?token=&mob=&mess=&sender=ABCSMS&route=0

???


Unknown error
#2

Wordpress templates are PHP files. So you just have to write the API requests. The request looks like a an HTTP GET, so you can try using the regular filesystem functions if your server allows it

http://php.net/manual/en/ref.filesystem.php


#3

@chorn I only know to edit HTML or css but I have not idea where from I request and where I edit .

I going to do this on all specialist guys who is here and I am doing this on my idea and his command.

Is there no any simple form that easy edit the code and run I'm FTP and Wordpress Page?


#4

Is this also part of your school project?


#5

No..


#6

if you want to run it independently, you can just make a PHP file with a file_get_contents statement to your API URL in it and upload it to a server with PHP enabled. If you want to integrate it into Wordpress, you have to find a point where PHP is executed and proceed the same way.


#7

I don't know php..


#8

Is this right php?

<?php

//Your authentication key
$authKey = "YourAuthKey";

//Multiple mobiles numbers separated by comma
$mobileNumber = "9999999";

//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "102234";

//Your message to send, Add URL encoding here.
$message = urlencode("Test message");

//Define route 
$route = "default";
//Prepare you post parameters
$postData = array(
    'authkey' => $authKey,
    'mobiles' => $mobileNumber,
    'message' => $message,
    'sender' => $senderId,
    'route' => $route
);

//API URL
$url="http://api.msg91.com/api/sendhttp.php";

// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $postData
    //,CURLOPT_FOLLOWLOCATION => true
));


//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);


//get response
$output = curl_exec($ch);

//Print error if any
if(curl_errno($ch))
{
    echo 'error:' . curl_error($ch);
}

curl_close($ch);

echo $output;
?>

#9

Is this right?

$token = "1SDJGWEH";
$mob = "7855212520";
$msg = "HELLO";
$sender = "Hola";

$url = "http://api.website.com/sms.php?token=".$token."&mob=".$mob."&mess=".$msg."&sender=".$sender."&route=0";

$resp = file_get_contents($url);

print_r($resp);

Unknown error
#10

did you test it? does it work? do you get any errors? do you get the expected output? do you get a sms? as i do not know what a valid result of this action may be, it's up to you answering this.


#11

As this isn't a school project, so you're not required to do this, might I suggest you stop trying to run before you can walk and take time to learn things properly. Work on HTML and CSS until you are comfortable with those, then move on to the basics of PHP and / or JavaScript. Continually trying to make things work using copied code you don't understand will, in the end, take longer and teach you less than if you put some time into learning the basics.


#12

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.