Answers.Body: <p>Assuming you've got Composer installed from the <a href="https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx" rel="nofollow noreferrer">command line</a>, you can navigate to your project's root (where your project's composer.json file lives), then run this from the command line:</p>
  
  <pre><code>composer require zohocrm/php-sdk
  </code></pre>
  
  <p>From there, Composer and Craft pretty much take care of everything, including setting up the autoloading and you can reference <code>ZCRMRestClient::initialize();</code> from your module/service.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-16T15:55:21.890Z
Answers.Text: Thanks for your answer. I'm pretty sure I tried it, but in the end the problem was that I tried calling it as `ZCRMRestClient::initialize();` and not as `\ZCRMRestClient::initialize();˚, so with a slash at the beginning. I also tried `use ZCRMRestClient` and then calling it without the slash, but that didn't work — maybe I should learn a bit more about the `use` statement ;-)
Answers.UserDisplayName: Robert Cordes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-09T20:55:06.440Z
Answers.LastActivityDate: 2018-12-09T20:55:06.440Z
Answers.UserDisplayName: Brad Bell
Body: <p>For a client I need to connect a rather complex contact form with the Zoho CRM. They're offering a <a href="https://www.zoho.com/crm/help/developer/server-side-sdks/php.html" rel="nofollow noreferrer">PHP SDK</a> which sounds great, but I can't get it to work. It's very likely that I'm just stupid, because I can't even include the SDK to just call the initial setup method.</p>
  
  <p>The documentation says (under "Using the PHP SDK") to include the following line where needed:</p>
  
  <pre><code>require ‘vendor/autoload.php’
  </code></pre>
  
  <p>That doesn't seem to be needed, as it's already done in the main <strong>index.php</strong> by Craft itself.</p>
  
  <p>I want to use the SDK within a service class I've created under <strong>modules/services</strong>. So within my class I tried the following:</p>
  
  <pre><code>require "../vendor/zohocrm/php-sdk/src/index.php";
  </code></pre>
  
  <p>That's getting the the <strong>index.php</strong> from the SDK but when I'm calling the method <code>ZCRMRestClient::initialize()</code> I just get the following error message:</p>
  
  <blockquote>
    <p>Class 'modules\services\ZCRMRestClient' not found</p>
  </blockquote>
  
  <p>I'm probably missing some really basic stuff but I just don't know what else to do.</p>
  
Tags: <error-message><composer><services>
Title: Install Zoho CRM SDK (or any SDK for that matter)
ThreadText: # Install Zoho CRM SDK (or any SDK for that matter)
  
  (Asked by: username_0 on 2018-12-08)
  
  For a client I need to connect a rather complex contact form with the Zoho CRM. They're offering a [PHP SDK](https://www.zoho.com/crm/help/developer/server-side-sdks/php.html) which sounds great, but I can't get it to work. It's very likely that I'm just stupid, because I can't even include the SDK to just call the initial setup method.
  
  The documentation says (under "Using the PHP SDK") to include the following line where needed:
  
  ```
  require ‘vendor/autoload.php’
  
  ```
  
  That doesn't seem to be needed, as it's already done in the main **index.php** by Craft itself.
  
  I want to use the SDK within a service class I've created under **modules/services**. So within my class I tried the following:
  
  ```
  require "../vendor/zohocrm/php-sdk/src/index.php";
  
  ```
  
  That's getting the the **index.php** from the SDK but when I'm calling the method `ZCRMRestClient::initialize()` I just get the following error message:
  
  > Class 'modules\services\ZCRMRestClient' not found
  
  I'm probably missing some really basic stuff but I just don't know what else to do.
  
  **Tags:** error-message, composer, services
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-09. Score: 0 | Accepted answer
  
  Assuming you've got Composer installed from the [command line](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx), you can navigate to your project's root (where your project's composer.json file lives), then run this from the command line:
  
  ```
  composer require zohocrm/php-sdk
  
  ```
  
  From there, Composer and Craft pretty much take care of everything, including setting up the autoloading and you can reference `ZCRMRestClient::initialize();` from your module/service.
  
  > **Comments:**
  > **username_0**: Thanks for your answer. I'm pretty sure I tried it, but in the end the problem was that I tried calling it as `ZCRMRestClient::initialize();` and not as `\ZCRMRestClient::initialize();˚, so with a slash at the beginning. I also tried `use ZCRMRestClient` and then calling it without the slash, but that didn't work — maybe I should learn a bit more about the `use` statement ;-)  
  
  ---
  
  