PHP code example of arimac / sigfox

1. Go to this page and download the library: Download arimac/sigfox 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/ */

    

arimac / sigfox example snippets



use Arimac\Sigfox\Sigfox;

$sigfox = new Sigfox("myapikey", "password");

$device = $sigfox->devices()->find("AF01F")->get();

$sigfox->devices()->find("AF01F")->update(["deviceTypeId"=>"0f1bc092ef..."]);

$sigfox->devices()->create([
    "pac"=> "585CB3B42AC98BD4",
    "name"=> "Device 1",
    "deviceTypeId"=> "57309548171c857460043085",
    "id"=> "00FF"
]);

// Or you can use objects to pass data
$deviceId = $sigfox->devices()->create(
    (new DeviceCreationJob)
        ->setPac("585CB3B42AC98BD4")
        ->setId("00FF")
        ->setName("Device 1")
        ->setDeviceTypeId("57309548171c857460043085")
);


$sigfox->devices()->find("AF01F")->delete();