Developer API

HuntIm.com

API Documentation For Website/Software  Integration

Our Docs Are Such Friendly That A Normal User Can Also Integrate API With Out Having Deep Developer Knowledge.

Verify Credenttial
http://app.huntim.com/CampaignApi.php?step=CredentialsVerify&username=Email&password=password

Parameters Description
username Your Email Address Of Huntim.com (Required).
password Your Login Password Of Huntim.com (Required).
Successful Respone Will Look Like
        { "success":"true", "message":"Success", "errorcode" :"0", "token":"21" }
        Token is Your User Id For Campaign Registration
      
Failed Verification Response
        { "success":"false", "message":"invalid credentials", "errorcode" :"4" }    
        or
        { "success":"false", "message":"Email or user not verified.", "errorcode" :"14" }
        or
        { "success":"false", "message":"username or password is empty", "errorcode" :"3" }
        or
        { "success":"false", "message":"Incomplete information.", "errorcode" :"1" }
                  

For more info see error table


Create Campaign
http://app.huntim.com/CampaignApi.php?step=CreateCampaign&token=token
&campaignname=Campaign Name

Parameters Description
token The Id you get after verification in HuntIm
step Creating Campaign

for Create Campaign Enter step=CreateCampaign
campaignname The Name of your Campaign
Successful Respone Will Look Like
        {"success":"true","message":"Campaign was added","campaignid":"1","errorcode":"0"}
        "campaignid" is your Campaign Id for Execution of Campaign
      
Failed Creating Campaign
        { "success":"false", "message":"Token not valid.", "errorcode" :"6" }   
        or
        { "success":"false", "message":"Token is empty", "errorcode" :"5" }
        or
        { "success":"true", "message":"campaign name not provided ", "errorcode" :"7" }
        or
        { "success":"false", "message":"Step was not provided.", "errorcode" :"2" }
        or
        { "success":"false", "message":"Campaign was not added.", "errorcode" :"27" }
        or
        { "success":"false", "message":"Campaign not added.", "errorcode" :"8" }
        

For more info see error table


Analyze Contacts
http://app.huntim.com/CampaignApi.php?step=analyzecontacts&token=token
&campaignid=Campaign Id

Parameters Description
token The Id you get after verification in HuntIm
step Analyze Contacts
to submit contacts enter step=analyzecontacts
Contact List The list of recepients
Successful Respone Will Look Like
        { "success":"true", "message":"15 contacts were added ", "errorcode" :"0" }
      
Failed Analyzing Contacts
        { "success":"false", "message":"Invalid token.", "errorcode" :"12" }  
        or
        { "success":"false", "message":"Step was not provided.", "errorcode" :"2" }
        or
        { "success":"false", "message":"Invalid campaign id provided.", "errorcode" :"15" }
        or
        { "success":"false", "message":"No contacts submitted", "errorcode" :"10" }
        or
        { "success":"false", "message":"Token or campaign id empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Contacts and message were not added to campaign .", "errorcode" :"21" }
        

For more info see error table


Send Message
http://app.huntim.com/CampaignApi.php?step=messagesend&message=message&token=token
&campaignid=campaignid
Parameters Description
token The Id you get after verification in HuntIm
step Send Message
to Save Message enter step=messagesend
Campaign Id your campaign id got after creating campaign
Successful Respone Will Look Like
        {"success":"true","totalcontactssubmitted":"15","validcontacts":"11","031078291631":"30"}
      
Failed Sending Message
        { "success":"false", "message":"Message or token or campaign id is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Invalid token.", "errorcode" :"12" }
        or
        { "success":"false", "message":"No contacts submitted", "errorcode" :"10" }
        or
        { "success":"false", "message":"Invalid campaign id provided.", "errorcode" :"15" }
        or
        { "success":"false", "message":"Uploading message to database failed..", "errorcode" :"17" }
        

For more info see error table


Status Request
http://app.huntim.com/CampaignApi.php?step=statusrequest&token=token
&campaignid=campaignid
Parameters Description
token The Id you get after verification in HuntIm
step Stutus Request To send Your Message
step=statusrequest
Campaign Id your campaign id got after creating campaign
Successful Respone Will Look Like
        { "success":"true", "message":"Status change success.", "errorcode" :"0" }
      
