PHP code example of ayctor / cityscan

1. Go to this page and download the library: Download ayctor/cityscan library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ayctor / cityscan example snippets


$cs = new \CityScan\CityScan('api_key', 'client_key', 'preprod');

function activateAddressByRoad($road, $postal_code, $city, $external_id = null){}

$address = $cs->activateAddressByRoad('23, rue sébastien mercier', 75015, 'Paris', 'ayctor');

function activateAddressByGPS($latitude, $longitude, $external_id = null){}

$address = $cs->activateAddressByGPS(48.8445, 2.2786);

function deactivateAddress($id, $isExternal = false)

$res_road = $cs->deactivateAddress('ayctor', true);

$res_gps = $cs->deactivateAddress(74728);

function reactivateAddresses($ids, $isExternal = false){}

$cs->reactivateAddresses(['ayctor', 'digibox'], true);

$cs->reactivateAddresses(['ayctor', 'digibox'], true);

$cs->reactivateAddresses([74728, 74729]);

function getActives()

$adresses = $cs->getActives();

function getAll()

$adresses = $cs->getAll();

function getActivated($start = null, $end = null)

$adresses = $cs->getActivated('2018-01-01','2018-02-01');

function getActivated($start = null, $end = null)

$adresses = $cs->getActivated('2018-01-01','2018-02-01');

function getDeactivated($start = null, $end = null)

$adresses = $cs->getDeactivated('2018-01-01','2018-02-01');

function report($id, $isExternal = false)

$report = $cs->report('ayctor', true);

json
{
  "status": 0,
  "content": {
    "addresses": [
      {
          "id": 74728,
          "route": "23, rue Sébastien Mericer",
          "postalCode": "75015",
          "city": "Paris",
          "externalAddressId": "ayctor",
          "active": true,
          "activation": "2020-01-03 18:42:47",
          "deactivation": null,
          "lastSeen": null,
          "lat": 48.8445, 
          "lon": 2.2786
      },
      {
          "id": 74729,
          "route": "23, rue Sébastien Mericer",
          "postalCode": "75015",
          "city": "Paris",
          "externalAddressId": "digibox",
          "active": true,
          "activation": "2020-01-03 18:42:47",
          "deactivation": null,
          "lastSeen": null,
          "lat": 48.8445, 
          "lon": 2.2786
      }
    ]
  }
}
json
{
  "status": 0,
  "content": {
    "count": 12,
    "addresses": [
      {
        "id": 68401,
        "route": "73 rue lecourbe",
        "postalCode": "75015",
        "city": "Paris",
        "externalAddressId": null,
        "active": true,
        "activation": "2019-01-02 09:43:48",
        "deactivation": null,
        "lat": 48.843331,
        "lon": 7.230364
      }, ...
    ]
  }
}
json
{
  "status": 0,
  "content": {
    "count": 12,
    "addresses": [
      {
        "id": 68401,
        "route": "73 rue lecourbe",
        "postalCode": "75015",
        "city": "Paris",
        "externalAddressId": null,
        "active": true,
        "activation": "2019-01-02 09:43:48",
        "deactivation": null,
        "lat": 48.843331,
        "lon": 7.230364
      }, ...
    ]
  }
}
json
{
  "status": 0,
  "content": {
    "count": 12,
    "addresses": [
      {
        "id": 68401,
        "route": "73 rue lecourbe",
        "postalCode": "75015",
        "city": "Paris",
        "externalAddressId": null,
        "active": true,
        "activation": "2019-01-02 09:43:48",
        "deactivation": null,
        "lat": 48.843331,
        "lon": 7.230364
      }, ...
    ]
  }
}
json
{
  "status": 0,
  "content": {
    "count": 12,
    "addresses": [
      {
        "id": 68401,
        "route": "73 rue lecourbe",
        "postalCode": "75015",
        "city": "Paris",
        "externalAddressId": null,
        "active": true,
        "activation": "2019-01-02 09:43:48",
        "deactivation": null,
        "lat": 48.843331,
        "lon": 7.230364
      }, ...
    ]
  }
}
json
{
  "status": 0,
  "content": {
    "count": 12,
    "addresses": [
      {
        "id": 68401,
        "route": "73 rue lecourbe",
        "postalCode": "75015",
        "city": "Paris",
        "externalAddressId": null,
        "active": true,
        "activation": "2019-01-02 09:43:48",
        "deactivation": null,
        "lat": 48.843331,
        "lon": 7.230364
      }, ...
    ]
  }
}