cra / marketo-api
Unofficial Marketo API PHP library.
Installs: 10 161
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 3
Open Issues: 0
pkg:composer/cra/marketo-api
Requires
- php: ^7.4 | ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- kint-php/kint: ^3.3
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.6
README
Unofficial Marketo API PHP library.
Installation
Composer
composer require cra/marketo-api
Manual download
Run composer install in the library directory and then require PATH_TO_LIBRARY/vendor/autoload.php in your project.
Usage
First, you need to initialise and authenticate client.
use Cra\MarketoApi\Client; $client = (new Client($config))->authenticate();
$config must have the following fields restBaseUrl, identityBaseUrl, clientId, and clientSecret.
See Examples section below for more information on the fields.
Then $client will be passed to API endpoint classes. E.g.:
use Cra\MarketoApi\Endpoint\Asset\Folder; $folderEndpoint = new Folder($client); $folder = $folderEndpoint->queryByName('My awesome folder'); $folders = $folderEndpoint->browse($folder->folderId());
Examples
To run examples from /examples directory put the following config.json file in the repository root:
{
"restBaseUrl": "REST BASE URL copied from Marketo dashboard including /rest",
"identityBaseUrl": "REST BASE URL copied from Marketo dashboard including /identity",
"clientId": "CLIENT ID from Marketo dashboard",
"clientSecret": "CLIENT SECRET from Marketo dashboard"
}