(embedTokens)
- create - Create a new embed token
Create a new embed token for the referral link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
use Dub\Models\Operations;
$sdk = Dub\Dub::builder()
->setSecurity(
'DUB_API_KEY'
)
->build();
$request = new Operations\CreateEmbedTokenRequestBody(
linkId: '<id>',
);
$response = $sdk->embedTokens->create(
request: $request
);
if ($response->object !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CreateEmbedTokenRequestBody | ✔️ | The request object to use for the request. |
?Operations\CreateEmbedTokenResponse
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 | */* |