PHP code example of robo-meister / robo-connector-api

1. Go to this page and download the library: Download robo-meister/robo-connector-api 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/ */

    

robo-meister / robo-connector-api example snippets


use Robo\ConnectorSdk\AppStoreClient;

$client = new AppStoreClient(
    baseUrl: 'https://robo-meister.com',
    accessToken: 'app-store-user-token'
);

use Robo\ConnectorSdk\ExternalServiceClient;

$client = new ExternalServiceClient(
    baseUrl: 'https://robo-meister.com',
    apiToken: 'organisation-api-token',
    productId: 'flowbeacon-ai'
);

$client = new ExternalServiceClient(
    baseUrl: 'https://robo-meister.com',
    apiToken: 'organisation-api-token',
    productId: 'flowbeacon-ai',
    defaultHeaders: [
        'X-Correlation-ID' => 'req-123',
    ],
    timeoutSeconds: 45,
    connectTimeoutSeconds: 10,
);

$appStore = new AppStoreClient(
    baseUrl: 'https://robo-meister.com',
    accessToken: 'app-store-user-token',
    defaultHeaders: [
        'X-Correlation-ID' => 'req-123',
    ],
    timeoutSeconds: 45,
    connectTimeoutSeconds: 10,
);

$intent = $appStore->getPurchaseIntent('marketplace', 'flowbeacon-ai', [
    'version' => '1.2.3',
]);

$install = $appStore->installPackage(
    'marketplace',
    'flowbeacon-ai',
    $intent['install_request']['payload'],
    idempotencyKey: 'install-'.bin2hex(random_bytes(8))
);

$status = $appStore->getInstallJob($install['job_id']);

$checkoutSession = $appStore->createCheckoutSession([
    'user_id' => 'user-123',
    'owner_type' => 'workspace',
    'owner_id' => 'workspace-123',
    'organisation_id' => 'org-123',
    'selected_offer_sku' => 'ROBO_CONNECTOR_TICKET_LTD_SOLO',
    'currency' => 'USD',
], idempotencyKey: 'checkout-'.bin2hex(random_bytes(8)));

$csvReport = $client->fetchData('/api/reports/monthly', 'csv', [
    'month' => '2026-05',
]);

$pdfInvoice = $client->fetchData('/api/invoices/invoice-id/export', 'pdf');

$defaultFormat = $client->fetchData('/api/reports/monthly'); // no format override

$xmlPayload = $client->request('GET', '/api/data-feed', [
    'format' => 'xml',
    'format_query' => 'output', // optional; defaults to "format"
]);

$providers = $client->listProviders();
$paymentProviders = $client->listPaymentProviders();

$clientData = $client->upsertClient([
    'email' => '[email protected]',
    'name' => 'Customer Name',
    'product_id' => 'flowbeacon-ai',
], idempotencyKey: 'client-'.bin2hex(random_bytes(8)));

$payment = $client->createPayment([
    'product_id' => 'flowbeacon-ai',
    'provider' => 'stripe',
    'amount' => 249.00,
    'currency' => 'EUR',
    'client' => '[email protected]',
    'metadata' => ['source' => 'integration-demo'],
], idempotencyKey: 'payment-'.bin2hex(random_bytes(8)));

$tickets = $client->listTickets(['page' => 1, 'limit' => 25]);
$ticket = $client->getTicket('ticket-id');
$updatedTicket = $client->updateTicket('ticket-id', [
    'status' => 'resolved',
], idempotencyKey: 'ticket-'.bin2hex(random_bytes(8)));

$documents = $client->listDocuments(['page' => 1, 'limit' => 25]);
$document = $client->getDocument('document-id');
$updatedDocument = $client->updateDocument('document-id', [
    'status' => 'approved',
], idempotencyKey: 'document-'.bin2hex(random_bytes(8)));

$invoice = $client->createInvoice([
    'customer' => '[email protected]',
    'lines' => [
        ['description' => 'Subscription', 'amount' => 249.00, 'currency' => 'EUR'],
    ],
], idempotencyKey: 'invoice-'.bin2hex(random_bytes(8)));

$invoices = $client->listInvoices(['page' => 1, 'limit' => 25]);
$updatedInvoice = $client->updateInvoice($invoice['invoice']['id'], [
    'status' => 'sent',
]);

$aiSystems = $client->listAiSystems();
$credentials = $client->getAiSystemCredentials('provider-id');

