proxyclick List visits api in php

In this post we will show you proxyclick List visits api in php, hear for proxyclick List visits api in php we will give you demo and example for implement.

how to use proxyclick List visits api in php
how to use proxyclick List visits api in php

This endpoint retrieves all visits of a company between two dates.

HTTP Request

GET
$ curl https://api.proxyclick.com/v1/companies/<companyId>/vm/visits?from=<fromDate>&to=<toDate> \
-H 'Authorization: Bearer <youraccessToken>'
// your company Id
$companyId = "CO-******";

// get token token
$url = 'https://api.proxyclick.com/oauth/token';  
$headers = array('Content-Type: application/x-www-form-urlencoded');
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
$output = json_decode($output, true);
// output access token
$access_token = $output['access_token'];

// now get List visits data
$list_users_url = "https://api.proxyclick.com/v1/companies/".$companyId."/users?q=myeamil@gmail.com";

$list_users_array = array("Authorization: Bearer ".$access_token);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $list_users_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $list_users_array);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
curl_close($curl);				
$output = json_decode($response, true);

output of proxyclick List visits api in php

HTTP/1.1 200 OK

{
  "total": 27,
  "limit": 6,
  "visits": [
    {
      "object": "visit",
      "id": "2017-02-18:M-YWEI863:V-ETBZ519",
      "visitor": {
        "object": "visitor",
        "id": "V-ETBZ519",
        "firstname": "Justin",
        "lastname": "Diaz",
        "companyName": "Keyline",
        "email": "justin.diaz@keyline.com",
        "phone": "",
        "mobile": "",
        "language": {
          "code": "en",
          "name": "English",
          "displayName": "English"
        }
        "pictureOriginal": "https://...",
        "picture24": "https://...",
        "picture36": "https://...",
        "picture64": "https://...",
        "picture128": "https://...",
        "picture192": "https://...",
        "function": null,
        "about": null,
        "licensePlate": null,
        "customFields": [
          {
            "object": "customFieldValue",
            "id": 2386,
            "name": "Passport number",
            "valueType": "STRING",
            "value": "PN733949125"
          }
        ]
      },
      "meeting": {
        "object": "meeting",
        "id": "M-YWEI863",
        "title": "Discuss partnership"
      },
      "company": {
        "object": "corporate",
        "id": "CO-RTG202",
        "name": "SunFix",
        "timezone": "America/New_York",
        "locale": "en-US",
        "phone": "+12125551423",
        "logoOriginal": "https://...",
        "logo24": "https://...",
        "logo36": "https://...",
        "logo64": "https://...",
        "logo128": "https://...",
        "logo192": "https://...",
        "createdAt": "2017-01-07T09:05:31Z",
        "lastModifiedAt": "2017-02-19T09:32:53Z"
      },
      "host": {
        "object": "user",
        "id": "US-G606",
        "firstname": "Jordan",
        "lastname": "Gray",
        "companyName": "SunFix",
        "email": "jordan.gray@sunfix.com",
        "phone": "+447484396025",
        "mobile": "+447484396026",
        "language": {
          "code": "en",
          "name": "English",
          "displayName": "English"
        },
        "pictureOriginal": "https://...",
        "picture24": "https://...",
        "picture36": "https://...",
        "picture64": "https://...",
        "picture128": "https://...",
        "picture192": "https://...",
        "createdAt": "2014-01-07T09:05:31Z",
        "lastModifiedAt": "2017-02-18T14:52:51Z"
      },
      "partOfGroup": false,
      "status": {
        "object": "status",
        "id": 1,
        "value": "Expected"
      },
      "timezone": "America/New_York",
      "expectedAt": "2017-02-18T16:00:00+01:00",
      "leavingAt": "2017-02-18T18:00:00+01:00",
      "arrivedAt": null,
      "leftAt": null,
      "customFields": null,
      "createdAt": "2017-02-18T14:57:32Z",
      "lastModifiedAt": "2017-02-18T14:57:32Z",
      "smsReminder": 1
    },
    ...
  ]
}

Hope this code and post will helped you for implement proxyclick List visits api in php. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs onlincode.org