Inspired by https://github.com/davidgiga1993/AudiAPI This library provides access to the MyAudi api., (*1)
First we must configure the app.credentials are not stored anywhere,just used for receiving tokens. This is just one times use command.It will fall on a second run, unless a proper logout is made., (*2)
For auto tracking of journeys you will need an here api key get your here api:https://developer.here.com/, (*3)
use SapiStudio\MyAudi\Init; $configure = [ 'username' => 'user', 'password' => 'pass' 'HERE_API_KEY'=>'apivalue' ]; $myAudiHandler = Init::configure($configure);
Now we can make api calls Initiate the app, (*4)
use SapiStudio\MyAudi\Init; $myAudiHandler = Init::make();
Get car reported position, (*5)
$myAudiHandler->getPosition();
Get the car service plan, (*6)
$myAudiHandler->getServicePlan();
Get cost tracker entries, (*7)
$myAudiHandler->Entries()->loadCosts();
Get journal entries, (*8)
$myAudiHandler->Entries()->loadJourneys();
Check auxiliar clima status, (*9)
$myAudiHandler->auxiliarClimaStatus();
Get favourite audi partner, (*10)
$myAudiHandler->getFavoritePartner();
Get favourite audi partner, (*11)
$myAudiHandler->getFavoritePartner();
Setup a cron at minimum 5 minutes and run(this is the period that requests are cached.below this you are runing same request ), (*12)
$myAudiHandler->trackLocation();
when it sees a change in your position,automitcally will add a journey entry to MyAudi,and a HERE static map with the route, (*13)
Finally, for loggin out , just use, (*14)
Init::logout();
This will clear all your tokens. For making api calls again,you must start with the configure function, (*15)