Operations

Getchallenge

Get a valid and time limited challenge token from the server.

HTTP-Type: GET

URL:
[url-format]?operation=getchallenge&username=[crmplus-username]

Example – request:

curl 'http://[url-to-crmplus]/webservice.php?operation=getchallenge&username=[username]' \
-H 'Accept: application/json'

Example – response:

{
        "success":true,
        "result":{
                "token":"52d5057ebf219",
                "serverTime":1389692286,
                "expireTime":1389692586
        }
}

Login

Login to the server using the challenge token obtained in getchallenge operation. For “accessKey” create a MD5 hash after concatenating the challenge token obtained from get challenge result and the user access key from my preference page.

HTTP-Type: POST

URL:
[url-format]?operation=login&username=[crmplus-username]&accessKey=[generated-accesskey]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=login&username=admin&accessKey=[accessKey]'

Example – response:

{
        "success":true,
        "result":{
                "userId":"19x1",
                "sessionName":"4a0b52d5057f9f288"
        }
}

How to generate an accesskey

Get the CrmPlusUserAccessKey from: CRM+ -> My Perferences -> AccessKey

Generate accesskey:

echo -n "[challengeToken][crmUserAccessKey]" | md5sum

Example accesskey:

"5a764bb8bcff5ea689aaa3c349f73887"

Create

Create a new entry on the CRM+.

HTTP-Type: POST

URL:
[url-format]?operation=create&elementType=[moduleName]&element=[object]&options=[object]

Options:

  • events it’s useful if you want to update without to trigger events like workflows, handlers (default: true)

Note

If you transfer large data sets we recommend to set events false to get more performance.

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=create&elementType=Leads&sessionName=[sessionID]' \
-d 'element={"lastname":"Lastname via Webservice", "company":"Company via Webservice", "assigned_user_id":"19x1"}' \
-d 'options={"events": false}'

Example – response:

{
        "success":true,
        "result":{
                "annualrevenue":"0.000000000",
                "...",
                "company":"Company via Webservice",
                "country":"",
                "createdtime":"2014-01-14 10:21:36",
                "...",
                "lastname":"Lastname via Webservice",
                "leadsource":"",
                "leadstatus":"",
                "lead_no":"LEA78",
                "mobile":"",
                "modifiedtime":"2014-01-14 10:21:36",
                "noofemployees":"0",
                "partner_id":"",
                "phone":"",
                "pobox":"",
                "rating":"",
                "record_currency_id":"1",
                "...",
                "assigned_user_id":"19x1",
                "...",
                "id":"2x199"
        }
}

Retrieve

Returns fields with values of a specific record.

HTTP-Type: GET

URL:
[url-format]?operation=retrieve&sessionName=[sessionID]&id=[ModulID x RecordID]&options=[object]

Options:

  • withPermissions Retrieve with edit & delete permissions (default: false)

  • withAttachment Retrieve documents with base64 encoded attachment (default: false)

Example – request:

curl 'https://[url-to-crmplus]/webservice.php?operation=retrieve&sessionName=[sessionID]&id=2x199' \
-H 'Accept: application/json'

Example – response:

{
        "success":true,
        "result":{
                "annualrevenue":"0.000000000",
                "...",
                "company":"Company via Webservice",
                "country":"",
                "createdtime":"2014-01-14 10:21:36",
                "...",
                "lastname":"Lastname via Webservice",
                "leadsource":"",
                "leadstatus":"",
                "lead_no":"LEA78",
                "mobile":"",
                "modifiedtime":"2014-01-14 10:21:36",
                "noofemployees":"0",
                "partner_id":"",
                "phone":"",
                "pobox":"",
                "rating":"",
                "record_currency_id":"1",
                "...",
                "assigned_user_id":"19x1",
                "...",
                "id":"2x199"
        }
}

Update

Update a retrieved or newly created record.

HTTP-Type: POST

URL:
[url-format]?operation=update&sessionName=[sessionID]&element=[object]&options=[object]

Options:

  • patch it’s useful if you want to update only some of the fields without override existing one (default: false)

  • events it’s useful if you want to update without to trigger events like workflows, handlers (default: true)

Note

