Skip to content
eWay-CRM API PHP Library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Examples
.gitignore
FolderNames.md
README.md
eway.class.php

README.md

eWay-CRM Logo

eWay-CRM API

API used for communication with eWay-CRM web service.

Establishing connection

To communicate eWay-CRM web service, we first have to establish connection. This must be done prior to every action we want to accomplish with use of the web service. To do that, we have to load the eway.class.php and create new instance of eWayConnector() with three parameters: service url address (same as the one you use in outlook), username and password.


// Load API
require_once "eway.class.php";

// Create connector
$connector = new eWayConnector('https://trial.eway-crm.com/31994', 'api', 'ApiTrial@eWay-CRM');

Actions at the service

You can check actions available on your service on [service adress]/WcfService/Service.svc/help. If the help is not enabled on your API have a look at instructions to activate it. We have put together a list of examples for some basic actions you can use the service for, so don't be shy an try it out.

Create new company

Example showcasing creation of new Company.
Sample code here.

Edit existing company

Example showcasing editing existing Company.
Sample code here.

List all companies

Example showcasing listing of all existing Companies.
Sample code here.

Search for company

Example showcasing serching for Company by parameters.
Sample code here.

Delete company

Example showcasing deletion Company.
Sample code here.

Link existing item

Example showcasing creation of simple relation.
Sample code here.

Acquire contacts by company

Example showcasing listing contacts linked to company.
Sample code here.

Create new invoice

Example showcasing creation of new Invoice and items on it.
Sample code here.

Changes on contacts

Example showcasing listing all changes on contacts from last check.
Sample code here.

Create Task with Document

Example showcasing creation of task with basic link to a document.
Sample code here.

Change Project status

Example showcasing changing project status.
Sample code here.

Item conflicts

How does it work exactly? Every item in eWay-CRM database has it's own revision number (like in SVN/Git) called ItemVersion. This number is increased by one everytime the item is updated. Using this number, eWay-CRM in Outlook is able to determine a conflict and show you the conflict resolving dialog (Use mine or theirs). When working with API, we don't force you to work with ItemVersion when you don't need it. When you save a record, you should send ItemVersion higher than the currently stored one (higher by one). By this you say that you have seen the revision N and the data you are sending is the revision N+1. Everything you send is saved. If you send ItemVersion lower or equal to the current or you don't send the ItemVersion at all, the system thinks that you have not seen the latest revision N. In Outlook, you would get conflict dialog. In API, to make things simplier, an automatic merge is done. The merge is simple. Every field value you are sending is saved except nulls. So your data are preserved but none of your deletings is performed.

Every Save method has also a boolean flag, which turns the auto-merge off and you get a conflict error code instead.

Create with Item conflict detection disabled (default)

Example showcasing creation with Item conflict detection disabled.
Sample code here.

Create with Item conflict detection enabled

Example showcasing creation with Item conflict detection enabled.
Sample code here.

Edit with Item conflict detection disabled (default)

Example showcasing editing with Item conflict detection disabled.
Sample code here.

Edit with Item conflict detection enabled

Example showcasing editing with Item conflict detection enabled.
Sample code here.

Folder name

To ease understanding folder names, look here.

You can’t perform that action at this time.