API Documentation


Chittragupta API

Chittragupta API enables you to create your own applications based on Chittragupta inner function you can call remotely via HTTP protocol, or call internally from Chittragupta modules. While you can write your own code to access the HTTP Chittragupta API service, All available methods are listed in documentation.
if you feel that some function is missing and any other query feel free to contact us info@alphainfolab.com

API Authentication

Chittragupta API methods requires authorization to use them. You can manage your API keys from your account. Your API keys carry many privileges, so be sure to keep them secret.

The API keys are different for your test site and your live site.you should remember that you should never expose your secret API key in any public website's client-side code.

How To Access

Access Link To use Chittragupta API use given url,

http://billing.alphainfolab/api/index.php
Access API key To access Chittragupta API Key :

Go to Chittragupta panel >> Login To Your Account >> Client >> Profile >> API key

How Its Work

Request

All operations specific to that resource are exposed. The methods accepts the input params as array. You could also pass the environment configuration specific to that request as an additional parameter.

$param = array (
"type"=>"admin",
"action"=>"add",
"group_id"=>"1",
"name"=>"Developer",
"email"=>"developer@gmail.com",
"pass"=>"123",
"api_key"=>"abcd123",
"admin_pass"=>"123" ,
);

Response

The response is in JSON format. JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object).

{
"result":
{"inserted_id":11},
"message":{"success":"Created New Staff Member"}
}

Sample Code

Request :
$param = array (
"type"=>"admin",
"action"=>"add",
"group_id"=>"1",
"name"=>"Developer",
"email"=>"developer@gmail.com",
"pass"=>"123",
"api_key"=>"abcd123",
"admin_pass"=>"123" ,
);

Response :
{
"result":
{"inserted_id":11},
"message":{"success":"Created New Staff Member"}
}

API Parameters

  • result : this is show your response of request or to happen as a consequence
  • message : A descriptive information about the error. This is for developer(/merchant) consumption and should not be used for showing errors to your customers.
  • inserted_id : If we perform an add action,so we can get the ID of the last inserted record immediately.

API Module

Admin

  • admin_group
  • admin
  • client_group
  • client
  • product_category
  • product
  • product_addon
  • product_promocode
  • invoice
  • order
  • kb_category
  • kb
  • support_ticket
  • public_ticket
  • canned_response_category
  • canned_response
  • blog
  • forum_category
  • forum
  • forum_topic

Client

  • profile
  • knowledge_base
  • blog
  • invoice
  • forum_category
  • forum_topic
  • forum
  • client_email
  • order
  • client_balance

API Action

Every action/method is use as "action"=>'method'

Method / Action Description Method use in given module
get To retrieve information you can use 'get' method. By giving 'id' or array of id. admin_group, admin, client_group, client, product_category, product, product_addon, invoice, order, kb_category, kb, support_ticket, public_ticket, canned_response_category, canned_response,blog, forum_category, forum, forum_topic, client_email, client_balance
add You can add data into database by using 'add' method. Some other parameters are also required to add details into database admin_group, admin, client_group, client, product_category, product, product_addon, product_promocode, invoice, order, kb_category, kb, public_ticket, support_ticket, canned_response_category, canned_response, blog, forum_category, forum, forum_topic
edit By using 'edit' method, you can edit/ update/ modify your added data, but using 'edit' method 'id' is must. admin_group, admin, client_group, client, product_category, product, product_addon, product_promocode, invoice, order, kb_category, kb, public_ticket, support_ticket, canned_response_category, canned_response, blog, forum_category, forum, forum_topic,profile
delete If you want to delete/ remove your data into database, you can use 'delete' method. admin_group, admin, client_group, client, product_category, product, product_addon, product_promocode, invoice, order, kb_category, kb, public_ticket, support_ticket, canned_response_category, canned_response, blog, forum_category, forum, forum_topic, profile
update_buyer_information 'update_buyer_information' method is related to invoice. In invoice module update/ modify information of buye, you can use 'update_buyer_information' method. invoice
renew_invoice To renew invoice in invoice module, you can use 'renew_invoice' method by giving id. invoice
get_invoice To get information about invoice,give id of invoice and use 'get_invoice' method. invoice
get_client_invoice If you want to know your client invoice details, you can use 'get_client_invoice' by giving 'client_id' (required parameter). invoice
change_status 'change_status' method is used to change status of order. order
get_client_order To know information about your client's order, you can use 'get_client_order'. order
create 'create' method is used to place your order by givinf 'product_id', 'client_id'. order
add_message In public ticket module, you can add messages / reply by using 'add_message' method support_ticket
close_ticket In support ticket module, you can change status to close, use 'close_ticket' method. By using this method your ticket is closed. support_ticket
reply 'reply' method is used to reply support ticket messages. support_ticket
post_message You can add your messages by using 'post_messages' method into forum topic. forum_topic
add_favoruite If you want to add favoruite forum into a favoruite forum list,you can use 'add_favoruite' method. forum_topic
remove_favoruite_forum Remove your favoruite forum from list , use 'remove_favoruite_forum' method. forum_topic
add_subscribe To add forum from subscribtion list use 'add_subscribe' method. forum_topic
remove_subscription If you want to remove forum from subscriber list ,use 'remove_subscription' method. forum_topic
change_password User want to change thier password (login password) from using 'change_password' method profile
get_category To get knowledge base category details use 'get_category' method knowledge_base
get_article Retrieve knowledge base details 'get_article' is useful. knowledge_base
resend If you want to resend your email use 'resend' method. client_email
client_balance You can check your balance using 'client_balance' method client_balance