If patch is not set to true, execute the describe function first and modify the field values before passing them to the update function. If you transfer large data sets we recommend to set events to false to get more performance.

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=update&sessionName=[sessionID]' \
-d 'element={"lastname":"Lastname updated via Webservice", "company":"Company updated via Webservice", "assigned_user_id":"19x1", "id":"2x199"}' \
-d 'options={"patch": true, "events": false}'

Example – response:

{
        "success":true,
        "result":{
                "annualrevenue":"0.000000000",
                "city":"",
                "code":"",
                "company":"Company Updated",
                "country":"",
                "createdtime":"2014-01-14 10:40:39",
                "description":"",
                "designation":"",
                "email":"",
                "fax":"",
                "firstname":"",
                "industry":"",
                "lane":"",
                "lastname":"Lastname updated via Webservice",
                "...",
                "ship_pobox":"",
                "ship_state":"",
                "ship_street":"",
                "assigned_user_id":"19x1",
                "state":"",
                "website":"",
                "yahooid":"",
                "id":"2x204"
        }
}

Delete

Delete a record from the CRM+.

HTTP-Type: POST

URL:
[url-format]?operation=delete&sessionName=[sessionID]&id=[ModulID x RecordID]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=delete&sessionName=[sessionID]&id=2x199'

Example – response:

{
        "success":true,
        "result":{
                "status":"successful"
        }
}

Sync

Sync will return a list of records that contains details of changes after modified time.

HTTP-Type: GET

[url-format]?operation=sync&sessionName=[sessionID]&elementType=[moduleName]&modifiedTime=[timestamp] &options=[object]

Options:

  • onlyOwn it’s useful if you want to sync all permissible records, not only these which the user is assigned to (default: true)

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=sync&sessionName=[sessionID]&elementType=Leads&modifiedTime=[modifiedtime]' \
-d 'options={"onlyOwn": false}'

Example – response:

{
        "success":true,
        "result":{
                "updated":[
                        {
                        "annualrevenue":"0.000000000",
                        "city":"",
                        "code":"",
                        "company":"Brainformatik GmbH",
                        "country":"",
                        "createdtime":"2013-08-05 06:37:11",
                        "...",
                        "ship_country":"",
                        "ship_pobox":"",
                        "ship_state":"",
                        "ship_street":"",
                        "assigned_user_id":"19x1",
                        "state":"",
                        "website":"",
                        "yahooid":"",
                        "id":"2x51"
                        }
                ],
                "deletedeleted":[
                ],
                "lastModifiedTime":1385378660
        }
}

Query

The query operation provides a way to select data from CRM+. Queries are currently limited to a CRM module. Joins and embeded queries are not supported. Query always limits its output to 100 records. Client application can use limit operator to get different records.

HTTP-Type: GET

URL:
[url-format]?operation=query&sessionName=[sessionID]&query=[query string]

FORMAT:

SELECT * | <column_list> | <count(*)>
FROM <object>
[WHERE <conditionals>]
[ORDER BY <column_list>]
[LIMIT [<m>, ] <n>]

[column_list]

=>

Comma separated list of field names.

[object]

=>

Type or Module Name. The first letter has to be upper case.

[conditionals]

=>

[condition_operations] or [in_clauses] or [like_clauses] separated by ‘and’ or ‘or’ operators these are processed from left to right.
It’s not possible to structure the grouping conditions by brackets.

[condition_operations]

=>

<, >, <=, >=, =, !=

[in_clauses]

=>

in ()

[like_clauses]

=>

mysql> SELECT * FROM [DB] WHERE [COND] LIKE ‘%sqlregex%’

[regexp_clauses]

=>

mysql> SELECT * FROM [DB] WHERE [COND] REGEXP ‘[x-z]’

[value_list]

=>

a comma separated list of values.

m,n

=>

integer values to specify the offset and limit respectively

LIMITATIONS

  • Queries are currently limited to a single object.

  • Joins are not supported.

  • Query always limits its output to 100 records, Client application can use limit operator to get different records.

Example - request:

curl 'https://[url-to-crmplus]/webservice.php?operation=query&sessionName=[sessionID]&query=[query string]' \
-H 'Accept: application/json'

Example - response:

