API Developers Guide

From RangerMSP Wiki - PSA software for MSPs and IT services providers
Revision as of 09:53, 13 August 2009 by Yarden (talk | contribs) (→‎Glossary)
Jump to navigation Jump to search

CommitCRM provides various tools in order to read/add/update information in the Commit database. These tools include: Programming API and API by Email for updating the database, and an ODBC Link for pulling information from the database. The Commit API provides developers with a set of APIs which allow them to perform database transactions in order to add and update records in the Commit database. The API can be used as a Programming API by embedding code which uses the API functions, or as an API by Email which allows you to send XML formatted emails which will be processed and executed.

  • Programming API

The Commit API provides developers with a set of API functions which can be used in VB, C++, Delphi and any other programming language that lets you use a standard Windows dll file. It provides the ability to create a connection to Commit's database, add new records to the database and update them.

  • API by Email

The API by Email allows you to send XML formatted emails which contain database transactions. Commit Email Connector then pulls the incoming XML emails from your POP3 mail server, processes the email and performs the transactions in the XML transaction. XML formatted email gives you an API for the Commit database, which allows you to perform many actions such as linking to external systems, receiving forms submitted from your web site, and more.

  • ODBC Link

While the API provides the means for adding and updating information in the database, you should use ODBC Link in order to read information from the database. Commit uses an open database structure and allows other applications to access the database using ODBC (Open Data Base Connectivity) for read-only purposes. You can use ODBC Link in order to read data from the database and integrate it with an external system (i.e. Crystal reports, or any other application). You may also use the ODBC Link to read Database Record IDs and update existing records. This will be discussed later in this document.

Glossary

  • Commit API (Application Programming Interface) - CommitCRM provides an API which allows you to add and update records in the Commit database. The API includes a list of possible actions and parameters.
  • ODBC Link (Open Data Base Connectivity) - ODBC is a function library which provides a common API for ODBC compliant databases. Commit provides an open database and allows other applications to access the database using ODBC for read-only purposes.
  • Record - Each entity in the Commit database (such as Ticket, Account, Asset, Item, Appointment, Task, etc.) is considered a "record".
  • Database fields - Each record contains a list of fields, each of which holds the record's data.
  • Transaction – All additions or updates to record in the database are done by using a transaction. Each transaction includes the operation you wish to perform, the data type you wish to add/update and the additional parameters (database fields and their values).
  • Transaction Parameters - Each transaction contains the parameters for performing the transaction: record type, list of database fields and a list of the values to be updated in these fields.
  • External Application - This refers to the external program which integrates with Commit in order to update the database. This name should be passed when performing updates to the database, and it will be saved in the Commit record to indicate who performed the changes.
  • Record ID (REC ID) - Each record in Commit has a unique Record ID which is created when adding the record to the database. Every ID is 20 characters and should be transferred with the API transaction when you need to update an existing record.

Using Commit API

Commit API allows you to add and update records in the Commit database, such as Accounts, Tickets, Assets, Items, Appointments, Tasks and more.

The updates are performed using transactions, where each transaction includes the operation you wish to perform, the data type you wish to add/update, and any additional parameters (i.e. record type, database fields and their values).

Every record added to the system is assigned a unique Record ID (REC ID) which is the database identifier for this record.

The Commit API allows you to perform the following operations.

  • Add new records - if no Record ID is passed in the transaction, the API assumes that

this is a new record, adds it to the system and creates a new Record ID for it.

  • Update existing records - if the record ID is passed in the transaction, and the record

exists, the system will update the record with the information in the transaction.

In both cases, the system will try to set default values for fields which do not exist in the incoming transaction. If it fails, the action will fail with an error.

Note that in order to read data from the Commit database, you should use the ODBC Link, which provides a read-only link for the Commit database. See more details in Retrieving data using ODBC.