API methods

API methods

GET

Getting entry data

Example

GET https://company.flowlu.com/api/v1/module/crm/account/get/42

CREATE

Create new entry

Example

POST https://company.flowlu.com/api/v1/module/crm/lead/create

Request will return id of new entry

UPDATE

Update entry

Example

POST https://company.flowlu.com/api/v1/module/crm/lead/update/432

Request will return all fields of updated entry.

Requests can return errors of requested data validation:

{
  "error": {
    "error_code": 21,
    "error_msg": "validation error",
    "error_details": {
      "name": [
        "not_empty"
      ]
    }
  }
}

DELETE

Delete (remove permanently) entry

Exapmle

GET https://company.flowlu.com/api/v1/module/crm/lead/delete/432

Request will return id of deleted entry

LIST

Getting list of entries with the ability to filter and search

Example without parameters

GET https://company.flowlu.com/api/v1/module/crm/account/list

Example with parameters

GET https://company.flowlu.com/api/v1/module/crm/account/list?search=flowlu&page=3

The request parameters are included in request after ?

Available Parameters
Parameter Description
limit The maximum number of records returned per request.
Default value - 100;
Maximum value - 200;
Note: one request is one
page The page number.
Default value - 1;
filter The array of parameters for filtering
search The search request
Response
{
  "response": {
    "total": 3,  // total count of entries returned by request with considering filter and search
    "page": 1,   // the page number
    "count": 3,  // the number of entries in response (on page)
    "items": [   // the array with entries
      {
        "id": 1,
        "type": 2,
        "name": "Dart Vader",
        ..
      },
      {
        "id": 2,
        "type": 1,
        "name": "Luke Skywalker",
        ..
      }
    ]
  }
}
Filtering

Use filter parameter for filtering in request. The filter may be array. The array key is field of entry and value is number, text or JSON object.

Example

GET https://company.flowlu.com/api/v1/module/crm/account/list?filter[active]=1

filter request parameter
[active] entry field in [ ]
1 field value
Exapmle with comma-separated list of values is available

GET https://company.flowlu.com/api/v1/module/crm/account/list?filter[type_id]=1,2

Exapmle with excluded value

To exclude a value, use the "!"

GET https://company.flowlu.com/api/v1/module/crm/account/list?filter[type_id]=!1

Filtering by time frame (dates)

For the time frame filter the request must contains JSON object with fileds start_date and end_date

Example

GET https://company.flowlu.com/api/v1/module/crm/account/list?filter[created_date]={“start_date”: “02-05-2017”, “end_date”: “10-05-2017”}

GET https://company.flowlu.com/api/v1/module/crm/account/list?filter[closed_date]={“start_date”: “01-05-2017”}