$billingPortal = $client->createBillingPortalSession([
    'provider' => 'stripe',
    'client' => '[email protected]',
    'portal_options' => ['return_url' => 'https://example.com/account'],
]);

$products = $client->listProducts();
$offers = $client->listProductOffers('flowbeacon-ai');
$variants = $client->listProductVariants('flowbeacon-ai');

$order = $client->createOrder([
    'productId' => 'flowbeacon-ai',
    'offerId' => 'offer-id',
    'ownerType' => 'organisation',
    'ownerId' => 'org-id',
], idempotencyKey: 'order-'.bin2hex(random_bytes(8)));

$paid = $client->payOrder($order['id'], idempotencyKey: 'pay-'.bin2hex(random_bytes(8)));

$refund = $client->recordRefund([
    'product_id' => 'flowbeacon-ai',
    'client' => '[email protected]',
    'amount' => 49.00,
    'currency' => 'EUR',
], idempotencyKey: 'refund-'.bin2hex(random_bytes(8)));

$bookingConfig = $client->getBookingConfig('intro-call');
$slots = $client->listBookingSlots('intro-call', [
    'from' => '2026-01-01T00:00:00Z',
    'to' => '2026-01-07T00:00:00Z',
]);

$submitted = $client->submitBooking(
    'intro-call',
    '2026-01-03T10:00:00Z',
    [
        'name' => 'Ada Lovelace',
        'email' => '[email protected]',
    ],
    idempotencyKey: 'booking-submit-'.bin2hex(random_bytes(8))
);

$createdBooking = $client->createBooking([
    'resourceName' => 'Room A',
    'resourceId' => 'room-a',
    'start' => '2026-01-03T10:00:00Z',
    'end' => '2026-01-03T10:30:00Z',
    'status' => 'pending',
    'metadata' => ['source' => 'sdk-demo'],
], idempotencyKey: 'booking-create-'.bin2hex(random_bytes(8)));

$bookings = $client->listBookings();

$meet = $client->createCalendarMeet([
    'title' => 'Intro call',
    'starts_at' => '2026-01-03T10:00:00Z',
]);

$batch = $client->batchCreateCalendarMeet([
    'items' => [
        ['title' => 'Call 1', 'starts_at' => '2026-01-03T11:00:00Z'],
        ['title' => 'Call 2', 'starts_at' => '2026-01-03T12:00:00Z'],
    ],
]);

$query = $client->queryCalendar([
    'from' => '2026-01-01T00:00:00Z',
    'to' => '2026-01-31T23:59:59Z',
]);

$suggestions = $client->suggestUniversalInput([
    'command' => 'Show overdue supplier invoices',
    'module' => 'finance',
    'limit' => 5,
    'execute_telemetry' => true,
], idempotencyKey: 'ui-'.bin2hex(random_bytes(8)));

$client->recordUniversalInputHistory([
    'command' => 'Show overdue supplier invoices',
    'module' => 'finance',
]);

$client->recordUniversalInputFeedback([
    'query' => 'Show overdue supplier invoices',
    'suggestion_key' => $suggestions['suggestions'][0]['key'] ?? 'finance.overdue_supplier_invoices',
    'accepted' => true,
    'correlation_id' => $suggestions['meta']['correlation_id'] ?? null,
]);

$executionLogs = $client->listUniversalInputExecutionLogs([
    'limit' => 20,
    'status' => 'executed',
]);

$aiResponse = $client->sendUniversalInputRequest([
    'command' => 'Draft the next supplier follow-up',
    'mode' => 'confirm_then_ask',
]);

$client->sendUniversalInputIngestion(
    'wallet-provider',
    'wallet.updated',
    $_ENV['UNIVERSAL_INPUT_SECRET'],
    ['schemaVersion' => '1.0', 'wallet' => ['balance' => 1200, 'currency' => 'USD']]
);

$rendered = $client->renderDocumentTemplateContent([
    'content' => 'Agreement for %%client_name%%',
    'fields' => ['client_name' => 'Ada Lovelace'],
], idempotencyKey: 'doc-render-'.bin2hex(random_bytes(8)));

$accepted = $client->acceptDocumentOcrDraft(
    'document-id',
    'draft-id',
    csrfToken: 'csrf-token-from-session',
    idempotencyKey: 'ocr-accept-'.bin2hex(random_bytes(8))
);

