Access Tokens
Access Tokens allow a developer to authenticate SDK requests on behalf of a specific Catalytic user. Each Access Token must be approved by the user on whose behalf the Access Token grants access. That approval can be done either explicitly by logging in to the Catalytic Web App and approving a specific token request, or by supplying their email and password when creating a new token.
For more details on creating an AccessToken
or how Access Tokens are used to authenticate in the SDK, please see the preceding Authentication section.
The Access Tokens
client provides the following methods:
Method | Description |
---|---|
get | Gets a specific Access Token by ID |
find | Fetch all of your Access Tokens |
create | Create a new Access Token with your email and password Not supported for teams with SSO enabled |
createWithWebApprovalFlow | Create a new Access Token to be approved via the Account page in the Catalytic Web App Supported for all teams with or without SSO |
waitForApproval | Waits for Access Tokens created with CreateWithWebApprovalFlow to be approved in the Catalytic Web App |
getApprovalUrl | Gets the URL that the user should be directed to to approve the User Access Token created with createWithWebApprovalFlow |
revoke | Revokes a User Access Token so it can no longer be used |
Quickstart Example
<?php
/*
* This example demonstrates creating a new Access Token using your
* email and password
*/
require_once(__DIR__ . '/vendor/autoload.php');
use Catalytic\SDK\CatalyticClient;
$catalytic = new CatalyticClient();
$accessToken = $catalytic->accessTokens()->create(
"your-team.pushbot.com",
"your-email",
"your-password");
Updated almost 4 years ago