Developing Invitex API plugins

Invitex provides many "Native API Plugin" like LinkedIn, Gmail, Hotmail, Yahoo etc. Here is the developer document that will help you in building new API plugins.

Backend configuration:

The XML file of plugin must have two fields to store the Application key and secret key. In case of LinkedIn the plugin parameters looking like:

 API backend

Triggers in API plugins:

 Here is the short documentation of triggers which must be there in your plugin.

renderPluginHTML

      This is the Initial trigger that is called to provide the basic information in the form of an array about the plugin to the component.

 The array must contain following indexes:
 For example you create an array having name "Plug".

1.$plug['name'] : This is the Plugin name that will appear in the Invitex view in front end.In case of "TechjoomlaAPI LinkedIn plugin":

$plug['name']='LinkedIn'

and ,this is shown in frontend as:

plug info

2. $plug['api_used'] : The name of the plugin defines in XML file.

$plug['api_used']=$this->_name; 
//$this->_name gives you the name of the plugin defined in XML file.

3.$plug['message_type'] : This defines if plugin delivers Invites as Private/Direct messages,or Emails. If plugin send Email then this parameter should be set to "email" otherwise it should be set to "pm"

For LinkedIn:

$plug['message_type']='pm';

4.$plug['img_file_name'] : This is the name of the image,that we are using to show in frontend. Note that the image with this name must be there in the "your_joomla/media/com_invitex/images/" folder.

Foe LinkedIn:

 

$plug['img_file_name']="linkedin.png";

 

plug image

There is a image "LinkedIn.png" in "your_joomla/media/com_invitex/images/".

Finally you need to return this plug array.

 

get_request_token

This is the initial Request raised to the API of plugin.In this method you need to raise the  request for the Request token i.e. used for the Authentication phase.

get_request_token($callback) 
//$callback is the redirect URL defined by the component,to which we get redirects after getting request token..

 

get_access_token

After getting the request token,you need to raise the request for access token. The $callback provided for "get_request_token" is the trigger for this method.

get_access_token($get,$client,$callback) 
//$get is the result provided by "get_request_token"
//in case of Invitex $client='invitex'
//$callback is the redirect URL defined by the component,to which we get redirects after getting request token.

get_contacts()

After authorising your Application,you need to raise the request for getting contacts from your account.

 

your_plugin_nameget_contacts()


In case of linkedIn:
plug_techjoomlaAPI_gmailget_contacts()

renderContacts()

 This function is directly called from your_plugin_nameget_comtacts() function.Function helps you to modify the imported contacts in format needed by component.

renderContacts($connections)
//$connection are the contacts imported by get_contacts()