Required parameters *

Some important notes :
* for admin console use - api_key, admin_pass .

* for client console use - api_key, client_pass.

* for given permission use array of permission - "permissions"=>array("client"=>1,"email"=>1) , 1 for enable permission

* while using 'add' method for 'admin' and if you want your admin is also become an account manager so at the time of add an admin use 'acc_manager'=>"on"

* status : please use smallcaps while giving status.

* admin/ admin_group/ product/ product_addon/ product_promocode/ forum_category/ forum/ forum_topic/ blog/ knowledge_base, use "status"=>"on" (for active )

* id : you can use get / delete method with more than one id or a single . For single id you can use : "id"=> 2, OR for multiple ids you can use : "id"=>("1,2,3")
Admin
Module get add edit delete update_buyer_information change_status add_message close_ticket reply post_message
admin_group group_id name group_id, name group_id -- -- -- -- -- --
admin id group_id, name, email, pass, id,group_id, name, email, pass, id -- -- -- -- -- --
client_group group_id name group_id, group_id -- -- -- -- -- --
client client_id client_group_id, first_name, last_name, email, country, state, currency_code, password, confirm_password client_id client_id -- -- -- -- -- --
product_category category_id title title, category_id category_id -- -- -- -- -- --
product id category_id, title, product_type category_id, id, title product_id -- -- -- -- -- --
product_addon id title title, id id -- -- -- -- -- --
product_promocode promo_id code, promo_type, value promo_id, code, promo_type, value promo_id -- -- -- -- -- --
invoice invoice_id client_id, status { paid | unpaid | refunded | cancel } invoice_id, client_id, status { paid | unpaid | refunded | cancel } invoice_id buyer_first_name, buyer_last_name, buyer_company, buyer_company_vat, buyer_company_number, buyer_country, buyer_state, buyer_city, buyer_address, buyer_phone, buyer_zip, buyer_email, invoice_id -- -- -- -- --
order order_id client_id ,product_id ,invoice_type ,status {pending_setup | setup_failed | active | suspended | cancelled } order_id, client_id ,product_id ,invoice_type ,status {pending_setup | setup_failed | active | suspended | cancelled } order_id -- order_id, status {pending_setup | setup_failed | active | suspended | cancelled } -- -- -- --
kb_category category_id title category_id, title category_id -- -- -- -- -- --
kb article_id category_id, title article_id, category_id, title id -- -- -- -- -- --
support_ticket ticket_id client_id, help_desk_id, subject, status, support_ticket_id support_ticket_id -- -- -- support_ticket_id, client_reply support_ticket_id, -- --
public_ticket ticket_id subject, receiver_name, email public_ticket_id, subject, receiver_name, email, status {open, close, on_hold} public_ticket_id -- -- public_ticket_id, client_reply public_ticket_id -- --
canned_response_category category_id title title, category_id category_id -- -- -- -- -- --
canned_response responce_id category_id, title response_id, category_id, title response_id -- -- -- -- response_id, reply --
blog id title, content id, title, content id -- -- -- -- -- --
forum_category id title id, title,status (on for active) id -- -- -- -- -- --
forum id category_id, title id, category_id, title id -- -- -- -- -- --
forum_topic topic_id forum_id, title topic_id, forum_id, title, status, sticky topic_id -- -- -- -- -- message, topic_id


