How to make REST calls in PHP

Example of calling GET request //next example will recieve all messages for specific conversation $service_url = 'https://example.com/api/conversations/[CONV_CODE]/messages&apikey=[API_KEY]'; $curl = curl_init($service_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); if ($curl_response === false) { $info = curl_getinfo($curl); curl_close($curl); die('error occured during curl exec. Additioanl info: ' . var_export($info)); } curl_close($c...

Using REST API without mod_rewrite

It is possible to use call LiveAgent API (https://support.liveagent.com/840770-Complete-API-reference) also without support of mod_rewrite in your Apache (or something similar). You just need to change call URL a bit. Here is an example of ordinary API URL call with the support of mod_rewrite: https://example.com/api/conversations/[conversationid]/messages?apikey=key123456 and this is how it looks like without mod_rewrite support: URL_To_LiveAgent/api/index.php?handler=conversations/...

Complete API reference

Data fields formats (#dataformats) Return messages formats (#returnmsgs) Error messages formats (#errormsgs) Api v.1 (#apiv1) Agents (#apiv1_agents) Retrieves agent info and auth token (#f825ae04fd0a7fc028cb428684d17fe0) Application (#apiv1_application) Return application installation date and latest version (#af645efcdcd9029af737024b10f38b61) Companies (#apiv1_companies) Retrieve list of companies (#ddf8329339a993d35f63e3f972f657d7) Retrieve company info (#77fd57bc8e33ed000f883c12ac0c...
×