$channels = $client->listSocialChannels();
$posts = $client->listSocialPosts(['page' => 1, 'limit' => 20]);

$created = $client->createSocialPost([
    'title' => 'Launch update',
    'content' => 'We just shipped a new integration.',
    'description' => 'Release note post',
]);

$webhooks = $client->getPaymentsObservabilityWebhooks(limit: 50);
$reconciliation = $client->getPaymentsObservabilityReconciliation(limit: 50);

$wms = $client->wms();
$mes = $client->mes();
$scm = $client->scm();

$palletLedger = $wms->getPalletMovementLedger('pallet-id', [
    'organizationId' => 123,
    'limit' => 100,
]);

$scanCard = $wms->resolveScan('signed-scan-code', mode: 'inbound');
$scanResult = $wms->actOnScan(
    'signed-scan-code',
    'putaway',
    ['sectionCode' => 'A1-01-01'],
    mode: 'inbound',
    idempotencyKey: 'scan-'.bin2hex(random_bytes(8))
);

$program = $mes->getProductionLineProgram('line-id');
$lineMap = $mes->getProductionLineMap('line-id');
$queued = $mes->queueProductionLineTask(
    'line-id',
    ['task' => 'rebalance', 'priority' => 'high'],
    idempotencyKey: 'mes-task-'.bin2hex(random_bytes(8))
);

$flow = $scm->getSupplyChainFlow();
$carrier = $scm->assignCarrier(
    ['routePlanId' => 'route-plan-id'],
    idempotencyKey: 'carrier-'.bin2hex(random_bytes(8))
);
$transportEvent = $scm->createTransportEvent([
    'reference' => 'BOOKING-123',
    'status' => 'in_transit',
    'occurredAt' => '2026-05-07T12:00:00Z',
]);

$crmClient = $client->upsertClient([
    'email' => '[email protected]',
    'name' => 'Ada Lovelace',
    'phone' => '+48 123 456 789',
    'metadata' => ['segment' => 'founder'],
], idempotencyKey: 'crm-client-'.bin2hex(random_bytes(8)));

$listSubscription = $client->addToEmailList([
    'email' => '[email protected]',
    'list_id' => 'newsletter-founders',
    'metadata' => ['source' => 'php-sdk'],
], idempotencyKey: 'crm-list-'.bin2hex(random_bytes(8)));

$clientTypeSubscription = $client->addToEmailList([
    'client_type' => 'accounting-lead',
    'link_to_all_clients_of_type' => true,
    'list_id' => 'accounting-nurture',
]);

$email = $client->sendEmail([
    'to' => '[email protected]',
    'client' => '[email protected]',
    'subject' => 'Welcome to Robo Connector',
    'body' => 'Your workspace is ready.',
], idempotencyKey: 'email-'.bin2hex(random_bytes(8)));

$invite = $client->inviteCommunicationParticipant([
    'to' => '[email protected]',
    'room' => 'support-room-123',
    'video' => true,
]);

$workInbox = $client->listWorkInbox([
    'limit' => 25,
    'module' => 'bpm',
]);

$filteredInbox = $client->queryWorkInbox([
    'filters' => ['priority' => 'high'],
    'collectors' => ['bpm_steps', 'crm_tasks'],
]);

$flowBeaconHealth = $client->pingFlowBeacon();
$flowEvent = $client->ingestFlowBeaconEvent([
    'event' => 'workflow.step.completed',
    'workflow_id' => 'wf-123',
    'step_id' => 'approval',
], idempotencyKey: 'flow-event-'.bin2hex(random_bytes(8)));

$flowScribe = $client->ingestFlowScribe([
    'document_id' => 'doc-123',
    'workflow_id' => 'wf-123',
    'content' => 'Approval summary',
]);

$accordPreflight = $client->preflightAccordFlow([
    'product_id' => 'accordflow',
    'workflow' => ['type' => 'contract-review'],
]);

$queue = $client->listWorkflowQueue();
$accepted = $client->acceptWorkflowQueueItem('queue-item-id');
$run = $client->runWorkflowSteps('template-instantiation-id');

use Robo\ConnectorSdk\Exception\ApiException;

try {
    $client->listProviders();
} catch (ApiException $error) {
    printf("status=%d\n", $error->getStatusCode());
    var_dump($error->getResponse());
    var_dump($error->getRawResponseBody());
}