Skip to main content

PHP SDK

The PHP SDK provides a comprehensive library for easily integrating with the Mambo API. This client library simplifies development by handling authentication, request formatting, and response parsing, allowing you to focus on your application logic. The SDK includes examples for most of the APIs as well as a compatibility check to verify if you can use it with your current setup.

To connect to the Mambo API, use one of the service classes provided in the services package. See the code samples below for implementation examples.

Installation

Requirements

  • PHP 7.4.0 or greater

Dependencies

Composer

After downloading the Mambo SDK, you can import it into your project by adding the following to your composer.json file and then using Composer's autoload:

composer.json

Manual installation

If you are not using Composer, after downloading the Mambo SDK you can initialise it manually:

PHP

Downloads

The Mambo SDK requires the following files to be installed manually:

Documentation

Client initialisation

To initialise the SDK, you'll need to set your credentials and, if using an on-premise installation, the API endpoint URL:

PHP

Query parameters

Use parameter objects to provide query parameters to endpoint methods:

PHP

Request options

Use the request options object to provide configuration on a per-request basis. This object can be used to provide idempotency keys or request specific timeouts:

PHP

Getting started

Here's a complete example showing how to initialise the client and make a basic API call:

PHP

Troubleshooting

Common issues

Connection timeouts

If you experience connection timeouts, you can increase the timeout settings when initialising the client:

PHP

Debugging

Enable debug mode to troubleshoot issues:

PHP