Developers
Our API allows you to retrieve informations from our website via GET request and supports the following query parameters:
Name | Meaning | Values | Description | Required |
---|---|---|---|---|
type | Query type. | get_channel_info using fetch you can get user data | This parameter specify the type of the query. |
How to start?
- Create a development application.
- Once you have created the app, you'll get APP_ID, and APP_SECRET.
- To start the Oauth process, use the link https://playtag.app/oauth?app_id={YOUR_APP_ID}
- Once the end user clicks this link, he/she will be redirected to the authorization page.
- Once the end user authorization the app, he/she will be redirected to your domain name with a GET parameter "code", example: http://yourdomain/?code=XXX
- In your code, to retrieve the authorized user info, you need to generate an access code, please use the code below:
-
PHP:
<?php $app_id = 'YOUR_APP_ID'; // your application app id $app_secret = 'YOUR_APP_SECRET'; your application app secret $code = $_GET['code']; // the GET parameter you got in the callback: http://yourdomain/?code=XXX $get = file_get_contents("https://playtag.app/authorize?app_id={$app_id}&app_secret={$app_secret}&code={$code}"); $json = json_decode($get, true); if (!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token } ?>
-
PHP:
- Once you got the access code, simple call the data you would like to retrieve, Example:
- PHP:
if (!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token $get = file_get_contents("https://playtag.app/api/v1.0?type=get_channel_info?access_token={$access_token}"); }
-
Respond:
Jsonoutput { "api_status": "200", "api_version": "1.0", "data":{ "id": , "username": "", "email": "", "first_name": "", "last_name": "", "gender": "", } }
- PHP: