-
Notifications
You must be signed in to change notification settings - Fork 15
Home
Welcome to the TikTok-LoginKit-PHP wiki!
The Connector Class includes all the methods to connect and interact with the TikTok Login Kit APIs for Web.
Below is a detailed view of available methods.
Gets the redirect URI for frontend usage
Generates the Redirect URI. This should be used in the frontend to redirect the user to TikTok to accept the API connection/permissions
@param array $permissions an array containing all the permissions you want to use. Your app must be approved for these permissions @return string the URL to which you need to redirect the user @throws Exception If the requested permissions are wrongly formatter
Calls the TikTok APIs to verify an authorisation code and retrieve the access token
First checks to validate the STATE variable. The GET of the state should be the same as the SESSION to prevent CSRF attacks Then calls the TikTok APIs to verify the received authorisation code and exchange it for an Access Token Set the Token and User ID within the class for further use
@param string $code contains the code received via the GET parameter @return string the URL to which you need to redirect the user @throws Exception If the STATE is not valid or if the API return error
Calls the TikTok APIs to retrieve all available user information for the logged user @return object the JSON containing the user data @throws Exception If the API returns an error
After Calling the TikTok API via the getUserInfo() method, builds and returns the User object of this class for easier handling
@return User the User object @throws Exception If the API returns an error
Basic HTTP wrapper to perform calls to the TikTok Api
@param string $url The URL to call @return string the response of the call or false
This class simply manages the structure of the User returned from the APIs into an object
Methods are simply to set and get the values provided by the APIs
- getOpenID()
- getUnionID()
- getAvatar()
- getAvatarLarger()
- getDisplayName()
This class simply manages the structure of the Video returned from the APIs into an object
Methods are simply to set and get the values provided by the APIs
- getID()
- getShareURL()
- getCreateTime()
- getCoverImageURL()
- getVideoDescription()
- getDuration()
- getHeight()
- getWidth()