Basic SDK to deal with mapotempo records
Tell composer to require this bundle by running:
composer require ldubois/php-mapotempo
$apikey = "API_KEY"; // Your Api key
$url = "URL"; // Your url application mapotempo
$table ="TABLE"; // A table to interact
$mapotempo = new Mapotempo($url, $apikey);
$records = $mapotempo->findRecords($table);
$mapotempo = new Mapotempo($url, $apikey);
$fields =
[
"ref" => "TEST",
"name" => "new client",
"street" => "12 avenue Thiers",
"postalcode" => 33100,
"city" => "Bordeaux",
"country" => "France",
"detail" => "2ème étage",
"tag_ids" => [],
"visits" => []
];
$criteria = ["ref" => $fields["ref"]];
$des = $mapotempo->createTableManipulator('destinations');
if ($des->containsRecord($criteria)) {
$des->updateRecord($criteria, $fields);
} else {
$des->createRecord($fields);
}
Fork : This library is under the MIT license. See the complete license.