API-system description

For integration with third-party services in ZENLIX developed API-interface. The following description of methods and properties.


  1. Authorization
  2. View Profile
  3. Edit Profile
  4. View a list of user
  5. View a specific user
  6. View the list of groups
  7. View a specific group
  8. View incoming / outgoing / archival tickets
  9. View a specific ticket

Security  - for this we use JWT.

The user sends the username / password for authentication, in response to receiving the token. In the following query, it sends the token in the Header-section of the request. In response, he again receives another token, which also must be used in a new request. Thus - each new request with a new token.


Description all:

Auth: 

 REQUEST:
URL: POST /api/login
Content-Type: application/json
{
  "email": "info@rustem.com.ua",
  "password": "433434"
}
RESPONSE:
Content-Type: application/json
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvbG9naW4iLCJpYXQiOjE0NTk5MzI3MTYsImV4cCI6MTQ1OTkzNjMxNiwibmJmIjoxNDU5OTMyNzE2LCJqdGkiOiJiYTFmZGFhNWY3Njg4YWNjYzNmODc5NTRkOWFlNDg5ZSJ9.fn1e74v2DbANwmGkMAv739MmrpaD88uczdyWw7L6K08"
}
 

View profile

REQUEST:
URL: POST /api/profile/view HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvbG9naW4iLCJpYXQiOjE0NTk5MzI3MTYsImV4cCI6MTQ1OTkzNjMxNiwibmJmIjoxNDU5OTMyNzE2LCJqdGkiOiJiYTFmZGFhNWY3Njg4YWNjYzNmODc5NTRkOWFlNDg5ZSJ9.fn1e74v2DbANwmGkMAv739MmrpaD88uczdyWw7L6K08


RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvcHJvZmlsZVwvdmlldyIsImlhdCI6MTQ1OTkzMjcxNiwiZXhwIjoxNDU5OTM2NjEyLCJuYmYiOjE0NTk5MzMwMTIsImp0aSI6IjNjMzMwZjBlODczYjM2ZWRiNmY1ODgwMDI0MTFiYTM3In0.NhKVcGQt50ggxSZSlqcNYJzf0DFfedzbVhRnzYT1hFM


{
  "status_code": 200,
  "data": {
    "user_img": "mI42LZcuRUjIamri5rp9.png",
    "user_cover": null,
    "lang": "ru",
    "full_name": "Yaroslav Snisar",
    "user_urlhash": "rustem",
    "telephone": "",
    "skype": "",
    "address": "",
    "position": "Laravel Developer",
    "birthdayDay": 1,
    "birthdayMonth": 1,
    "birthdayYear": 1950,
    "email": "info@rustem.com.ua",
    "facebook": "",
    "twitter": "",
    "website": "",
    "about": "",
    "skills": "php,css,JS,bootstrap",
    "created_at": {
      "date": "2015-12-09 08:04:43.000000",
      "timezone_type": 3,
      "timezone": "Europe/Kiev"
    },
    "sms": null,
    "pb": ""
  }
}


Edit profile

REQUEST:
URL: POST /api/profile/update HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvcHJvZmlsZVwvdmlldyIsImlhdCI6MTQ1OTkzMjcxNiwiZXhwIjoxNDU5OTM2NjEyLCJuYmYiOjE0NTk5MzMwMTIsImp0aSI6IjNjMzMwZjBlODczYjM2ZWRiNmY1ODgwMDI0MTFiYTM3In0.NhKVcGQt50ggxSZSlqcNYJzf0DFfedzbVhRnzYT1hFM
{
	"user_cover": null,
    "lang": "ru",
    "full_name": "Yaroslav Snisar",
    "user_urlhash": "rustem",
    "telephone": "",
    "skype": "",
    "address": "",
    "position": "Laravel Developer",
    "birthdayDay": 1,
    "birthdayMonth": 1,
    "birthdayYear": 1950,
    "email": "info@rustem.com.ua",
    "facebook": "",
    "twitter": "",
    "website": "",
    "about": "",
    "skills": "php,css,JS,bootstrap",
    "sms": null,
    "pb": ""
}




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvcHJvZmlsZVwvdXBkYXRlIiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzE1NjUsIm5iZiI6MTQ2MDAyNzk2NSwianRpIjoiMDcyOGEyOTIzMWM5OTBkOWJjYmEwYTdjNzE1ZDNlZjEifQ.66X__NyKnAdgT9hlERR1m1Z9wb1Sjvg1Cs-kQ05tikw