Client
Module get edit change_password renew_invoice get_invoice get_client_invoice get_client_order create add_favoruite remove_favoruite_forum add_subscribe remove_subscription post_message get_category get_article resend client_balance
profile client_id client_id, first_name, last_name, dob, address_1, address_2, country, state, city, postcode client_id, password -- -- -- -- -- -- -- -- -- -- -- -- -- --
invoice -- -- -- client_id, order_id invoice_id client_id -- -- -- -- -- -- -- -- -- -- --
order order_id -- -- -- -- -- client_id client_id, product_id -- -- -- -- -- -- -- -- --
forum_category id -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
forum_topic topic_id -- -- -- -- -- -- -- topic_id topic_id topic_id topic_id title, message, forum_topic_id -- -- -- --
forum id -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
knowledge_base -- -- -- -- -- -- -- -- -- -- -- -- -- category_id article_id -- --
blog id -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
client_email id -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- email_id, client_id
client_balance client_id -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Examples:

type/module : admin_group
Request for add
$param = array( "api_key"=>"abcd1234", "admin_pass"=>"123" , "type"=>"admin_group", "action"=>"add", "name"=>"testing Group", "status"=>"on", "permissions"=>array("client"=>1) );

Response :
{
"result": {"inserted_id":1} ,"message":{"success":"Successfully Added"}
}

Request for edit
$param = array( "api_key"=>"abcd1234", "admin_pass"=>"123" , "type"=>"admin_group", "action"=>"edit", "group_id"=>1, "name"=>"testing Group", "status"=>"on", "permissions"=>array("client"=>1) );

Response :
{
"result":"null","message":{"success":"Updated Staff Member Group"}
}

Request for get
$param = array( "api_key"=>"abcd1234", "admin_pass"=>"123" , "type"=>"admin_group", "action"=>"get", "group_id"=>1, "name"=>"testing Group", "status"=>"on", "permissions"=>array("client"=>1) );

Response :
{
"result":{"id":"","name":"testing Group","permissions":"{\"client\":\"1\"}","active":"1","created_at":"1435557789","updated_at":null},"message":{"error":"null"}
}


Request for delete
$param = array( "api_key"=>"abcd1234", "admin_pass"=>"123" , "type"=>"admin_group", "action"=>"delete", "group_id"=>"1", );

Response :
{
"result":"null","message":{"success":" Removed Staff Member Group "}
}

Client

type/module : profile
Request for edit
$param = array( "type"=>"profile", "action"=>"edit", "client_id"=>1, "first_name"=>"first", "last_name"=>"client", "dob"=>"01-01-2010", "address_1"=>"xyz road", "address_2"=>"123 raod", "country"=>"India", "state"=>"Delhi", "city"=>"Delhi", "postcode"=>"110005", "api_key"=>"ab12", "client_pass"=>"123" );

Response :
{
"result":"null","message":{"success":"Successfully Updated"}
}

Request for get
$param = array( "type"=>"profile", "action"=>"get", "client_id"=>1, "api_key"=>"ab12", "client_pass"=>"123" , );

Response :
{
"result":{
"id":"1",
"client_group_id":"2",
"acc_manager":"1",
"pass":"202cb962ac59075b964b07152d234b70",
"status":"active",
"first_name":"first",
"last_name":"client",
"gender":"female",
"country_phonecode":"0731",
"phone":"452100",
"address_1":"xyz road",
"address_2":"123 raod",
"city":"Delhi",
"state":"Delhi",
"postcode":"110005",
"country":"India",
"ip":"103.23.124.2",
"api_token":"ab12",
}
,"message":""}

Request for change_password
$param = array( "type"=>"profile", "action"=>"change_password", "client_id"=>1, "password"=>123, "api_key"=>"ab12", "client_pass"=>"123" , );

Response :
{
"result":"null","message":{"success":"Successfully Updated"}
}