Skip to main content

Install

Prepare the example

Use PHP 8.1 or later with Composer’s autoloader. Set LEADPING_API_KEY and replace lead-id with a lead from that organization. Save the example as read-lead.php in the project root and run php read-lead.php. This example waits for one read to finish. In an application using promises, keep the SDK call within that application’s promise and error-handling flow.

Create the client

The client defaults to https://api.leadping.ai. Set LEADPING_API_KEY to an organization API key. $client->users()->me() requires a user access token; source keys are only for lead intake.

Call routes

The SDK does not store credentials. Use generated request-body classes when creating or updating records, confirm contracts in the API Reference, and follow the rate-limit guide. Catch request failures at the application boundary and avoid printing the exception’s full request or payload in a public response. Keep the destination check in the authentication provider when adapting the example: changing the request URI must not send your organization key to another host.