Subrata
Subrata

Reputation: 175

Connectwise REST API Implementation

In my application , I am going to use connectwise API , but I can't figure out how to call their API, like

  1. API end point
  2. How to pass header
  3. How to authentication (I have company id , public and private key)
  4. How to make call and take response
  5. I am PHP guy

Thanks in advance for any help !!

Upvotes: 2

Views: 10741

Answers (1)

SpaDusA
SpaDusA

Reputation: 324

ConnectWise has a developer portal that is very helpful for this stuff: developer.connectwise.com. If you don't have a login, create a ticket with them to give you access.

Here are basic answers to your questions, though:

  1. The endpoint prefix is this: https://[connectwise_server]/v4_6_release/apis/3.0/ and then you add to the end depending on the resource you're querying
  2. I believe the only headers you need are Content-Type: application/json and the authentication header (see below)
  3. Authentication is BASIC auth. In PHP, that would look something like this.

    $username = $companyId .'+'. $publicKey;
    $password = $privateKey;
    curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);
    
  4. A quick search of SO produced this starting point: Call a REST API in PHP

  5. I used to be one of those, too.

Upvotes: 5

Related Questions