{
        "success":true,
        "result":[
                {
                        "accountname":"Brainformatik GmbH",
                        "account_no":"ACC4",
                        "accounttype":"",
                        "annual_revenue":"0.000000000",
                        "...",
                        "bill_city":"Sunnyvale",
                        "bill_code":"88854",
                        "bill_country":"USA",
                        "bill_pobox":"",
                        "bill_state":"CA",
                        "bill_street":"1715 Scott Dr",
                        "...",
                        "fax":"",
                        "industry":"Chemicals",
                        "modifiedtime":"2011-06-15 10:09:32",
                        "notify_owner":"0",
                        "otherphone":"",
                        "ownership":"",
                        "account_id":"",
                        "partner_id":"",
                        "phone":"(489) 604-3335",
                        "...",
                        "ship_state":"CA",
                        "ship_street":"1715 Scott Dr",
                        "siccode":"",
                        "assigned_user_id":"19x1",
                        "tickersymbol":"",
                        "website":"www.brainformatik.com",
                        "id":"3x8"
                }
        ]
}

Listtypes

List the names of all the CRM modules available through the API.

HTTP-Type: GET

URL:
[url-format]?operation=listtypes&sessionName=[sessionID]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php?operation=listtypes&sessionName=[sessionID]' \
-H 'Accept: application/json'

Example – response:

{
    "success":true,
    "result":{
        "types":[
            "Leads",
            "Accounts",
            "...",
            "Groups",
            "Currencies",
            "AttachmentsFolder"
        ],
        "information":{
            "Leads":{
                "isEntity":true,
                "label":"Leads",
                "singular":"Lead",
                "idPrefix":"2",
                "..."
            },
            "Accounts": {
                "isEntity": true,
                "label": "Accounts",
                "singular": "Account",
                "createable": true,
                "updateable": true,
                "deleteable": true,
                "retrieveable": true,
                "idPrefix": "3"
            },
            "Groups": {
                "isEntity": false,
                "label": "Groups",
                "singular": "Group",
                "idPrefix": "20"
            },
            "AttachmentsFolder": {
                "isEntity": false,
                "label": "AttachmentsFolder",
                "singular": "AttachmentsFolder",
                "idPrefix": "50"
            },
            "Currencies": {
                "isEntity": false,
                "label": "Currencies",
                "singular": "Currencies",
                "idPrefix": "51"
            }
        }
    }
}

There are a few types that aren’t a real entity. You need them to create other types, e.g. Currencies for Invoices.

Describe

Get the meta information about a given CRM module.

HTTP-Type: GET

URL:
[url-format]?operation=describe&sessionName=[sessionID]&elementType=[moduleName]

Example – request:

curl -X GET "https://[url-to-crmplus]/webservice.php?operation=describe&sessionName=[sessionID]&elementType=[Module]" \
-H "Accept: application/json"

Example – response:

