You are on page 1of 68

API Usage Guide API-Document Page 1 of 68

TABLE OF CONTENTS

SECTION A –AUTHENTICATION STEPS..............................................................................................................4


A.1 General Information.................................................................................................................................4
A.2 Example.......................................................................................................................................................4
A.3 CREDENTIALS..................................................................................................................................................4
A.4 USER AUTHENTICATION.................................................................................................................................46
A.5 USER AUTHENTICATION FROM MY ACCOUNTS.............................................................................................54
SECTION B – ADD USER API...................................................................................................................................5
B.1 Cloud Based Account...............................................................................................................................5
B.2 ISP BASED ACCOUNT ......................................................................................................................................6
SECTION C – EDIT USER API..................................................................................................................................7
C.1 CLOUD BASED ACCOUNT......................................................................................................................................7
C.2 ISP BASED ACCOUNT............................................................................................................................................8
SECTION D – GET ALL USERS OF AN ACCOUNT API......................................................................................9
D.1 GENERAL INFORMATION......................................................................................................................................9
D.2 SAMPLE OUTPUT..................................................................................................................................................9
SECTION E – GET USER DETAILS API ..............................................................................................................11
E.1 GENERAL INFORMATION.....................................................................................................................................11
E.2 SAMPLE OUTPUT.................................................................................................................................................11
E.3 GET ALL USER DETAILS.......................................................................................................................................40
E.4 GET ALL USER DETAILS BY DATE.......................................................................................................................45
E.5 GET ALL GROUP DETAILS.....................................................................................................................................41
E.6 GET ALL USER IDS...............................................................................................................................................60
E.7 GET ALL USER IDS BY PHONE..............................................................................................................................62
E.8 GET ALL USER DETAILS BY PHONE......................................................................................................................63
E.9 GET USER DETAILS BY USERNAME......................................................................................................................65
E.10 MOVE GROUP...................................................................................................................................................68
SECTION F – SESSION DATA API.........................................................................................................................13
F.1 GENERAL INFORMATION......................................................................................................................................13
F.2 SAMPLE OUTPUT..................................................................................................................................................13
F.3 DAY WISE DATA..................................................................................................................................................67
SECTION G – GET BALANCE API........................................................................................................................15
G.1 GENERAL INFORMATION.....................................................................................................................................15
G.2 SAMPLE OUTPUT.................................................................................................................................................15
SECTION H – MAKE PAYMENT API....................................................................................................................16
H.1 GENERAL INFORMATION.....................................................................................................................................16
H.2 SAMPLE OUTPUT.................................................................................................................................................16
SECTION I – GET USER SESSION DETAILS API..............................................................................................17
I.1 GENERAL INFORMATION......................................................................................................................................17
I.2 SAMPLE OUTPUT..................................................................................................................................................17
I.3 GET ACTIVE USER SESSION DETAILS...................................................................................................................66
API Usage Guide API-Document Page 2 of 68

SECTION J – CHANGE BILLING CYCLE API...................................................................................................18


J.1 GENERAL INFORMATION......................................................................................................................................18
J.2 SAMPLE OUTPUT..................................................................................................................................................18
SECTION K – ADD FUP QUOTA TO USER API..................................................................................................19
K.1 GENERAL INFORMATION.....................................................................................................................................19
K.2 SAMPLE OUTPUT.................................................................................................................................................19
K.3 GET FUP DETAILS..............................................................................................................................................44

SECTION L – CHECK USER EXSISTS BY ID API..............................................................................................20


L.1 GENERAL INFORMATION.....................................................................................................................................20
L.2 SAMPLE OUTPUT.................................................................................................................................................20

SECTION M – CHECK USER EXSISTS BY NAME API.....................................................................................21


M.1 GENERAL INFORMATION....................................................................................................................................21
M.2 SAMPLE OUTPUT................................................................................................................................................21

SECTION N – GET PREVIOUS DURATION CYCLE API..................................................................................22


N.1 GENERAL INFORMATION.....................................................................................................................................22
N.2 SAMPLE OUTPUT.................................................................................................................................................22

SECTION O – GET PREVIOUS DATA CYCLE API............................................................................................23


O.1 GENERAL INFORMATION.....................................................................................................................................23
O.2 SAMPLE OUTPUT.................................................................................................................................................23

SECTION P – RESET PASSWORD API................................................................................................................25


P.1 GENERAL INFORMATION......................................................................................................................................25
P.2 SAMPLE OUTPUT..................................................................................................................................................25

SECTION Q – SEND PASSWORD API..................................................................................................................26


Q.1 GENERAL INFORMATION.....................................................................................................................................26
Q.2 SAMPLE OUTPUT.................................................................................................................................................26
Q.3 UPDATE SMS STATUS.........................................................................................................................................42

SECTION R – AUTHENTICATE USER API..........................................................................................................27


R.1 GENERAL INFORMATION.....................................................................................................................................27

SECTION S – PAYMENT DETAILS API................................................................................................................28


S.1 GET ALL PAYMENT IDS......................................................................................................................................28
S.2 GET PAYMENT DETAILS......................................................................................................................................29
S.3 GET PAYMENT DETAILS BY DATE......................................................................................................................30
S.4 GET PAYMENT DETAILS BY USER ID AND DATE...............................................................................................31
S.5 GET PAYMENT LOGS...........................................................................................................................................32
S.6 GET PAYMENT LOGS BY DATE...........................................................................................................................33
S.7 GET PAYMENT LOGS BY USER ID AND DATE....................................................................................................34

SECTION T – INVOICE DETAILS API..................................................................................................................35


T.1 GET ALL INVOICE IDS..........................................................................................................................................35
T.2 GET INVOICE DETAILS.........................................................................................................................................36
API Usage Guide API-Document Page 3 of 68

T.3 GET ALL INVOICES FROM USER ID.....................................................................................................................43

SECTION U – RENEW API......................................................................................................................................37