{"status_code":200,"data":{"lang":"ru"}}



View users list

REQUEST:
URL: POST /api/users/list HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvcHJvZmlsZVwvdXBkYXRlIiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzE1NjUsIm5iZiI6MTQ2MDAyNzk2NSwianRpIjoiMDcyOGEyOTIzMWM5OTBkOWJjYmEwYTdjNzE1ZDNlZjEifQ.66X__NyKnAdgT9hlERR1m1Z9wb1Sjvg1Cs-kQ05tikw




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdXNlcnNcL2xpc3QiLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjAzNiwibmJmIjoxNDYwMDI4NDM2LCJqdGkiOiI3YmZhODhhNjUwZWVlNjRkMTk1ZWIzOTNkYzczNDIyYiJ9.9EnJdujffIKo8TTukq81Qz1pt8mhNiHICTVHG53t4rM




{
  "status_code": 200,
  "data": {
    "users": [
      {
        "full_name": "Омельчук Людмила Степанівна",
        "user_urlhash": "PC24rngrZ8yiylEovG2c90Xjm",
        "position": null,
        "user_img": null,
        "telephone": null,
        "address": null,
        "email": "omelchuk_ls@rr"
      },
      {
        "full_name": "Ivano",
        "user_urlhash": "6Aie8G9oFmUEGRFcqNAJoHmH2",
        "position": null,
        "user_img": null,
        "telephone": null,
        "address": null,
        "email": "vano@email.com"
      }
    ]
  }
}

View user:


REQUEST:
URL: POST /api/users/show HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdXNlcnNcL2xpc3QiLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjAzNiwibmJmIjoxNDYwMDI4NDM2LCJqdGkiOiI3YmZhODhhNjUwZWVlNjRkMTk1ZWIzOTNkYzczNDIyYiJ9.9EnJdujffIKo8TTukq81Qz1pt8mhNiHICTVHG53t4rM
{"user_urlhash":"6Aie8G9oFmUEGRFcqNAJoHmH2"}




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdXNlcnNcL3Nob3ciLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjMwMywibmJmIjoxNDYwMDI4NzAzLCJqdGkiOiI3YmE4MDAxMzRjYzI2MjU1N2MxM2U1ZWM3NzgxMmJmYyJ9.x4eVuyPmNvQwXM4E3f_eQCnHjSnAmcjv-vbZqqCc1mc




{
  "status_code": 200,
  "data": {
    "user_img": null,
    "user_cover": null,
    "lang": "ru",
    "full_name": "Ivano",
    "user_urlhash": "6Aie8G9oFmUEGRFcqNAJoHmH2",
    "telephone": null,
    "skype": null,
    "address": null,
    "position": null,
    "birthdayDay": null,
    "birthdayMonth": null,
    "birthdayYear": null,
    "email": "vano@email.com",
    "facebook": null,
    "twitter": null,
    "website": null,
    "about": null,
    "skills": null,
    "created_at": {
      "date": "2016-01-05 16:02:05.000000",
      "timezone_type": 3,
      "timezone": "Europe/Kiev"
    },
    "sms": null,
    "pb": null
  }
}

View groups list:


REQUEST:
URL: POST /api/groups/list HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdXNlcnNcL3Nob3ciLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjMwMywibmJmIjoxNDYwMDI4NzAzLCJqdGkiOiI3YmE4MDAxMzRjYzI2MjU1N2MxM2U1ZWM3NzgxMmJmYyJ9.x4eVuyPmNvQwXM4E3f_eQCnHjSnAmcjv-vbZqqCc1mc




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvZ3JvdXBzXC9saXN0IiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzI1NDksIm5iZiI6MTQ2MDAyODk0OSwianRpIjoiNWJjOWQwOGY2YzNkODQ5NDQxMmEyM2Y0M2Y4MDMzN2YifQ.4KPBQWazh0oerSk6KzHpQa70HiLI0lF-uNhs8sdFlrc




