Videntity Python Wrapper (ViPyWrap)

From Videntity Wiki - The API Documentation

Revision as of 15:59, 31 October 2009 by GuardianJY (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

THIS PAGE IS UNDER CONSTRUCTION

The Videntity Python wrapper ViPyWrap enables developers to easily integrate existing applications to use Videntity's API. ViPyWrap is simply a wrapper provided for convenience that is used for making API calls. ViPyWrap handles all the Videntity API http communication and XML parsing for you. ViPyWrap provides code to log in your session, ping the session, log out, crud (create, retrieve, update, and delete) users, crud messages, CRD (create, retrieve, and delete) transactions, crud associations, generate a user specific sitekey, generate fax forms, and search for users.

Getting started

All you have to do is import ViPyWrap in your python code and build an instance of a Videntity API method class. There are currently 5 classes (with many more on the way) that can be used in ViPyWrap: Videntity_Auth, Videntity_User, Videntity_Transaction, Videntity_Site_Login, Videntity_Message. There is also a main configuration file for ViPyWrap. Each of these classes can be found in a separate file:


Class File Locations
Class Name File Name
Videntity_Auth VID_Auth.py
Videntity_User VID_User.py
Videntity_Transaction VID_Transaction.py
Videntity_Site_Login VID_Site_Login.py
Videntity_Message VID_Message.py
Videntity_Config VID_Config.py


Each file (but Videntity_Config) can be ran as a standalone script to test the Videntity API.

Authentication

Prior to running the scripts you must first configure your authentication data to connect to the Videntity API. There are two ways you can configure ViPyWrap authentication for use with the Videntity API. The easiest is to set your configuration file (VID_Config.py)

vsi_host = 'https://api.videntity.com'

username = 'YourVidentityUsername'

session_password = 'YourVidentityUserPassword'

account_number = 'YourVidentityAccountnumber'

for example:

vsi_host = 'https://api.videntity.com'

username = 'foobar'

session_password = 's1vyJR3t2DUho5F'

account_number = '130455507872907'


Once your configuration information is set you can test your connection to the Videntity Server by running the VID_Auth.py file:

python VID_Auth.py

Running the Auth file will log in, ping, and log out of the Videntity server to test the connections. It should print out this information to the command line if successful:

Login successful: session key = WnvzdszXnnUk1Jl
Ping successful: session key = WnvzdszXnnUk1Jl
Logout successful: session key = WnvzdszXnnUk1Jl
Authentication Test Successful

Likewise, if your api_conf.py settings are incorrect it will print out:

You had a problem logging in. Error Details: username, password or account_number is incorrect
You had a problem with your ping. Error Details: Your session does not exist
You had a problem logging out. Error Details: Your session does not exist
Authentication Test Successful
Personal tools