U.1 GET RENEW DEFAULT SETTINGS........................................................................................................................37
U.2 RENEW...............................................................................................................................................................38

SECTION V – TICKETS API....................................................................................................................................47


V.1 RAISE TICKET ...................................................................................................................................................47
V.2 GET TICKET BY STATUS ....................................................................................................................................48
V.3 SEND MESSAGE .................................................................................................................................................50
V.4 GET TICKET DETAILS BY TICKETID ...................................................................................................................51
V.5 CLOSE TICKET BY TICKETID .............................................................................................................................53

SECTION W – ACCOUNTS API.............................................................................................................................55


W.1 GET ACCOUNT DETAILS...................................................................................................................................55
W.2 GET SUB ACCOUNTS API DETAILS..................................................................................................................64

SECTION X – PROFILES DETAILS API..............................................................................................................56


X.1 GET ALL PROFILE IDS...................................................................................................................................56
X.2 GET PROFILE DETAILS...................................................................................................................................57

SECTION Y – ZOHO WEBHOOK API..................................................................................................................61


Y.1 BLOCK / UNBLOCK USERS................................................................................................................................61
API Usage Guide API-Document Page 4 of 68

SECTION A – AUTHENTICATION STEPS

A.1 GENERAL INFORMATION

Use HTTP Basic Authentication (http://en.wikipedia.org/wiki/Basic_access_authentication) for


all the API calls.

Link for accessing the API:


https://url
(or)
https://ip:8000

The url/ip is same as your dashboard`s url/ip

A.2 EXAMPLE

(Get Users API)

https://url/api/v1/get_users

A.3 CREDENTIALS

The API credentials can be found on /settings

Username is “API Token”


Password is “API Key”
API Usage Guide API-Document Page 5 of 68

SECTION B – ADD USER API

B.1 CLOUD BASED ACCOUNT

To add an user send a post request to /api/v1/add_user with the following data :

Key Mandatory Value


userGroupId Yes Numeric
userName Yes String
password No String
userState No {active, blacklisted}
activationDate No {custom, now}
expirationDate No {custom, never}
dd-mm-yyyy H:m , <will be used only when
customActivationDate No
'activationDate' is set as 'custom'>
dd-mm-yyyy H:m, <will be used only when
customExpirationDate No
'expirationDate' is set as 'custom'>
phoneNumber No Numeric
emailId No String
API Usage Guide API-Document Page 6 of 68

B.2 ISP BASED ACCOUNT

To add an user send a post request to /api/v1/add_user with the following data :

Key Mandatory Value


userGroupId Yes Numeric
userName Yes String
password No String
userState No {active, blacklisted}
userType No {home, business}
activationDate No {custom, now}
expirationDate No {custom, never}
dd-mm-yyyy H:m , <will be used only when
customActivationDate No
'activationDate' is set as 'custom'>
dd-mm-yyyy H:m, <will be used only when
customExpirationDate No
'expirationDate' is set as 'custom'>
phoneNumber No Numeric
emailId No String
firstName No String
lastName No String
altPhoneNumber No Numeric
altEmailId No String
address_line1 No String
address_line2 No String
address_city No String
address_pin No Numeric
address_state No String
address No String
API Usage Guide API-Document Page 7 of 68

SECTION C – EDIT USER API

C.1 CLOUD BASED ACCOUNT

To edit an user send a post request to /api/v1/add_user with the following data :

Key Mandatory Value


Numeric <Id of the user returned when user is
userId Yes
added>
userGroupId No Numeric
userName No String
password No String
userState No {active, blacklisted}
activationDate No {custom, now}
expirationDate No {custom, never}
dd-mm-yyyy H:m , <will be used only when
customActivationDate No
'activationDate' is set as 'custom'>
dd-mm-yyyy H:m, <will be used only when
customExpirationDate No
'expirationDate' is set as 'custom'>
phoneNumber No Numeric
emailId No String
API Usage Guide API-Document Page 8 of 68

C.2 ISP BASED ACCOUNT

To edit an user send a post request to /api/v1/add_user with the following data :

Key Mandatory Value


Numeric <Id of the user returned when user is
userId Yes
added>
userGroupId No Numeric
userName No String
password No String
userState No {active, blacklisted}
activationDate No {custom, now}
expirationDate No {custom, never}
dd-mm-yyyy H:m , <will be used only when
customActivationDate No
'activationDate' is set as 'custom'>
dd-mm-yyyy H:m, <will be used only when
customExpirationDate No
'expirationDate' is set as 'custom'>
phoneNumber No Numeric
emailId No String
firstName No String
lastName No String
altPhoneNumber No Numeric
altEmailId No String
address_line1 No String
address_line2 No String
address_city No String
address_pin No Numeric
address_state No String
address No String
id_proof No {pan, license, aadhar, ration, passport, voter}
id_pin No String
afterAction No {suspend, nothing}
comments No String
API Usage Guide API-Document Page 9 of 68

SECTION D – GET ALL USERS OF AN ACCOUNT API


D.1 GENERAL INFORMATION

GET Method :

/api/v1/get_users

D.2 Sample Output

{
"status": "success",
"data": [
[
{
"User": {
"id": "3071",
"username": "samandrew",
"groupId": "90",
"status": "active",
"name": "Sam",
"phone": "9999999999",
"email": "sam@example.com",
"address": "",
"comments": "",
"activationTime": "2014-11-10 13:34:00",
"expirationTime": "2018-11-10 13:34:00"
}
},
{
"staticIpMac": [
{
"staticIpAddress": "10.0.0.10",
"staticIpBoundMac": "64:27:37:af:e3:4d"
},
{
"staticIpAddress": "10.0.0.12",
"staticIpBoundMac": "64:27:37:af:e3:4E"
}
API Usage Guide API-Document Page 10 of 68

]
}
]
]
}
API Usage Guide API-Document Page 11 of 68

SECTION E -- GET USER DETAILS API

E.1 GENERAL INFORMATION

GET Method :
/api/v1/get_details/<user_id>

E.2 Sample Output

"status":"success",

"data":[

"User":{

"id":"17766",

"username":"31508205064",

"groupId":"635",

"status":"terminated",

"name":"john",

"phone":"9999999999",

"email":"john@gmai.com",

"address":"",

"comments":"“Chief at Tech Park”",

"activationTime":"2015-03-06 19:27:58",

''createdTime'':''2016-04-18 00:00:00'',

"expirationTime":"2016-03-06 00:00:30",
API Usage Guide API-Document Page 12 of 68

"timezone":"Asia/Kolkata"

},

"currentBillingCycleUsage":{

"bandwidthTemplateId":"11",

"bandwidthTemplateName":"4048/4048",

"billingStartDate":"2015-06-07 00:00:00",

"billingEndDate":"2015-07-07 00:00:00",

"uploadDataUsage":"0",

"downloadDataUsage":"0",

"totalDataUsage":0,

"dataLimit":"104857600"

},

"staticIpMac":[

}
API Usage Guide API-Document Page 13 of 68

SECTION F -- SESSION DATA API

F.1 GENERAL INFORMATION

Configure URL on /settings under “Url to post session data”.


The details of active sessions is POSTed to the configured URL every 10 minute.

F.2 Sample Output

[1] => Array

[UserSession] => Array

[id] => 27426

[user_id] => 8882

[start_time] => 2015-04-07 21:02:05

[stop_time] => 2015-04-07 22:02:05

[ip_addr] => 10.11.12.157

[mac] => 00:27:0e:02:2d:63

[download_bytes] => 17170044

[upload_bytes] => 2012947

[current_bandwidth] => 512000/512000

[nas_ip_address] => 123.63.205.117

[nas_mac] => d4:ca:6d:0b:34:ac

[download_rate] => 0

[upload_rate] => 0
API Usage Guide API-Document Page 14 of 68

[terminate_cause]=>'Disconnected by admin'

[User] => Array

[user_group_id] => 216

)
API Usage Guide API-Document Page 15 of 68

SECTION G – GET BALANCE API

G.1 GENERAL INFORMATION

GET Method :
/api/v1/get_balance/<user_id>

G.2 Sample Output

{
"status": “success”,
“balance”:”146.67”,
“username”:”test1234”
}
API Usage Guide API-Document Page 16 of 68

SECTION H – MAKE PAYMENT API

H.1 GENERAL INFORMATION

To make payment for an user send a post request to


/api/v1/make_payment with the following data:

Key Value
userId Numeric <Id of the user to make payment>
amount Numeric <amount to be paid in decimal>
(cash, cheque, creditCard, bankTransfer,
method
onlinePayment, debitCard, externalGateway)
paymentDate dd-mm-yyyy
bank Text, <for method cheque else null>
chequeNumber Text, <for method cheque else null>
chequeDate dd-mm-yyyy, <for method cheque else null>
notes Payment notes
cardExpiration Text, <Credit / debit card number>
bankTransferMethod Text, <Bank transfer method>
operator Text, <External gateway operator>
merchantTxnId Text, <External gateway transaction Id>

H.2 Sample Output

{
"status": “success”,
“message”:”Make payment successful”
}
API Usage Guide API-Document Page 17 of 68

SECTION I -- GET USER SESSION DETAILS API

I.1 GENERAL INFORMATION

GET Method :
/api/v1/get_usersession_details/<user_id> with the following data:
Input:
Argument Value
userId Numeric <Id of the user>

I.2 Sample Output

{
“session details as json encoded”
}
API Usage Guide API-Document Page 18 of 68

SECTION J – CHANGE BILLING CYCLE API


J.1 GENERAL INFORMATION

GET Method :
/api/v1/change_billing_cycle/<user_id> with the following data:

GET Method :
/api/v1/change_billing_cycle/<user_id>/<billing_period> with the following data:
Input:
Argument Value
userId Numeric <Id of the user>
billingPeriod Text <monthly, weekly, daily>

J.2 Sample Output

{
"status":“success”,
“message”:”billing cycle updated”
}
API Usage Guide API-Document Page 19 of 68

SECTION K – ADD FUP QUOTA TO USER API


K.1 GENERAL INFORMATION

To add FUP quota to user send a post request to /api/v1/add_fup_quota with the following data:

Key Value
userId Numeric <Id of the user to be edited>
quota Numeric <value in bytes>

K.2 Sample Output

{
"status" : “success”,
“message” : ”FUP quota added successfullly”
}
API Usage Guide API-Document Page 20 of 68

SECTION L – CHECK USER EXSIST BY ID API


L.1 GENERAL INFORMATION

GET Method:
/api/v1/user_exists/<user_id>

L.2 Sample Output

{
"status": 1
}
API Usage Guide API-Document Page 21 of 68

SECTION M – CHECK USER EXSIST BY USERNAME API


M.1 GENERAL INFORMATION

GET Method:
/api/v1/user_exists_by_username/<user_name>

M.2 Sample Output

{
"status": 0
}
API Usage Guide API-Document Page 22 of 68

SECTION N – GET PREVIOUS DURATION CYCLE API


N.1 GENERAL INFORMATION

To get previous duration cycle for an user send a post request to


/api/v1/previous_duration_cycle with the following data:

Key Value
userId Numeric <Id of the user >
resetType Text <monthly, weekly, daily>
startDate dd-mm-yyyy

N.2 Sample Output

[
{

"0":{

"duration":"2 hours 49 minutes 24 seconds"

},

"endDate":"01-10-2015",

"startDate":"01-09-2015"

},

"0":{

"duration":"23 minutes 56 seconds"

},

"endDate":"01-09-2015",

"startDate":"01-08-2015"

}
]
API Usage Guide API-Document Page 23 of 68

SECTION O – GET PREVIOUS DATA CYCLE API


O.1 GENERAL INFORMATION

To get previous data cycle for an user send a post request to


/api/v1/previous_data_cycle with the following data:

Key Value
userId Numeric <Id of the user >
resetType Text <monthly, weekly, daily>
startDate dd-mm-yyyy

O.2 Sample Output

"0":{

"download":"43.12 GB",

"upload":"16.28 GB",

"total":"59.4 GB"

},

"endDate":"06-10-2015",

"startDate":"06-09-2015"

},

"0":{

"download":"24.75 GB",

"upload":"3.64 GB",
API Usage Guide API-Document Page 24 of 68

"total":"28.39 GB"

},

"endDate":"06-09-2015",

"startDate":"06-08-2015"

},

"0":{

"download":"1.49 GB",

"upload":"1.05 GB",

"total":"2.54 GB"

},

"endDate":"06-08-2015",

"startDate":"06-07-2015"

]
API Usage Guide API-Document Page 25 of 68

SECTION P – RESET PASSWORD API


P.1 GENERAL INFORMATION

To reset password for an user send a post request to


/api/v1/reset_password with the following data:

Key Value Is Required


userId Numeric <Id of the user > Mandatory
Optional if
Text {numeric, characters, alphanumeric}
complexity Password field
<default value is 'numeric'>
is given
Optional if
Numeric
length Password field
<default value is 4>
is given
password Alphanumeric Optional

P.2 Sample Output

"status":"success",

"message":"Password has been reset. The new password is 8515550701",

"password":"8515550701"

}
API Usage Guide API-Document Page 26 of 68

SECTION Q – SEND PASSWORD API


Q.1 GENERAL INFORMATION

GET Method:
/api/v1/send_password/<user_id>/<method>/<template>
Input:
Argument Value
userId Numeric <Id of the user>
Text {sms}
method
<default value is 'sms'>
Text {otp, user_receipt}
template
<default value is 'otp'>

Q.2 Sample Output

"status":"success",

"message":"Password is sent"

}
API Usage Guide API-Document Page 27 of 68

SECTION R – AUTHENTICATE USER API


R.1 GENERAL INFORMATION

To authenticate an user a post request needs to be generated to action URL


/login/authenticate_user with the following form-data:

Key Value Is Required


username Alphanumeric Mandatory
password Alphanumeric Mandatory
auth_type Alphanumeric Mandatory
mac Alphanumeric Optional
redirect_url Alphanumeric Optional
challenge Alphanumeric Optional
API Usage Guide API-Document Page 28 of 68

SECTION S – PAYMENT DETAILS API


S.1 GET ALL PAYMENT IDs

GET Method :
/api/v1/get_all_payment_ids/<fromDate>/<toDate> with the following data:

Input :

Argument Value
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :

{
"300":300,
"301":301,
"302":302,
"400":400,
"401":401,
"600":600,
"303":303
}
API Usage Guide API-Document Page 29 of 68

S.2 GET PAYMENT DETAILS

GET Method :
/api/v1/get_payment_details/<userId> with the following data:

Input :

Argument Value
userId Numeric <Id of the user>

Sample Output :

{ "customerNumber":"2"
}
{ "Payment":
{ "id":7400,
"amount":"50.0000000000",
"create_datetime":"2016-03-23 12:06:03.156+05:30"
}},
{ "PaymentInvoice":
{ "payment_id":7400,
"invoice_id":14700
}},
{ "PaymentInfoCheque":
{ "payment_id":7400,
"bank":"Cash"
}}
API Usage Guide API-Document Page 30 of 68

S.3 GET PAYMENT DETAILS BY DATE

GET Method :
/api/v1/get_payment_details_by_date/<fromDate>/<toDate> with the following data:

Input :

Argument Value
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :

[[{
"customer_number":"1",
"user_id":"1",
"payment_id":200,
"amount":"115.0000000000",
"payment_date":"2016-09-08 19:23:04.693+05:30",
"invoices":
[{
"invoice_id":100
}],
"payment_type":"Payment gateway"
}]]
API Usage Guide API-Document Page 31 of 68

S.4 GET PAYMENT DETAILS BY USERID AND DATE

GET Method :
/api/v1/get_payment_details_by_userid_and_date/<userId>/<fromDate>/<toDate> with the
following data:

Input :

Argument Value
userId Numeric <Id of the user>
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :

{ "customerNumber":"2"
}
{ "Payment":
{ "id":7400,
"amount":"50.0000000000",
"create_datetime":"2016-03-23 12:06:03.156+05:30"
}},
{ "PaymentInvoice":
{ "payment_id":7400,
"invoice_id":14700
}},
{ "PaymentInfoCheque":
{ "payment_id":7400,
"bank":"Cash"
}}
API Usage Guide API-Document Page 32 of 68

S.5 GET PAYMENT LOGS

GET Method :
/api/v1/get_payment_logs/<userId> with the following data:

Input :

Argument Value
userId Numeric <Id of the user>

Sample Output :
Note: This is a sample transaction, may differ based on the external payment gateway which user
chooses.

{ "ExternalPayment":{
"merchantTxnId":"56eddfdf3355d71458219261",
"gateway_txn_id":"2534341604",
"details":"{\u0022txn_status\u0022:\u00220300\u0022,\u0022txn_msg\u002
2:\u0022success\u0022,\u0022txn_err_msg\u0022:\u0022NA\u0022,\u0022clnt_tx
n_ref\u0022:\u002256easdqq55d71458219261\u0022,\u0022tpsl_bank_cd\u0022:\
u00221110\u0022,\u0022tpsl_txn_id\u0022:\u0022333321604\u0022,\u0022txn_a
mt\u0022:\u00221.01\u0022,\u0022clnt_rqst_meta\u0022:\u0022{itc:email}
{custname:user_name}\u0022,\u0022tpsl_txn_time\u0022:\u002217-03-2016
18:24:28\u0022,\u0022tpsl_rfnd_id\u0022:\u0022NA\u0022,\u0022bal_amt\u0022
:\u0022NA\u0022,\u0022rqst_token\u0022:\u002254849facd9-0917-43fa-b37a-
74543a361007\u0022,\u0022hash\u0022:\u0022f112a87af8544a662a3b77abeb132
e96e65bd228\u0022}",
"number":"INR",
"operator":"techprocess-pay"
}}
API Usage Guide API-Document Page 33 of 68

S.6 GET PAYMENT LOGS BY DATE

GET Method :
/api/v1/get_payment_logs_by_date/<fromDate>/<toDate> with the following data:

Input :

Argument Value
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :
Note: This is a sample transaction, may differ based on the external payment gateway which user
chooses.

{ "ExternalPayment":{
"merchantTxnId":"56eddfdf3355d71458219261",
"gateway_txn_id":"2534341604",
"details":"{\u0022txn_status\u0022:\u00220300\u0022,\u0022txn_msg\u002
2:\u0022success\u0022,\u0022txn_err_msg\u0022:\u0022NA\u0022,\u0022clnt_tx
n_ref\u0022:\u002256easdqq55d71458219261\u0022,\u0022tpsl_bank_cd\u0022:\
u00221110\u0022,\u0022tpsl_txn_id\u0022:\u0022333321604\u0022,\u0022txn_a
mt\u0022:\u00221.01\u0022,\u0022clnt_rqst_meta\u0022:\u0022{itc:email}
{custname:user_name}\u0022,\u0022tpsl_txn_time\u0022:\u002217-03-2016
18:24:28\u0022,\u0022tpsl_rfnd_id\u0022:\u0022NA\u0022,\u0022bal_amt\u0022
:\u0022NA\u0022,\u0022rqst_token\u0022:\u002254849facd9-0917-43fa-b37a-
74543a361007\u0022,\u0022hash\u0022:\u0022f112a87af8544a662a3b77abeb132
e96e65bd228\u0022}",
"number":"INR",
"operator":"techprocess-pay"
}}
API Usage Guide API-Document Page 34 of 68

S.7 GET PAYMENT LOGS BY USERID AND DATE

GET Method :
/api/v1/get_payment_logs_by_userid_and_date/<userId>/<fromDate>/<toDate> with the
following data:

Input :

Argument Value
userId Numeric <Id of the user>
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :
Note: This is a sample transaction, may differ based on the external payment gateway which user
chooses.

{ "ExternalPayment":{
"merchantTxnId":"56eddfdf3355d71458219261",
"gateway_txn_id":"2534341604",
"details":"{\u0022txn_status\u0022:\u00220300\u0022,\u0022txn_msg\u002
2:\u0022success\u0022,\u0022txn_err_msg\u0022:\u0022NA\u0022,\u0022clnt_tx
n_ref\u0022:\u002256easdqq55d71458219261\u0022,\u0022tpsl_bank_cd\u0022:\
u00221110\u0022,\u0022tpsl_txn_id\u0022:\u0022333321604\u0022,\u0022txn_a
mt\u0022:\u00221.01\u0022,\u0022clnt_rqst_meta\u0022:\u0022{itc:email}
{custname:user_name}\u0022,\u0022tpsl_txn_time\u0022:\u002217-03-2016
18:24:28\u0022,\u0022tpsl_rfnd_id\u0022:\u0022NA\u0022,\u0022bal_amt\u0022
:\u0022NA\u0022,\u0022rqst_token\u0022:\u002254849facd9-0917-43fa-b37a-
74543a361007\u0022,\u0022hash\u0022:\u0022f112a87af8544a662a3b77abeb132
e96e65bd228\u0022}",
"number":"INR",
"operator":"techprocess-pay"
}}
API Usage Guide API-Document Page 35 of 68

SECTION T – INVOICE DETAILS API


T.1 GET ALL INVOICE IDs

GET Method :
/api/v1/get_all_invoice_ids/<fromDate>/<toDate> /<status>with the following data:

Input :

Argument Value
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>
Status (Optional) String Keyword <“paid”, “unpaid”>

Sample Output :

{
"12960":12960,
"12961":12961,
"12855":12855
}
API Usage Guide API-Document Page 36 of 68

T.2 GET INVOICE DETAILS

GET Method :
/api/v1/get_invoice_details/<invoiceId> with the following data:

Input :

Argument Value
invoiceId Numeric <Id of the invoice>

Sample Output :
[{

"invoiceNumber":"10",

"amount":"16.6666666665",

"description":"Product1 Period from 09\/26\/2016 to 09\/30\/2016",

"billGeneratedDate":"2016-09-26 00:00:00+05:30",

"detailsOfInvoice": [ "", {

"amount": "799.00",

"description": "799 metro plus - Period from 01 Oct 2015 to 31 Oct 2015" }, {

"amount": "111.86",

"description": "Service Tax" } ],

"name":"",

"user_id":"8",

"circuit_id":"8",

"billingPeriodFrom":"2016-09-26",

"billingPeriodTo":"2016-09-30",

"billingDueDate":"2016-10-10"

}]
API Usage Guide API-Document Page 37 of 68

SECTION U – RENEW API


U.1 GET RENEW DEFAULT SETTINGS

POST Method :
To get the renew default settings, send a post request to
/api/v1/renew_default_settings with the following data:

Input :

Argument Value
userBillingId Numeric <Billing Id of the user>

Sample Output :

{"amount":"114.50"},

{"oneClickRenew":1,
"renewFromPresentDate":1,
"renewForPaidUsers":1,
"payAsYouGoDays":"2",
"disableRenewWithDays":1}

]
API Usage Guide API-Document Page 38 of 68

U.2 RENEW

POST Method :
To renew a user, send a post request to
/api/v1/renew with the following data:

Input :

Argument Value
userId Numeric <Id of the user>

Additional Inputs :

Argument Value
renewDefaultSettings String < with a keyword “true”>
isForceMakePayment String < with a keyword “true”>
isRenewPresentDate String < with a keyword “true”>
isRenewPaidUsers String < with a keyword “true”>
isRenewWithDays String < with a keyword “true”>
payAsYouGoDays Numeric <Number of days to renew>
isChangePlan String < with a keyword “true”>
planId Numeric <Plan Id of the plan>
groupId Numeric <Group Id of the group>
isPreviousGroupchange String < with a keyword “true”>
renewPeriod String < “days” or “months” >
renewTimes Numeric <Number of times to renew>
String < with a keyword (cash, cheque,
creditCard, bankTransfer,
paymentType

onlinePayment, debitCard, externalGateway) >


paymentTypeVal1 Method Variable
Cash Collected by
Cheque Bank
CreditCard Card Number
DebitCard Card Number
BankTransfer NEFT / IMPS
OnlinePayment Notes
ExternalPayment Operator
API Usage Guide API-Document Page 39 of 68

Cheque Cheque Number


CreditCard Card Expiration
paymentTypeVal2 DebitCard Card Expiration
ExternalPayment Transaction ID
paymentTypeVal3 Cheque Cheque Date

Sample Output :

{"status":"success","message":"Renewal Successful for the user username"}


API Usage Guide API-Document Page 40 of 68

E.3 GET ALL USER DETAILS

GET Method :
/api/v1/get_all

Sample Output :

{"User":
{"id":"1","username":"testuser","groupId":"5","status":"active","name":"","phone"
:"","email":"","address_line1":"","address_line2":"","address_city":"","address_pin
":"","address_state":"","comments":"","activationTime":"2016-06-29
19:21:27","expirationTime":"2016-08-24
00:00:00","billing_id":"112","type":"","modified":"2016-06-29
19:21:32","company_name":"jaze_networks"}},{"currentBillingCycleUsage":
{"billingResetType":"payAsYouGo","billingStartDate":"2016-08-04
00:00:00","billingEndDate":"2016-08-24
00:00:00","uploadDataUsage":"0","downloadDataUsage":"0","totalDataUsage":0,"
usedBandwidthQuota":0,"totalBandwidthQuota":0}},{"staticIpMac":[]}
API Usage Guide API-Document Page 41 of 68

E.5 GET ALL GROUP DETAILS

GET Method :
/api/v1/get_group_details

Sample Output :

{"status":"success","data":
[{"Group_id":"3","Group_name":"Guest","Profile_id":"3","Profile_Name":"Guest
profile","Active_Users":0,"Total_Users":0},
{"Group_id":"5","Group_name":"General 1Mbps
Group","Profile_id":"5","Profile_Name":"General 1Mbps
Profile","Active_Users":7,"Total_Users":7},
{"Group_id":"6","Group_name":"General 2Mbps
Group","Profile_id":"6","Profile_Name":"General 2Mbps
Profile","Active_Users":4,"Total_Users":4},
{"Group_id":"7","Group_name":"General 3Mbps
Group","Profile_id":"7","Profile_Name":"General 3Mbps
Profile","Active_Users":4,"Total_Users":4},
{"Group_id":"15","Group_name":"Carried Invoice
Group","Profile_id":"15","Profile_Name":"Carried Invoice
Profile","Active_Users":10,"Total_Users":10}]}
API Usage Guide API-Document Page 42 of 68

Q.3 UPDATE SMS STATUS

POST Method :
/api/v1/update_sms_status

Input :

Argument Value
smsId Numeric <SMS Id of the sms>
statusCode Numeric <status code of the sms>
message String <Message of the sms>
operator String <Name of the operator>

Sample Output :

"success"
API Usage Guide API-Document Page 43 of 68

T.3 GET ALL INVOICES FROM USER ID

GET Method :
/api/v1/get_all_invoices_from_userid/<userId>/<status> with the following data:

Input :

Argument Value
userId Numeric <Id of the user>
status (Optional) String Keyword <“paid” or “unpaid”>

Sample Output :

[{"2109":2109,"2302":2302,"2704":2704}]
API Usage Guide API-Document Page 44 of 68

K.3 GET FUP DETAILS

GET Method :
/api/v1/get_fup_details/<userId>/<FromDate>/<ToDate> with the following data:

Input :

Argument Value
userId Numeric <Id of the user>
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>

Sample Output :

[{"id":"3","user_id":"3","account_id":"local2","quota":"+1","units":"gb","price":n
ull,"fup_data_when_added":null,"date_created":"2016-07-21 12:35:01"}
API Usage Guide API-Document Page 45 of 68

E.4 GET ALL USER DETAILS BY DATE

GET Method :
/api/v1/get_users_by_date/<fromDate>/<toDate>/<basedOn> with the following data:
Here the users are filtered based on the modified date in default.
The optional field “basedOn” used to filter based on created date or modified date.

Input :

Argument Value
fromDate From Date <Date Format yyyy-mm-dd>
toDate To Date <Date Format yyyy-mm-dd>
basedOn String keyword(“created” or “modified”)

Sample Output :

{ "status":"success",
"data":
[{"id":"533","username":"sekark","groupId":"49","status":"suspended","name":"S
EKAR","phone":"9745741812","email":"testid@gmail.com","address_line1":"31
mainroad,","address_line2":"","address_city":"chennai","address_pin":"621729","a
ddress_state":"TAMILNADU","comments":"","activationTime":"2016-04-18
00:00:00",''createdTime'':''2016-04-18 00:00:00'',"expirationTime":"2999-12-31
23:59:59","billing_id":"279","type":"home","modified":"2016-09-01
17:00:08","company_name":null,"staticIp":[]}
API Usage Guide API-Document Page 46 of 68

A.4 USER AUTHENTICATION

POST Method :
/api/v1/authenticate_user with the following POST data:

Input :

Argument Value
username Login user name of the user
password Password for the user

Sample Output :

[ "success",
"1"
]
API Usage Guide API-Document Page 47 of 68

SECTION V – TICKETS API


V.1 RAISE TICKET

POST Method :
/api/v1/raise_ticket with the following POST data:
Input :

Argument Value
type String <Name of the ticket type>
subject String <Name of the ticket subject>
priority Text <low, medium, high, urgent>
userId Numeric <Id of the user>
comments String <Issue>

Sample Output :

{
"status": "success",
"message": "Your ticket with the ID 91 has been raised. Please wait for the
response and note the ticket Id for future reference.",
"ticketId": "91"
}
API Usage Guide API-Document Page 48 of 68

V.2 GET TICKETS BY STATUS

GET Method :
/api/v1/get_tickets/<userId>/<status> with the following data:
Here the tickets are filtered based on the status.

Input :

Argument Value
userId Numeric <Id of the user>
Text <unresolved, overdue, duetoday, open,
status
onhold, unassigned, closed>

Sample Output :

{
"status": "success",
"data": [
{
"Ticket": {
"id": "11",
"account_id": "jazenetworks",
"user": "6",
"subject": "Unable to pay online",
"type": "Payment",
"priority": "medium",
"due": "2016-11-22 05:01:51",
"status": "unassigned",
API Usage Guide API-Document Page 49 of 68

"assigned_to": "test@gmail.com",
"group_name": "Payment",
"created": "2016-11-21 17:01:51"
}
},
{
"Ticket": {
"id": "12",
"account_id": "jazenetworks",
"user": "6",
"subject": "Unable to pay online",
"type": "Payment",
"priority": "medium",
"due": "2016-11-22 05:03:23",
"status": "unassigned",
"assigned_to": "NULL",
"group_name": "Payment",
"created": "2016-11-21 17:03:23"
}
}
]
}
API Usage Guide API-Document Page 50 of 68

V.3 SEND MESSAGE

POST Method :
/api/v1/send_message with the following POST data:

Input :

Argument Value
ticketId Numeric <Id of the ticket>
ticketMessage String <reply for the ticket>
sender Text <admin, user>
sender_name Numeric <Name of the sender>
showToUser Text <true, false>

Sample Output :

{
"status": "success",
"message": "The message has been sent to the <sender>"
}
API Usage Guide API-Document Page 51 of 68

V.4 GET TICKET DETAILS BY TICKETID

GET Method :
/api/v1/get_ticket_details/<ticketId> with the following data:

Input :

Argument Value
ticketId Numeric <Id of the ticket>

Sample Output :

{
"status": "success",
"message": {
"ticket_conversation": [
{
"sender": "user",
"sender_name": "max",
"ticket_message": "connection timeout",
"created": "2016-11-16 13:07:26",
"show_to_user": "0"
},
{
"sender": "admin",
"sender_name": "test@gmail.com",
"ticket_message": "ok. Looking on it",
"created": "2016-11-21 19:06:34",
API Usage Guide API-Document Page 52 of 68

"show_to_user": "0"
},
{
"sender": "admin",
"sender_name": "test@gmail.com",
"ticket_message": "issue is solved",
"created": "2016-11-21 19:07:11",
"show_to_user": "0"
}
],
"ticket_details": {
"status": "closed",
"assigned_to": "test@gmail.com",
"created": "2016-11-21 19:36:54"
}
}
}
API Usage Guide API-Document Page 53 of 68

V.5 CLOSE TICKET BY TICKETID

GET Method :
/api/v1/close_ticket/<ticketId> with the following data:

Input :

Argument Value
ticketId Numeric <Id of the ticket>

Sample Output :

{
"status": "success",
"message": "The ticket has been closed"
}
API Usage Guide API-Document Page 54 of 68

A.5 USER AUTHENTICATION FROM MY ACCOUNTS

POST Method :
/api/v1/authenticate_user_from_myaccounts with the following POST data:

Input :

Argument Value
username Login user name of the user
password Password for the user

Sample Output :

{
"username":"test",
"userId":"2",
"accountId":"jazenetworks"
}
API Usage Guide API-Document Page 55 of 68

SECTION W – ACCOUNTS API


W.1 GET ACCOUNTS API

GET Method :
/api/v1/get_account_details

Sample Output :

[ {
"accountId":"local3",
"accountName":"local3",
"apiKey":"cddb0d8f0da027aea083f75d16",
"companyName":"jazenetworks1",
"parentAccountId":"local1",
"dateCreated":"2016-09-23 13:42:30"
},
{
"accountId":"local1",
"accountName":"local1",
"apiKey":"4be9491968d7270a73233713",
"companyName":"jazenetworks1",
"parentAccountId":"jazenetworks",
"dateCreated":"2016-09-23 12:44:22"
} ]
API Usage Guide API-Document Page 56 of 68

SECTION X – PROFILE DETAILS API


X.1 GET ALL PROFILE IDs

GET Method :
/api/v1/get_all_profile_ids

Sample Output :

[
{
"Profile": {
"id": "2",
"name": "Guest profile"
}
},
{
"Profile": {
"id": "3",
"name": "1mbps"
}
}
]
API Usage Guide API-Document Page 57 of 68

X.2 GET PROFILE DETAILS

GET Method :
/api/v1/get_profile_details/<profileId> with the following data:

Input :

Argument Value
profileId Numeric <Id of the profile>

Sample Output :

{
"status": "success",
"message": {
"profile Details": [
{
"property": "Reset billing cycle",
"value": "weekly"
},
{
"property": "Day of the week to reset billing cycle",
"value": "Sunday"
},
{
"property": "Day of the week to reset billing cycle",
"value": "Sunday"
},
{
API Usage Guide API-Document Page 58 of 68

"property": "Account Expiry",


"value": "30 minutes from first login"
},
{
"property": "Bandwidth",
"value": "1mbps template"
},
{
"property": "Billing Type ",
"value": "Enterprise Billing"
}
],
"billing Details": [
{
"property": "description",
"value": "1mbps"
},
{
"property": "period",
"value": "1month(s)"
},
{
"property": "description",
API Usage Guide API-Document Page 59 of 68

"value": "servicetax"
},
{
"property": "period",
"value": "1month(s)"
},
{
"property": "period",
"value": "1month(s)"
},
{
"property": "Total Price",
"value": 1000
}
]
}
}
API Usage Guide API-Document Page 60 of 68

E.6 GET ALL USER IDS

GET Method :
/api/v1/get_all_user_ids

Sample Output :

[
"5",
"6",
"8",
"9",
"10",
"11"
]
API Usage Guide API-Document Page 61 of 68

SECTION Y – ZOHO WEBHOOK API


Y.1 BLOCK / UNBLOCK USERS

GET & POST Method :


/api/v1/zoho/<type>/<action>
GET Data Input :

Argument Value
type “phone” or “email”
action “block” or “unblock”

with the following POST data:


POST Data Input :

Argument Value
{"contact_persons_details":
{"phone":"9876543210"}}

JSONString or

{"contact_persons_details":
{"email":"example@example.com"}}

Sample Output :

{
"status": "success",
"message": "The user has been unblocked"
}
{
"status": "success",
"message": "The user has been blocked"
}
API Usage Guide API-Document Page 62 of 68

E.7 GET ALL USER IDs BY PHONE

POST Method :
/api/v1/get_users_by_phone with the following POST data:

Input :

Argument Value Is Required


<numeric value of the phone
phone Mandatory
number>
<string with a keyword
'active', 'pending', 'rejected',
'expired', 'pending-approval',
status Optional
'deleted', 'blocked',
'blacklisted', 'terminated',
'suspended'>

Sample Output :

[
"success":"2,3"
]
API Usage Guide API-Document Page 63 of 68

E.8 GET ALL USER DETAILS BY PHONE

GET Method :
/api/v1/get_user_by_phone/<phone>/<status> with the following data:

Input :

Argument Value Is Required


<numeric value of the phone
phone Mandatory
number>
<string with a keyword
'active', 'pending', 'rejected',
'expired', 'pending-approval',
status Optional
'deleted', 'blocked',
'blacklisted', 'terminated',
'suspended'>

Sample Output :

{ "status":"success",
"data":
[{"id":"533","username":"sekark","groupId":"49","status":"suspended","name":"S
EKAR","phone":"9745741812","email":"testid@gmail.com","address_line1":"31
mainroad,","address_line2":"","address_city":"chennai","address_pin":"621729","a
ddress_state":"TAMILNADU","comments":"","activationTime":"2016-04-18
00:00:00","expirationTime":"2999-12-31
23:59:59","billing_id":"279","type":"home","modified":"2016-09-01
17:00:08","company_name":null,"staticIp":[]}
API Usage Guide API-Document Page 64 of 68

W.2 GET SUB ACCOUNTS API DETAILS

GET Method :
/api/v1/get_sub_account_apis
Sample Output :

{
"status": "success",
"message": [
{
"Account": {
"company_name": "ABC Technologies",
"api_token": "abctech",
"api_key": "87bef06b612c39d6b8315f90ed0248bdd96903ef"
}
},
{
"Account": {
"company_name": "XYZ Technologies",
"api_token": "xyztech",
"api_key": "c3f1eee7fb1553533c7c6ed8624373465d9ec17a"
}
}
]
}
API Usage Guide API-Document Page 65 of 68

E.9 GET USER DETAILS BY USERNAME

GET Method :
/api/v1/get_user_by_username/<username> with the following data:

Input :

Argument Value Is Required


username <string value of the username> Mandatory

Sample Output :

{
[{"id":"533","username":"sekark","groupId":"49","status":"suspended","name":"S
EKAR","phone":"9745741812","email":"testid@gmail.com","address_line1":"31
mainroad,","address_line2":"","address_city":"chennai","address_pin":"621729","a
ddress_state":"TAMILNADU","comments":"","activationTime":"2016-04-18
00:00:00","expirationTime":"2999-12-31
23:59:59","billing_id":"279","type":"home","modified":"2016-09-01
17:00:08","company_name":null,"staticIp":[]
}
API Usage Guide API-Document Page 66 of 68

I.3 GET ACTIVE USER SESSION DETAILS

GET Method :
/api/v1/get_active_usersession_details/<user_id> with the following data:
Input:
Argument Value
userId Numeric <Id of the user>

I.2 Sample Output

{
“session details as json encoded”
}
API Usage Guide API-Document Page 67 of 68

F.3 DAY WISE DATA

POST Method :
/api/v1/day_wise_data with the following data:
Input:
Argument Value
userId Numeric <Id of the user>
startDate Start Date <Date Format dd-mm-yyyy>
endDate End Date <Date Format dd-mm-yyyy>

F.3 Sample Output

[
{
"download": "525.4 GB",
"upload": "4.22 GB",
"total": "529.62 GB",
"date": "05-09-2017"
}
],
[
{
"download": "4.23 GB",
"upload": "86.32 GB",
"total": "90.56 GB",
"date": "19-09-2017"
}
]
API Usage Guide API-Document Page 68 of 68

E.10 MOVE GROUP

To make payment for an user send a post request to


/api/v1/move_group with the following data:

Key Value
userId Numeric <Id of the user to make payment>
groupId Numeric <group Id of the user group to move>
String value with keyword <moveImmediately,
type previousBillingCycle, nextbillingCycle,
customDate>
customDateTo yyyy-mm-dd
clearUserDataUsage String value with keyword <yes or no >
clearUserPolicies String value with keyword <yes or no >
moveBilling String value with keyword <yes or no >

Sample Output

{
"status": “success”,
“message”:”The User 62148684 Moved”
}

You might also like