<?php require 'Trackvia/Api.php'; require 'Trackvia/Log.php'; use Trackvia\Api; use Trackvia\Log; define('CLIENT_ID', ''); define('CLIENT_SECRET', ''); define('USERNAME', ''); define('PASSWORD', ''); // Create a TrackviaApi object with your clientId and secret. // The client_id and secret are only used when you need to request a new access token. $tv = new Api(array('client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET, 'username' => USERNAME, 'password' => PASSWORD)); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Trackvia API v2 Example</title> </head> <body> <h1>Trackvia API v2 Example</h1> <?php if (CLIENT_ID == '' || CLIENT_SECRET == '' || USERNAME == '' || PASSWORD == '') { ?> <h2>Quick Start</h2> <p> Your example code requires your client_id, client_secret, username and password. You can get these at the <a href="https://secure.trackvia.com/accountsettings/">Trackvia account settings page</a>. Your username and password are the username and password you use to login to TrackVia.
* @copyright Copyright (c) 2013, TrackVia Inc. */ require 'Trackvia/Api.php'; require 'Trackvia/Log.php'; use Trackvia\Api; use Trackvia\Log; define('CLIENT_ID', ''); define('CLIENT_SECRET', ''); define('USERNAME', ''); define('PASSWORD', ''); if (CLIENT_ID == '' || CLIENT_SECRET == '' || USERNAME == '' || PASSWORD == '') { die("Please setup your access credentials"); } // Create a TrackviaApi object with your clientId and secret. // The client_id and secret are only used when you need to request a new access token. $tv = new Api(array('client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET)); // load the saved token for this user function load_saved_token_data() { //=========== // code to load the token from your database //=========== // return array( // 'access_token' => 'user_access_token', // 'refresh_token' => 'user_refresh_token', // 'expires_at' => 'expires_timestamp' // ); } $savedToken = load_saved_token_data(); // If there is saved token data to use, set it now if (!empty($savedToken) && isset($savedToken['access_token'])) {