{
  "status_code": 200,
  "data": {
    "groups": [
      {
        "name": "Группа 2",
        "description": "описание группы 2",
        "group_urlhash": "3245234",
        "created_at": {
          "date": "2015-12-09 08:06:38.000000",
          "timezone_type": 3,
          "timezone": "Europe/Kiev"
        }
      },
      {
        "name": "Группа с длинным очень названием",
        "description": "описание группы 14",
        "group_urlhash": "34324",
        "created_at": {
          "date": "2015-12-09 08:06:23.000000",
          "timezone_type": 3,
          "timezone": "Europe/Kiev"
        }
      }
    ]
  }
}

View group:


REQUEST:
URL: POST /api/groups/show HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvZ3JvdXBzXC9saXN0IiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzI1NDksIm5iZiI6MTQ2MDAyODk0OSwianRpIjoiNWJjOWQwOGY2YzNkODQ5NDQxMmEyM2Y0M2Y4MDMzN2YifQ.4KPBQWazh0oerSk6KzHpQa70HiLI0lF-uNhs8sdFlrc




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvZ3JvdXBzXC9zaG93IiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzI3MTQsIm5iZiI6MTQ2MDAyOTExNCwianRpIjoiZTU5MDQ2YWE3MmEyMTMwYThhNjkwNzA2NGJkNTRhMjcifQ.1PeFTf0yOxtMilKjvu1xRWnMuYREFPlauKdw2KlDSh0




{
  "status_code": 200,
  "data": {
    "name": "Группа 2",
    "description": "описание группы 2",
    "status": "public",
    "description_full": "Of course, in addition to inserting records into the database, the query builder can also update existing records using the update method. The update method, like the insert method, accepts an array of column and value pairs containing the columns to be updated. You may constrain the update query using where clauses:",
    "slogan": "слоган",
    "address": "адресс",
    "tags": "php,html",
    "facebook": "fb",
    "twitter": "twitter",
    "group_urlhash": "3245234",
    "created_at": {
      "date": "2015-12-09 08:06:38.000000",
      "timezone_type": 3,
      "timezone": "Europe/Kiev"
    }
  }
}

View in/out/archive tickets


REQUEST:
URL: POST /api/tickets/list/in HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvZ3JvdXBzXC9zaG93IiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzI3MTQsIm5iZiI6MTQ2MDAyOTExNCwianRpIjoiZTU5MDQ2YWE3MmEyMTMwYThhNjkwNzA2NGJkNTRhMjcifQ.1PeFTf0yOxtMilKjvu1xRWnMuYREFPlauKdw2KlDSh0




RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdGlja2V0c1wvbGlzdFwvaW4iLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjg4OCwibmJmIjoxNDYwMDI5Mjg4LCJqdGkiOiJjZTUzMmMzMmQxNGZkOTA1MThkNDZkMTU1Mzg3ZTQ4OSJ9.N6XwPi5I3Cn9SViFca7tZxGbnSnre0kybRsQWRVpC-s




{
  "status_code": 200,
  "data": {
    "tickets": [
      {
        "code": "1UVT",
        "prio": "normal",
        "subject": "Hello!",
        "author": {
          "full_name": "Buben.Biz.UA",
          "user_urlhash": "XFMokQHQF2C7SOiKN7K3H1J2S"
        },
        "created_at": {
          "date": "2016-03-24 14:14:55.000000",
          "timezone_type": 3,
          "timezone": "Europe/Kiev"
        },
        "clients": [],
        "targets": {
          "group": null,
          "users": [
            {
              "full_name": "Yaroslav Snisar",
              "user_urlhash": "rustem"
            }
          ]
        },
        "ticket_status": "free"
      },
      {
        "code": "WGYN",
        "prio": "normal",
        "subject": "hello",
        "author": {
          "full_name": "Buben.Biz.UA",
          "user_urlhash": "XFMokQHQF2C7SOiKN7K3H1J2S"
        },
        "created_at": {
          "date": "2016-03-24 14:07:40.000000",
          "timezone_type": 3,
          "timezone": "Europe/Kiev"
        },
        "clients": [],
        "targets": {
          "group": null,
          "users": [
            {
              "full_name": "Yaroslav Snisar",
              "user_urlhash": "rustem"
            }
          ]
        },
        "ticket_status": "free"
      }
    ],
    "total": 52
  }
}

View ticket



REQUEST:
URL: POST /api/ticket/show HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdGlja2V0c1wvbGlzdFwvaW4iLCJpYXQiOjE0NjAwMjc4NDEsImV4cCI6MTQ2MDAzMjg4OCwibmJmIjoxNDYwMDI5Mjg4LCJqdGkiOiJjZTUzMmMzMmQxNGZkOTA1MThkNDZkMTU1Mzg3ZTQ4OSJ9.N6XwPi5I3Cn9SViFca7tZxGbnSnre0kybRsQWRVpC-s
{"code":"1UVT"}








RESPONSE:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvQ29kZVwvbGFyYXplblwvemVubGl4XC9wdWJsaWNcL2FwaVwvdGlja2V0XC9zaG93IiwiaWF0IjoxNDYwMDI3ODQxLCJleHAiOjE0NjAwMzMzMDUsIm5iZiI6MTQ2MDAyOTcwNSwianRpIjoiZTk1M2FkZjcwOWUyZDMzZWEzNzdiNTRmNWI3ZTQyMjIifQ.L8x7IlehwP0sZ9tXEWCcBaQ0CDtPgFaTW3V2h-oTQq4




{
  "status_code": 200,
  "data": {
    "ticket": {
      "author": {
        "full_name": "Buben.Biz.UA",
        "user_urlhash": "XFMokQHQF2C7SOiKN7K3H1J2S"
      },
      "code": "1UVT",
      "client": [],
      "prio": "normal",
      "text": "Test ticket!
--
Buben.Biz.UA
http://buben.biz.ua/
skype: rustem_ck ",       "subject": "Hello!",       "tags": "0",       "urlhash": "XRxiySbp7L",       "sla": null,       "target_group": null,       "target_users": [         {           "full_name": "Yaroslav Snisar",           "user_urlhash": "rustem"         }       ],       "watching_users": [         {           "full_name": "Yaroslav Snisar",           "user_urlhash": "rustem"         }       ],       "deadline_time": null,       "inspect_after_ok": "false",       "individual_ok": "false",       "created_at": {         "date": "2016-03-24 14:14:55.000000",         "timezone_type": 3,         "timezone": "Europe/Kiev"       },       "status": "free",       "overtime": "false",       "planner_flag": "false",       "comments": [         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "Хорошо! Сделаем!",           "created_at": {             "date": "2016-03-24 14:15:34.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "test",           "created_at": {             "date": "2016-04-01 11:44:25.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "test",           "created_at": {             "date": "2016-04-01 11:44:31.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "

test



  • vccvcvvccvcvcvcv
  • vcvc
  • vcvc

",           "created_at": {             "date": "2016-04-01 11:45:09.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "some text",           "created_at": {             "date": "2016-04-01 11:50:11.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "

fdfdfddf

",           "created_at": {             "date": "2016-04-01 11:56:19.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "

fddf

",           "created_at": {             "date": "2016-04-01 11:56:27.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         },         {           "author": {             "full_name": "Yaroslav Snisar",             "user_urlhash": "rustem"           },           "message": "

bold

italian

uuuuu

ssssss

left

center

right

link


  • df
  • df
  • fd

  1. 11212
  2. 211212
  3. 34323


",           "created_at": {             "date": "2016-04-01 11:57:43.000000",             "timezone_type": 3,             "timezone": "Europe/Kiev"           }         }       ]     }   } }