Giter VIP home page Giter VIP logo

api-client-php's People

Contributors

bgurney avatar hagii avatar jakehaas avatar lukiq avatar moebrowne avatar morus12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-client-php's Issues

ensureInteger() being called on $chatId argument that is of aplha numeric type.

CHAT_ID is a combination of both integers and strings, this effectively doesn't allow me to call, for instance getSingleChat('FG45GKJ65') without an exception being thrown. Removing the call for ensureInteger() in each method that accepts a CHAT_ID resolves the issue.

Is there any reason why this is in place when ID's aren't integers?

API tickets with php

Hi!

I would like now how to work with API tickets. I doesn't find any example in php.
With the API of chats, visitors, no problems.

Thanks!

Fatal error during agents get call

I just updated the library to your most recent version 1.0
However, I get the following when I try to invoke a simple agents get.

Fatal error: Uncaught exception 'Exception' with message 'No such model: agents' in C:\xampp\livechat\src\LiveChat\Api\Client.php:52 Stack trace: #0 C:\xampp\livechat\index.php(9): LiveChat\Api\Client->__get('agents') #1 {main} thrown in C:\xampp\livechat\src\LiveChat\Api\Client.php on line 52

Live chat fetal error

With same composer i have tried on other server and its working fine even on localhost its working fine except my server ... , can you please provide me exact php requirement to run this composer so that i will do changes in my server

When i am trying with the given composer on my server it giving me following error ๐Ÿ‘Ž

Fatal error: Uncaught exception 'Exception' with message '. ' in /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php:186 Stack trace: #0 /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php(157): LiveChat\Api\Rest\RestRequest->throwException(0) #1 /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Model/BaseModel.php(133): LiveChat\Api\Rest\RestRequest->getResponse() #2 /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Model/BaseModel.php(42): LiveChat\Api\Model\BaseModel->executeRequest('GET', 'chats?date_to=2...') #3 /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Model/Chats.php(20): LiveChat\Api\Model\BaseModel->executeGet('chats?date_to=2...') #4 /home/chatagents/public_html/lc_api/akash_api.php(23): LiveChat\Api\Model\Chats->get(Array) #5 {main} thrown in /home/chatagents/public_html/lc_api/vendor_new/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php on line 186

installing via composer

With this line does the "@dev" section refer to the directory where Livechat will be installed?

$ composer require livechat/api-client-php "@dev"

Documentation Update for Reports Method

Do you think you could add a little note in the documentation for the Reports Method that specifies that $type should include the full URI, not just the report name?

https://developers.livechatinc.com/rest-api/#!reports

IE: If I wanted to use "chatting_time", then $type would need to be chats/chatting_time, not just chatting_time.

Another example would be Chat Ranking. $type needs to be chats/ratings/ranking.

A little heads up in the docs would be greatly appreciated.

Error while using agent->update function

Hi,
I am receiving this error when using the agent update function.

Invalid data input for postBody. Array expected
Here is my call:
$agent_specific = $LiveChatAPI->agents->update(array("name"=>"John Doe"));

I also tried this:
$agent_specific = $LiveChatAPI->agents->update("[email protected]",array("name"=>"John Doe"));

Thank you for your time.

Tickets

When are you going to have tickets integrated in to this PHP client?

Adding annotations

I suggest to add an annotation to the Client class, because now PhpStorm highlights that calls:

$this->liveChatApi->chats->get(['visitor_id' => $identifier])

This should look like:

/**
 * LiveChat Api Client class.
 * @property \LiveChat\Api\Model\Chats chats
 * @property \LiveChat\Api\Model\Goals goals
 * @property \LiveChat\Api\Model\Agents agents
 * and so on
 */
class Client
{
...

Additionally in the model classes there is unused import: use LiveChat\Api\Model\BaseModel;.

Unable to update status field for agent

I run the following curl command:

curl "https://api.livechatinc.com/agents/[email protected]" -u [email protected]:API_KEY -H X-API-Version:2 -X PUT -d "status=accepting+chats&max_chats_count=2"

However, the output I receive always returns the following JSON response.
Essentially, the field "status" is never updated.

{"login":"[email protected]","name":"Milder John Bernard Lisondra","login_status":"not accepting chats","permission":"administrator","daily_summary":0,"ticket_notifications":0,"job_title":"Support Agent","avatar":"livechat.s3.amazonaws.com/default/avatars/ab5b0666feffd67600206cd519fd77ea.jpg","notifications":{"new_visitor":0,"returning_visitor":0,"queued_visitor":1,"visitor_is_typing":0,"new_goal":1,"incoming_chat":1},"max_chats_count":2,"mute_all_sounds":0,"repeat_sound_notifications":0,"work_scheduler":{},"groups":[{"id":9,"name":"Testing"}],"status":"offline","last_logout":1436561366}

unable to update agent

I have the following code.
Everything works well except when using the update method.
I am passing in the login and an array of parameters as outlined in the github documentation.
However, I don't get a response from the API.
Thanks.

require_once __DIR__ . '/vendor/autoload.php';

use LiveChat\Api\Client as LiveChat;

$LiveChatAPI = new LiveChat('[email protected]', 'xyz123');
$agents = $LiveChatAPI->agents->get();

foreach($agents as $agent){
    if($agent->login == "[email protected]"){
        print '<pre>';
        print_r($agent);
        print '</pre>';         
    }

}

$LiveChatAPI = new LiveChat('[email protected]', 'xyz123');
$user_login = "[email protected]";
$user_updates = array("name"=>"Milder Lisondra");
$LiveChatAPI->agents->update($user_login, $user_updates)

Getting error when trying with new composer

Here is the error which i am getting :-

Fatal error: Uncaught exception 'Exception' with message 'Something went wrong. StausCode: 0' in /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php:159 Stack trace: #0 /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php(145): LiveChat\Api\Rest\RestRequest->throwException(0) #1 /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Model/BaseModel.php(129): LiveChat\Api\Rest\RestRequest->getResponse() #2 /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Model/BaseModel.php(39): LiveChat\Api\Model\BaseModel->executeRequest('GET', 'chats?date_to=2...') #3 /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Model/Chats.php(20): LiveChat\Api\Model\BaseModel->get('chats?date_to=2...') #4 /home/chatagents/public_html/lc_api/akash_api.php(16): LiveChat\Api\Model\Chats->get(Array) #5 {main} thrown in /home/chatagents/public_html/lc_api/vendor/livechat/api-client-php/src/LiveChat/Api/Rest/RestRequest.php on line 159

Update Tags Not Working

I am trying to update tags for a chat. Relevant code is


$tags=array();
$tags[]="sale";
$LiveChatAPI->chats->updateTags($chat_id,$tags);

The request is successful, returns chat data as response but tags are never updated. Tags remain empty.

If I assign tag from admin panel and then update the tags for same chat via API, even those tags are removed.

Looks like some parameters' format issue. Kindly guide ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.