Failed Sending Message
        { "success":"false", "message":"token or campaign id is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Unable to change status.", "errorcode" :"31" }
        or
        { "success":"false", "message":"Invalid token.", "errorcode" :"12" }
        or
        { "success":"false", "message":"Invalid campaign id provided.", "errorcode" :"15" }
        or
        { "success":"false", "message":"Uploading message to database failed..", "errorcode" :"17" }
        

For more info see error table

Fetch Message Send Status
http://app.huntim.com/CampaignApi.php?step=fetchmessagesendstatus&token=token
&campaignid=campaignid
Parameters Description
token The Id you get after verification in HuntIm
step To Fetch message send Status type
step=fetchmessagesendstatus
Campaign Id your campaign id got after creating campaign
Successful Respone Will Look Like
        {"success":"true","status":"fetch status success.","031078291631":"34","0310178291631":"34","0310748291631":"34"}
        or
        { "success":"true", "message":"Campaign served..", "errorcode" :"0" }
      
Failed Sending Message
        { "success":"false", "message":"token or campaign id is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Unable to change status.", "errorcode" :"31" }
        or
        { "success":"false", "message":"Invalid token.", "errorcode" :"12" }
        or
        { "success":"false", "message":"Invalid campaign id provided.", "errorcode" :"15" }
        or
        { "success":"false", "message":"Uploading message to database failed..", "errorcode" :"17" }
        or
        { "success":"false", "message":"No contacts provided.", "errorcode" :"10" }
        or
        { "success":"false", "message":"Unable to fetch status.", "errorcode" :"32" }
        

For more info see error table

Fetch Analyze Individual
http://app.huntim.com/CampaignApi.php?step=fetchanalyzeindividual&token=token
&campaignid=campaignid &phone=PhoneNumber
Parameters Description
token The Id you get after verification in HuntIm
step To Fetch Analyze Individual type
step=fetchanalyzeindividual
Campaign Id your campaign id got after creating campaign
Phone No Phone Number You Provided on HuntIm
Successful Respone Will Look Like
        {"Success":"true","Message":"Whatsapp status of phone is","Status":"On whatsapp","errorcode":"0"}
        or
        {"Success":"true","Message":"Whatsapp status of phone is","Status":"Not on whatsapp","errorcode":"0"}
      
Failed Sending Message
       	{ "success":"false", "message":"Invalid phone number or campaign id.", "errorcode" :"39" }
        or
        { "success":"false", "message":"Token or campaign id or phone number is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Fetch analyze status failed.See documentation for further assistance.", "errorcode" :"25" }
        or
        { "success":"false", "message":"Please wait while the campaign is being served.", "errorcode" :"26" }
        or
        { "success":"false", "message":"Invalid token or campaign id.", "errorcode" :"23" }
        or
        { "success":"false", "message":"Something went wrong while fetching status.", "errorcode" :"24" }
        

For more info see error table

Fetch Analyze Status
http://app.huntim.com/CampaignApi.php?step=fetchanalyzestatus&token=token
&campaignid=campaignid
Parameters Description
token The Id you get after verification in HuntIm
step To Fetch Analyze Status type
step=fetchanalyzestatus
Campaign Id your campaign id got after creating campaign
Successful Respone Will Look Like
        {"Success":"true","Message":"Analyze contacts fetching status success.","TotalContacts":"0","WhatsAppContacts":"0","NonWhatsAppContacts":"0","errorcode":"0"}
      
Failed Sending Message
        { "success":"false", "message":"token or campaign id is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Fetch analyze status failed.See documentation for further assistance.", "errorcode" :"25" }
        or
        { "success":"false", "message":"Please wait while the campaign is being served.", "errorcode" :"26" }
        or
        { "success":"false", "message":"Invalid token or campaign id.", "errorcode" :"23" }
        or
        { "success":"false", "message":"Something went wrong while fetching status.", "errorcode" :"24" }
        

For more info see error table

