-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added examples for Portal API and fixed filters for Portal API
- Loading branch information
1 parent
b3aad91
commit 75acc49
Showing
23 changed files
with
771 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# getArticles | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$articles = $portalAPI->get('articles', params: ['filter' => 'searchArticleNumber', 'articlenr' => 'test']); | ||
if(is_array($articles) && array_key_exists('error', $articles)) { | ||
echo "Code: " . $articles['code'] . "\n"; | ||
echo "Error: " . $articles['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($articles) . " articles\n"; | ||
if(count($articles) > 0) { | ||
$oneArticle = array_pop($articles); | ||
$oneArticleId = $oneArticle['mexcParamvaluesetsid']; | ||
$article = $portalAPI->get('articles/' . $oneArticleId); | ||
echo "And the last article is:\n"; | ||
echo json_encode($article, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# getConversationss | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$conversations = $portalAPI->get('conversations'); | ||
if(is_array($conversations) && array_key_exists('error', $conversations)) { | ||
echo "Code: " . $conversations['code'] . "\n"; | ||
echo "Error: " . $conversations['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($conversations) . " conversations\n"; | ||
if(count($conversations) > 0) { | ||
$oneConversation = array_pop($conversations); | ||
$oneConversationId = $oneConversation['mexcParamvaluesetsid']; | ||
$conversation = $portalAPI->get('conversations/' . $oneConversation); | ||
echo "And the last conversation is:\n"; | ||
echo json_encode($conversation, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# getCountries | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$countries = $portalAPI->get('countries'); | ||
if(is_array($countries) && array_key_exists('error', $countries)) { | ||
echo "Code: " . $countries['code'] . "\n"; | ||
echo "Error: " . $countries['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($countries) . " countries\n"; | ||
if(count($countries) > 0) { | ||
$oneCountry = array_pop($countries); | ||
echo "And the last country is:\n"; | ||
echo json_encode($oneCountry, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# getCreditflow | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$creditflow = $portalAPI->get('creditflow/search/5501011018'); | ||
if(is_array($creditflow) && array_key_exists('error', $creditflow)) { | ||
echo "Code: " . $creditflow['code'] . "\n"; | ||
echo "Error: " . $creditflow['error'] . "\n"; | ||
exit; | ||
} | ||
echo json_encode($creditflow, JSON_PRETTY_PRINT); | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# getCurrencies | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$currencies = $portalAPI->get('currencies'); | ||
if(is_array($currencies) && array_key_exists('error', $currencies)) { | ||
echo "Code: " . $currencies['code'] . "\n"; | ||
echo "Error: " . $currencies['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($currencies) . " currencies\n"; | ||
if(count($currencies) > 0) { | ||
$oneCurrency = array_pop($currencies); | ||
echo "And the last currency is:\n"; | ||
echo json_encode($oneCurrency, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# getCustomers | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$customers = $portalAPI->get('customers', params: ['filter' => 'search', 'search' => 'Testperson']); | ||
if(is_array($customers) && array_key_exists('error', $customers)) { | ||
echo "Code: " . $customers['code'] . "\n"; | ||
echo "Error: " . $customers['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($customers) . " customers\n"; | ||
if(count($customers) > 0) { | ||
$oneCustomer = array_pop($customers); | ||
$oneCustomerId = $oneCustomer['mexcParamvaluesetsid']; | ||
$customer = $portalAPI->get('customers/' . $oneCustomerId); | ||
echo "And the last customer is:\n"; | ||
echo json_encode($customer, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# getInvoices | ||
|
||
<include from="Snippets-PortalAPI.md" element-id="snippet-header" /> | ||
|
||
Start typing here... | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
use Qvickly\Api\Portal\PortalAPI; | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
$portalAPI = new PortalAPI($_ENV['TOKEN'], testMode: true); | ||
$invoices = $portalAPI->get('invoices', params: ['filter' => 'search', 'search' => 'Testperson']); | ||
if(is_array($invoices) && array_key_exists('error', $invoices)) { | ||
echo "Code: " . $invoices['code'] . "\n"; | ||
echo "Error: " . $invoices['error'] . "\n"; | ||
exit; | ||
} | ||
echo "Found " . count($invoices) . " invoices\n"; | ||
if(count($invoices) > 0) { | ||
$oneInvoice = array_pop($invoices); | ||
$oneInvoiceId = $oneInvoice['invoiceid_real']; | ||
$invoice = $portalAPI->get('invoices/' . $oneInvoiceId); | ||
echo "And the last invoice is:\n"; | ||
echo json_encode($invoice, JSON_PRETTY_PRINT); | ||
} | ||
|
||
|
||
|
||
]]> | ||
</code-block> | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
|
||
</tabs> |
Oops, something went wrong.