Zendesk integration

Discussion in 'Integration' started by david_landry, Aug 15, 2014.

  1. david_landry

    david_landry New Member

    Joined:
    Jul 7, 2013
    Messages:
    8
    Hi,

    Just posting since I couldn't find the information and support was able to guide me. This will probably help other with the Zendesk integration.

    After installing and configuring the Zendesk plugins, you have to do this:
    1. Create integration for zendesk plugin in amember CP -> Protect Content -> Integration.
    2. Click new then select zendesk plugin group which will be assigned to
    user and products which user should have in order to be added to zendesk.

    This will allow user to be created in Zendesk.

    If for any reason, you need to push user back to Zendesk, you can go Use amember CP -> Rebuild DB to transfer active users.

    Hope this help someone!
  2. drmartinjr3i

    drmartinjr3i aMember Pro Customer

    Joined:
    Jun 23, 2009
    Messages:
    6
    David,

    Thanks for your post, but I have a few questions. First, let me explain what I've done..

    In aMember Pro (version 4.4.2), I went to Protect Content > Integrations > New Record.
    After selecting Zendesk from the Plugin DDL, the only Zendesk usergroup option was "Registered", so I chose that. lastly was the Access Permissions; I set that to a group that would encompass all of our users.

    After that was saved, I navigated to Utilities > Rebuild Db > Rebuild Zendesk Database...

    Everything was looking good until this happened..

    08/28/14, 08:13 PM /member/admin-rebuild/do 72.188.186.214 Curl error: SSL connect error
    Click to Expand
    Exception HTTP_Request2_ConnectionException
    HTTP_Request2_Adapter_Curl::wrapCurlError [ library/pear/HTTP/Request2/Adapter/Curl.php : 196 ]
    HTTP_Request2_Adapter_Curl->sendRequest [ library/pear/HTTP/Request2.php : 923 ]
    HTTP_Request2->send [ application/default/plugins/protect/zendesk.php : 71 ]
    Am_Protect_Zendesk->sendRequest [ application/default/plugins/protect/zendesk.php : 155 ]
    Am_Protect_Zendesk->updateUser [ application/default/plugins/protect/zendesk.php : 129 ]
    Am_Protect_Zendesk->onSubscriptionChanged [ application/default/plugins/protect/zendesk.php : 218 ]
    Am_Protect_Zendesk->batchProcess
    call_user_func_array [ library/Am/App.php : 2575 ]
    Am_BatchProcessor->run [ application/default/plugins/protect/zendesk.php : 196 ]
    Am_Protect_Zendesk->onRebuild
    call_user_func [ application/default/controllers/AdminRebuildController.php : 267 ]
    AdminRebuildController->doAction [ library/Am/Controller.php : 139 ]
    Am_Controller->_runAction [ library/Am/Controller.php : 116 ]
    Am_Controller->dispatch [ library/Zend/Controller/Dispatcher/Standard.php : 308 ]
    Zend_Controller_Dispatcher_Standard->dispatch [ library/Zend/Controller/Front.php : 954 ]
    Zend_Controller_Front->dispatch [ library/Am/App.php : 1955 ]
    Am_App->run [ index.php : 92 ]
  3. drmartinjr3i

    drmartinjr3i aMember Pro Customer

    Joined:
    Jun 23, 2009
    Messages:
    6
    So, the questions are:

    How do I prevent that error from occuring so I can finish transfering over all of our users into Zendesk?

    Is it possible to transfer over more information than just their Name and email address, because those are the only things that seem to be coming over.

    Also, how do I import all of our prior aMember tickets into Zendesk, so we'll have our current history available for searching in Zendesk and all the users won't loose this information when we switch over?
  4. david_landry

    david_landry New Member

    Joined:
    Jul 7, 2013
    Messages:
    8
    Hi,

    I'm not an expert but I'll try my bet to help you.

    #1. Not sure about the error, help desk may be more helpful for that. Did you configure the plugin with connection information and keys? The error is mentioning SSL, are you using SSL? That's the best I can do, sorry.

    #2. Transferring more information will require customization. You can send a request to help desk and usually it's really affordable. You can add them yourself if you have some coding knowledge. The Zendesk API is fairly simple. The plugin is using the Users API (http://developer.zendesk.com/documentation/rest_api/users.html) and you could simply add the required field in the code. By reading a bit and getting some pointer on the aMember portion from Help Desk, it can be done by yourself.

    #3. You have to build a script to transfer with the Zendesk API.

    Regards!
  5. jordank

    jordank aMember Pro Customer

    Joined:
    Nov 22, 2008
    Messages:
    1
    Hey David where do you find the Zendesk plugin?
  6. david_landry

    david_landry New Member

    Joined:
    Jul 7, 2013
    Messages:
    8
    You need to request it from the aMember team. I believe it's around 40$.
  7. david_landry

    david_landry New Member

    Joined:
    Jul 7, 2013
    Messages:
    8
    Some added information for those who want to have the interface user Verified iin aMember. You need to modify the following code in zendesk.php

    find
    function addUser(User $user)
    {
    $res = $this->sendRequest('users.json', json_encode(array(
    'user' => array(
    'email' => $user->email,
    'name' => $user->getName(),
    'role' => 'end-user',
    )
    )), Am_HttpRequest::METHOD_POST);
    return $res['user']['id'];
    }

    and replace it with

    function addUser(User $user)
    {
    $res = $this->sendRequest('users.json', json_encode(array(
    'user' => array(
    'email' => $user->email,
    'name' => $user->getName(),
    'role' => 'end-user',
    'Verified' => 'true',
    )
    )), Am_HttpRequest::METHOD_POST);
    return $res['user']['id'];
    }

    Do the same for function updateUser.

    Hope it helps!

Share This Page