Fetch Message Sent Status
http://app.huntim.com/CampaignApi.php?step=fetchmessagesentstatus&token=token
&campaignid=campaignid
Parameters Description
token The Id you get after verification in HuntIm
step To Fetch message sent Status type
step=fetchmessagesentstatus
Campaign Id your campaign id got after creating campaign
Successful Respone Will Look Like
        {"success":"true","message":"fetch status success","031078291631":"Error-Code:36","0310178291631":"Error-Code:36","0310748291631":"Error-Code:36"}
      
Failed Sending Message
        { "success":"false", "message":"token or campaign id is empty.", "errorcode" :"9" }
        or
        { "success":"false", "message":"Invalid token.", "errorcode" :"12" }
        or
        { "success":"false", "message":"Invalid campaign id provided.", "errorcode" :"15" }
        or
        { "success":"false", "message":"No contacts provided.", "errorcode" :"10" }
        

For more info see error table

Return Response And Their Meanings.


Error Code Description
0 All ok
1 GET was not set so set it
2 step was not provided in get request.
3 either username or password is empty.
4 invalid credentials either username or password is invalid.
5 token is either empty or not provided.
6 token is invalid.
7 Either Campaign Name or Message was not provided in get request.
8 Failed to add new campaign in the table.
9 while submitting contacts either campaign id or token not provided.
10 No contacts were provided or submitted in post request
11 while adding contacts to database something went wrong
12 while submitting contacts invalid token provided.
13 Provided step does not exist.
14 User is not verified verify it through email first.
15 The provided campaign id is invalid.
16 Campaign rows analyzed status change successfully.
17 Database Updation Failed.
18 contacts are already being analyzed.
19 while setting analyze status something went wrong.
20 While Analyzing contacts invalid Credentials provide.
21 Unable to add message while submitting contacts
22 Something went wrong while submitting contacts.
23 while fetching analyze status invalid credentials provided.
24 while fetching something went wrong between the file server and the database server kindly try again.
25 Fetch analyze status failed because the request to anlyze contacts is not yet recieved that means as per hierarchy.
26 Campaign is being analyzed.
27 something went wrong between the server and the db server , try again.
30 means either the contact is not a valid one or the request to send message is already recieved.
31 something went wrong while raising request to check status . please try again.
32 while fetching cstatus from contactlist table something went wrong between the file server and the db server.
33 no request generated.
34 message sending in progress.
35 something went wrong between file server and db server.
36 in progress.
37 Contacts are not available in contact list.
38 while updating the step of campaign something went wrong please try again.
39 phone number or campaign id is invalid.

PHP Sample Code

<?php>
$Email="***@gmail.com";//your huntim email
$Password="1234***";//your huntim password
$step="CredentialsVerify";
$url = "http://app.huntim.com/CampaignApi.php?username=".$Email."&password=".$Password."&step=".$step."";
$ch=curl_init();
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 
Firefox/2.0.0.13');
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result=curl_exec($ch);
echo $result;
?>

C# Sample Code

using System; 
using System.Net; 
using System.Web;
public class Program 
{ 
public static void Main() 
{ 
string MyUsername = "userxxx"; //Your Username At Sendpk.com 
string MyPassword = "92***"; //Your Password At Sendpk.com 
string toNumber = "923****"; //Recepient cell phone number with country code 
string Masking = "SMS Alert"; //Your Company Brand Name 
string MessageText = "SMS Sent using .Net"; 
string jsonResponse = SendSMS(Masking, toNumber, MessageText, MyUsername , MyPassword); 
Console.Write(jsonResponse); 
//Console.Read(); //to keep console window open if trying in visual studio 
} 
public static string SendSMS(string Masking, string toNumber, string MessageText, string MyUsername , string MyPassword) 
{ 
String URI = "http://sendpk.com" + 
"username=" + MyUsername + 
"&sender=" + Masking + 
{ 
WebResponse resp = req.GetResponse(); 
return sr.ReadToEnd().Trim(); 
} 
catch (WebException ex) 
var httpWebResponse = ex.Response as HttpWebResponse; 
{ 
{ 
case HttpStatusCode.NotFound: 
break; 
return "400:Bad Request"; 
default: 
return httpWebResponse.StatusCode.ToString(); 
} 
} 
return null; 
}