(track)
Track a lead for a short link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
use Dub\Models\Operations;
$security = 'DUB_API_KEY';
$sdk = Dub\Dub::builder()->setSecurity($security)->build();
$request = new Operations\TrackLeadRequestBody(
clickId: '<id>',
eventName: 'Sign up',
);
$response = $sdk->track->lead(
request: $request
);
if ($response->object !== null) {
// handle response
}
?Operations\TrackLeadResponse
Error Type |
Status Code |
Content Type |
Errors\BadRequest |
400 |
application/json |
Errors\Unauthorized |
401 |
application/json |
Errors\Forbidden |
403 |
application/json |
Errors\NotFound |
404 |
application/json |
Errors\Conflict |
409 |
application/json |
Errors\InviteExpired |
410 |
application/json |
Errors\UnprocessableEntity |
422 |
application/json |
Errors\RateLimitExceeded |
429 |
application/json |
Errors\InternalServerError |
500 |
application/json |
Errors\SDKException |
4XX, 5XX |
*/* |
Track a sale for a short link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
use Dub\Models\Operations;
$security = 'DUB_API_KEY';
$sdk = Dub\Dub::builder()->setSecurity($security)->build();
$request = new Operations\TrackSaleRequestBody(
amount: 996500,
paymentProcessor: Operations\PaymentProcessor::Paddle,
eventName: 'Purchase',
);
$response = $sdk->track->sale(
request: $request
);
if ($response->object !== null) {
// handle response
}
?Operations\TrackSaleResponse
Error Type |
Status Code |
Content Type |
Errors\BadRequest |
400 |
application/json |
Errors\Unauthorized |
401 |
application/json |
Errors\Forbidden |
403 |
application/json |
Errors\NotFound |
404 |
application/json |
Errors\Conflict |
409 |
application/json |
Errors\InviteExpired |
410 |
application/json |
Errors\UnprocessableEntity |
422 |
application/json |
Errors\RateLimitExceeded |
429 |
application/json |
Errors\InternalServerError |
500 |
application/json |
Errors\SDKException |
4XX, 5XX |
*/* |