{
"success": true,
"result": {
        "label": "Leads",
        "name": "Leads",
        "createable": true,
        "updateable": true,
        "deleteable": true,
        "retrieveable": true,
        "fields": [
        {
                "name": "annualrevenue",
                "label": "Jahresumsatz",
                "mandatory": false,
                "type": {
                "name": "double",
                "uitype": "71"
                },
                "nullable": true,
                "editable": true,
                "displayType": "1",
                "default": "0.000000000"
        },
        "...",
        {
                "name": "partner_id",
                "label": "Partner",
                "mandatory": false,
                "type": {
                "refersTo": [
                        "Partner"
                ],
                "refersToTranslated": [
                        {
                        "name": "Partner",
                        "label": "Partner"
                        }
                ],
                "name": "reference",
                "uitype": "10"
                },
                "nullable": true,
                "editable": true,
                "displayType": "1",
                "default": "0"
        }
        ],
        "idPrefix": "2",
        "isEntity": true,
        "labelFields": "firstname, lastname"
        "userDefinedFields": [
                {
                        "tabid": "23",
                        "fieldid": "1725",
                        "columnname": "cf_1725",
                        "tablename": "vtiger_inventoryproductrel",
                        "generatedtype": "2",
                        "uitype": "1",
                        "fieldname": "cf_1725",
                        "fieldlabel": "cf_1725",
                        "readonly": "1",
                        "presence": "2",
                        "selected": "0",
                        "maximumlength": "100",
                        "sequence": "12",
                        "block": "70",
                        "displaytype": "-1",
                        "typeofdata": "V~O~LE~100",
                        "quickcreate": "1",
                        "quickcreatesequence": null,
                        "info_type": "BAS",
                        "masseditable": "1",
                        "helpinfo": "",
                        "displaytype_adjust": "",
                        "ajax_editable": "1",
                        "properties_editable": "1",
                        "account_related": "0",
                        "revision_safe": "0",
                        "function_message": "",
                        "outsourced": "0",
                        "product_block_field": "1",
                        "product_block_sequence": "1",
                        "default_value": "",
                        "blockid": "70",
                        "blocklabel": "LBL_RELATED_PRODUCTS",
                        "show_title": "0",
                        "visible": "0",
                        "create_view": "0",
                        "edit_view": "0",
                        "detail_view": "0",
                        "display_status": "1",
                        "iscustom": "0",
                        "add_field": "0",
                        "drop_target": "0",
                        "hide_allowed": "0",
                        "show_empty_block": "1",
                        "handler_class": "classes\\Inventory\\CustomBlocks\\ProductBlock"
                }
        ],
        "productBlocks": {
                "677": {
                        "name": "ArticleList1",
                        "translation": {
                                "de_de": "Standard",
                                "en_us": "Standard",
                                "fr_fr": "Standard",
                                "it_it": "Standard",
                                "es_es": "Estándar"
                        }
                }
        }
}

GetAccessList

Get the status if a language or module is activated.

HTTP-Type: GET

URL:
[url-format]?operation=getaccesslist&sessionName=[sessionID]&elementType=[Modules / Languages]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php?operation=getaccesslist&sessionName=[sessionID]&elementType=[Modules / Languages]' \
-H 'Accept: application/json'

Example – response:

For ‘Modules’:

{
        "success":true,
        "result":{
                "Accounts":{
                        "active":1
                },
                "Assets":{
                        "active":1
                }
                "...",
        }
}

For ‘Languages’:

{
        "success":true,
        "result":{
                "de_de":{
                        "active":"1"
                },
                "en_us":{
                        "active":"0"
                },
                "...",
        }
}

Updateaccess

Update access of a language or a module by setting activating or deactivating flag.

HTTP-Type: POST

URL:
[url-format]?operation=updateaccess&sessionName=[sessionID]&elementType=[Modules / Languages]&element=[object]

Example – request (language):

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=updateaccess&sessionName=[sessionID]&elementType=Languages' \
-d 'element={"de_de":{"active":"1"},"en_us":{"active":"0"}}'

Example – response (language):

{
        "success":true,
        "result":{
                "de_de":{
                        "success":true
                },
                "en_us":{
                        "success":true
                }
        }
}

You can see changes in response from GetAccesslist

{
   "success":true,
   "result":{
      "de_de":{
         "success":true
       },
      "en_us":{
         "success":false
      }
      "...",
   }
}

Example – request (modules):

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=updateaccess&sessionName=[sessionID]&elementType=Modules' \
-d 'element={"Accounts":{"active":"1"},"Calendar":{"active":"0"}}'

Example – response (modules):

{
        "success":true,
        "result":{
                "Accounts":{
                        "success":true
                },
                "Calendar":{
                        "success":true
                }
        }
}

You can see changes in response from GetAccesslist

{
    "success":true,
    "result":{
        "Accounts":{
            "success":true
        },
        "Calendar":{
            "success":false
        }
        "...",
    }
}

ChangePassword

This service allows you to change the user password.

HTTP-Type: POST

URL:
[url-format]?operation=changePassword&sessionName=[sessionID]&oldPassword=[old Password]&confirmPassword=[confirm New Password]&newPassword=[new Password]&id=[userId]

Example-Request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=changePassword&sessionName=[sessionID]&oldPassword=admin1&confirmPassword=admin2&newPassword=admin2&id=19x1'

Example - respone:

{
        "success":true,
        "result":{
                "message":"Changed password successfully"
        }
}

DeleteUser

Delete a user from the CRM+. The “newOwnerId” is a user who gets the ownership transferred from the old user.

HTTP-Type: POST

URL:
[url-format]?operation=deleteUser&sessionName=[sessionID]&id=[userID]&newOwnerid=[userID]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=deleteUser&sessionName=[sessionID]&id=19x1&newOwnerId=20x1'

Example – response:

{
        "success": true,
        "result":{
                "status": "successful"
        }
}

UploadDocument

Creates a new document with internal attachment.

HTTP-Type: POST

URL:
[url-format]?operation=uploadDocument&sessionName=[sessionID]&attachment=[object]&element=[object]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=uploadDocument&sessionName=[sessionID]' \
-d 'attachment={"stream":"e.g. base64 encoded file!", "mime_type":"e.g. image/jpg"}' \  //base64 should be urlencoded otherwise your file might not work
-d 'element={"notes_title":"test", "filename":"test"}'

Example - response:

{
        "success":true,
        "result":{
                "createdtime":"2014-01-14 14:46:23",
                "filedownloadcount":"0",
                "filelocationtype":"I",
                "filesize":"0",
                "filestatus":"1",
                "filetype":"",
                "fileversion":"",
                "folderid":"22x1",
                "modifiedtime":"2014-01-14 14:46:23",
                "...",
                "visible_for_cp":"0",
                "id":"7x218"
        }
}

AddRelatedRecord

Create new relations between records (n:m and field relations).

HTTP-Type: POST

URL:
[url-format]?operation=addRelatedRecord&sessionName=[sessionID]&sourceId=[sourceID]&targetId=[object]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=addRelatedRecord&sessionName=[sessionID]' \
-d 'sourceId=3x456' \
-d 'targetId=["4x2"]'

Example - response:

{
        "success": true,
        "result": null
}

GetAllRelations

Get a records available relation modules and their number of related records.

HTTP-Type: GET

URL:
[url-format]?operation=getAllRelations&sessionName=[sessionID]&sourceId=[sourceID]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php?operation=getAllRelations&sessionName=[sessionID]&sourceId=3x456' \
-H 'Accept: application/json'

Example - response:

{
        "success": true,
        "result": [
                {
                        "name": "Contacts",
                        "label": "Kontakte",
                        "relation": 2
                },
                {
                        "name": "EmailsLocal",
                        "label": "E-Mails",
                        "relation": 0
                },
                {
                        "name": "Activities",
                        "label": "Aktivitäten",
                        "relation": 3
                },
                "..."
        ]
}

GetRelatedRecords

Get a records related records.

HTTP-Type: GET

URL:
[url-format]?operation=getRelatedRecords&sessionName=[sessionID]&sourceId=[sourceID]&moduleName=[moduleName]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php?operation=getRelatedRecords&sessionName=[sessionID]&sourceId=7x925&moduleName=Documents' \
-H 'Accept: application/json'

Example - response:

{
        "success": true,
        "result": {
                "name": "Contacts",
                "module": "Contacts",
                "fields": [
                        {
                                "name": "contact_no",
                                "label": "Kontaktnr."
                        },
                        {
                                "name": "lastname",
                                "label": "Nachname"
                        }
                ],
                "relations": [
                        {
                                "id": "4x1",
                                "contact_no": "CON1",
                                "lastname": "Test1",
                                "createdtime": "2018-05-30 12:48:11",
                                "modifiedtime": "2018-05-30 12:48:11",
                                "assigned_user_id": "19x1"
                        },
                        {
                                "id": "4x2",
                                "contact_no": "CON2",
                                "lastname": "Test2",
                                "createdtime": "2018-06-01 14:39:51",
                                "modifiedtime": "2018-06-01 14:39:51",
                                "assigned_user_id": "19x1"
                        }
                ]
        }
}

AddLineItems

Add a product or service to a product block record.

HTTP-Type: POST

URL:
[url-format]?operation=addLineItem&sessionName=[sessionID]&recordId=[recordId]&attributes=[object]&options=[object]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=addLineItem&sessionName=[sessionID]' \
-d 'recordId=16x3507' \
-d 'attributes={"id":"6x3099", "name":"Product 1", "sequence": 0, "headline":"", "headlinedes":"", "linebreak":"off", "show_subtotal":0, "comment":null, "quantity":1, "listprice":0, "grossPrice":null, "asset_id":0, "lineitem_id":0, "tax_id":0, "discount_percent":0, "discount_amount":0, "productBlockName": "article_list_2", "optionalLineItem": false, "cf_1767": "value", "alternativeParentId":"0"}' \
-d 'options={"recalculate":true}' // true = invoice subtotal / total / etc will get recalculated | recommended

Example - response:

{
        "success": true,
        "result": {
                "4": {
                        "id": "25x3299",
                        "name": "Service 1",
                        "sequence": "1",
                        "headline": "",
                        "headlinedes": "",
                        "linebreak": "off",
                        "show_subtotal": "0",
                        "comment": "",
                        "description": "",
                        "quantity": 2,
                        "listprice": "12235.870000000",
                        "asset_id": "0",
                        "subproduct_ids": "",
                        "itemtype": "Services",
                        "lineitem_id": "4",
                        "total": 24471.74,
                        "total_discount": 0,
                        "total_after_discount": 24471.74,
                        "taxclass": "0",
                        "tax_percentage": "0.000",
                        "discount_percent": 0,
                        "discount_amount": 0,
                        "total_tax_value": 0,
                        "net_price": 24471.74,
                        "net_subtotal": 48943.48,
                        "grossLineItem": "0",
                        "grossPrice": null,
                        "grossDiscountAmount": null,
                        "forecast": "0",
                        "sh_tax": 0,
                        "ship_bill_date": null,
                        "qtyinstock": 0,
                        "changetime": "1508501942",
                        "copyProduct": false,
                        "optionalLineItem": false,
                        "productBlockName": "article_list_2",
                        "alternativeLineItem": false,
                        "cf_1767": "value",
                },
                "5": {
                        "id": "6x3099",
                        "name": "Product 1",
                        "sequence": "2",
                        "headline": "",
                        "headlinedes": "",
                        "linebreak": "off",
                        "show_subtotal": "0",
                        "comment": "",
                        "description": "",
                        "quantity": 1,
                        "listprice": "12235.870000000",
                        "asset_id": "0",
                        "subproduct_ids": "",
                        "itemtype": "Products",
                        "lineitem_id": "5",
                        "total": 12235.87,
                        "total_discount": 0,
                        "total_after_discount": 12235.87,
                        "taxclass": "413",
                        "tax_percentage": "7.500",
                        "discount_percent": 0,
                        "discount_amount": 0,
                        "total_tax_value": 0,
                        "net_price": 12235.87,
                        "net_subtotal": 24471.74,
                        "grossLineItem": "0",
                        "grossPrice": null,
                        "grossDiscountAmount": null,
                        "forecast": "0",
                        "sh_tax": 0,
                        "ship_bill_date": null,
                        "qtyinstock": 0,
                        "changetime": "1508501883",
                        "copyProduct": false,
                        "productBlockName": "article_list_2"
                        "optionalLineItem": false,
                        "alternativeLineItem": false,
                        "cf_1767": "value",
                }
        }
}

GetLineItems

Get all line items and their infos of a product block record.

HTTP-Type: GET

URL:
[url-format]?operation=getLineItems&sessionName=[sessionID]&recordId=[recordId]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php?operation=getLineItems&sessionName=[sessionID]&recordId=16x973' \
-H 'Accept: application/json'

Example - response:

{
        "success": true,
        "result": {
                "4": {
                        "id": "25x3299",
                        "name": "Service 1",
                        "sequence": "1",
                        "headline": "",
                        "headlinedes": "",
                        "linebreak": "off",
                        "show_subtotal": "0",
                        "comment": "",
                        "description": "",
                        "quantity": 2,
                        "listprice": "12235.870000000",
                        "asset_id": "0",
                        "subproduct_ids": "",
                        "itemtype": "Services",
                        "lineitem_id": "4",
                        "total": 24471.74,
                        "total_discount": 0,
                        "total_after_discount": 24471.74,
                        "taxclass": "0",
                        "tax_percentage": "0.000",
                        "discount_percent": 0,
                        "discount_amount": 0,
                        "total_tax_value": 0,
                        "net_price": 24471.74,
                        "net_subtotal": 48943.48,
                        "grossLineItem": "0",
                        "grossPrice": null,
                        "grossDiscountAmount": null,
                        "forecast": "0",
                        "sh_tax": 0,
                        "ship_bill_date": null,
                        "qtyinstock": 0,
                        "changetime": "1508501942",
                        "copyProduct": false,
                        "optionalLineItem": false,
                        "alternativeLineItem": false,
                        "cf_1767": "value",
                        "productBlockName": "article_list_2"
                },
                "5": {
                        "id": "6x3099",
                        "name": "Product 1",
                        "sequence": "2",
                        "headline": "",
                        "headlinedes": "",
                        "linebreak": "off",
                        "show_subtotal": "0",
                        "comment": "",
                        "description": "",
                        "quantity": 1,
                        "listprice": "12235.870000000",
                        "asset_id": "0",
                        "subproduct_ids": "",
                        "itemtype": "Products",
                        "lineitem_id": "5",
                        "total": 12235.87,
                        "total_discount": 0,
                        "total_after_discount": 12235.87,
                        "taxclass": "413",
                        "tax_percentage": "7.500",
                        "discount_percent": 0,
                        "discount_amount": 0,
                        "total_tax_value": 0,
                        "net_price": 12235.87,
                        "net_subtotal": 24471.74,
                        "grossLineItem": "0",
                        "grossPrice": null,
                        "grossDiscountAmount": null,
                        "forecast": "0",
                        "sh_tax": 0,
                        "ship_bill_date": null,
                        "qtyinstock": 0,
                        "changetime": "1508501883",
                        "copyProduct": false,
                        "optionalLineItem": true,
                        "alternativeLineItem": false,
                        "cf_1767": "value",
                        "productBlockName": "article_list_2"
                }
        }
}

UpdateLineItem

Update the infos of a line item of a product block record.

HTTP-Type: POST

URL:
[url-format]?operation=updateLineItem&sessionName=[sessionID]&recordId=[recordId]&lineItemId=[lineItemId]&fields=[object]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php' \
-H 'Accept: application/json' \
-d 'operation=updateLineItem&sessionName=[sessionID]' \
-d 'recordId=16x3507' \
-d 'lineItemId=5' \
-d 'fields={"linebreak":"off","quantity":1,"listprice":199.99, "productBlockName": "ArticleList1", "optionalLineItem": false, "cf_1767": "value", "alternativeParentId": "4"}' \
-d 'options={"recalculate":true}' // true = invoice subtotal / total / etc will get recalculated | recommended

Example - response:

{
        "success": true,
        "result": {
                "id": "6x3099",
                "name": "Product 1",
                "sequence": "2",
                "headline": "",
                "headlinedes": "",
                "linebreak": "off",
                "show_subtotal": "0",
                "comment": "",
                "description": "",
                "quantity": 1,
                "listprice": "199.990000000",
                "asset_id": "0",
                "subproduct_ids": "",
                "itemtype": "Products",
                "lineitem_id": "5",
                "total": 199.99,
                "total_discount": 0,
                "total_after_discount": 199.99,
                "taxclass": "413",
                "tax_percentage": "7.500",
                "discount_percent": 0,
                "discount_amount": 0,
                "total_tax_value": 0,
                "net_price": 199.99,
                "net_subtotal": 399.98,
                "grossLineItem": "0",
                "grossPrice": null,
                "grossDiscountAmount": null,
                "forecast": "0",
                "sh_tax": 0,
                "ship_bill_date": null,
                "qtyinstock": 0,
                "changetime": "1508501883",
                "copyProduct": false,
                "cf_1767": "value",
                "productBlockName": "ArticleList1"
                "optionalLineItem": false,
                "alternativeLineItem": true,
                "alternativeParentId": 4
        }
}

DeleteLineItem

Delete a line item of a product block record.

HTTP-Type: GET

URL:
[url-format]?operation=deleteLineItem&sessionName=[sessionID]&recordId=[recordId]&lineItemId=[lineItemId]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php?operation=deleteLineItem&sessionName=[sessionID]&recordId=16x973&lineItemId=1&options=%7B%22recalculate%22%3Atrue%7D' \    //options should be urlencoded, true = invoice subtotal / total / etc will get recalculated | recommended
-H 'Accept: application/json'

Example - response:

{
        "success": true,
        "result": {
                "4": {
                        "id": "25x3299",
                        "name": "Service 1",
                        "sequence": "1",
                        "headline": "",
                        "headlinedes": "",
                        "linebreak": "off",
                        "show_subtotal": "0",
                        "comment": "",
                        "description": "",
                        "quantity": 2,
                        "listprice": "12235.870000000",
                        "asset_id": "0",
                        "subproduct_ids": "",
                        "itemtype": "Services",
                        "lineitem_id": "6",
                        "total": 24471.74,
                        "total_discount": 0,
                        "total_after_discount": 24471.74,
                        "taxclass": "0",
                        "tax_percentage": "0.000",
                        "discount_percent": 0,
                        "discount_amount": 0,
                        "total_tax_value": 0,
                        "net_price": 24471.74,
                        "net_subtotal": 48943.48,
                        "grossLineItem": "0",
                        "grossPrice": null,
                        "grossDiscountAmount": null,
                        "forecast": "0",
                        "sh_tax": 0,
                        "ship_bill_date": null,
                        "qtyinstock": 0,
                        "changetime": "1508501942",
                        "copyProduct": false,
                        "optionalLineItem": false,
                        "alternativeLineItem": false,
                        "cf_1767": "value",
                        "productBlockName": "ArticleList1"
                }
        }
}

GetStreamProperties

Get internal stream properties. This service provides almost the same parameters as the home dashboard module in the CRM+.

HTTP-Type: GET

URL:
[url-format]?operation=getstreamproperties&sessionName=[sessionID]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php?operation=getStreamProperties&sessionName=[sessionID]' \
-H 'Accept: application/json'

Example – response:

{
        "success":true,
        "result":{
                "modules":[
                        {
                                "name":"Accounts",
                                "id":"6"
                        },
                        "...",
                ],
                "timeframe":{
                        "days":[
                                1,
                                3,
                                5,
                                14
                        ]
                },
                "assignment":[
                        {
                                "name":"LBL_ONLY_MINE",
                                "label":"zeige meine Daten"
                        },
                        {
                                "name":"LBL_ALL_RECORDS",
                                "label":"zeige alle Daten"
                        }
                ]
        }
}

GetStreamData

Get internal stream data / changes. This service provides almost the same parameters as the home dashboard module in the CRM+.

To use this operation you have to activate Track Changes for the module you would like to stream data. | Login as admin -> global Settings -> Track Changes -> Continuous change tracking (active) & select module (active)

This additional filters are allowed:

  • assignment

  • timestamp

  • timeframe

  • maxchanges

  • maxrecords

  • withchanges

  • withpagecount

  • recordid

  • pagenumber

HTTP-Type: GET

URL:
[url-format]?operation=getStreamData&sessionName=[sessionID]&filter=[object]

Example - request:

curl 'https://[url-to-crmplus]/webservice.php/webservice.php?operation=getStreamData&sessionName=[sessionID]&filter=%7B%22modules%22%3A%227%22%7D' \   //{"modules":"7"} url encoded
-H 'Accept: application/json'

Example - response:

{
        "success":true,
        "result":{
                "lastSyncTime":1389711761,
                "changes":[
                        {
                                "record":{
                                        "id":213,
                                        "name":"Lastname via Webservice",
                                        "link":"",
                                        "modifiedOn":"2014-01-14 12:16",
                                        "modifiedBy":" Administrator"
                                },
                                "module":{
                                        "label":"Leads",
                                        "link":"index.php?module=Leads&action=index"
                                },
                                "data":[
                                        {
                                                "datetime":"2014-01-14 12:16",
                                                "status":1,
                                                "changes":[
                                                ]
                                        }
                                ]
                        },
                "...",
                ]
        }
}

Logout

Logout from the webservices session, this leaves the webservice session invalid for further use.

HTTP-Type: POST

URL:
[url-format]?operation=logout&sessionName=[sessionID]

Example – request:

curl 'https://[url-to-crmplus]/webservice.php?operation=logout&sessionName=[sessionID]' \
-H 'Accept: application/json'

Example – response:

{
        "success":true,
        "result":{
                "message":"successfull"
        }
}