1. Go to this page and download the library: Download wyz/practicalafas 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/ */
wyz / practicalafas example snippets
use PracticalAfas\Client\RestCurlClient;
$client = new RestCurlClient( [ 'customerId' => 12345, 'appToken' => '64CHARS' ] );
$result_as_json_string = $client->callAfas(
'GET',
'connectors/MyGetConnectorName',
[ 'take' => 1000,
'filterfieldids' => 'SomeCategory,Updated',
'filtervalues' => 'CategName,2017-01-01T16:00:00',
'operatortypes' => '1,4',
'orderbyfieldids' => '-Updated'
]
);
$attachment = $client->callAfas('GET', 'subjectconnector/123');
// This is inserting a new organisation with only its name filled:
$client->callAfas('POST', 'connectors/KnOrganisation', [], '{"KnOrganisation":{"Element":{ "Fields":{"MatchOga":0,"Nm":MyCompany Ltd."}}}}'