A utility API endpoint to communicate with AppNexus
This service simplify AppNexus communication with API Key(s). It also simplify downloading of generic reports.
- Proxy (GET, POST, PUT, DELETE) with cached authentication
- Generic Advertiser reports download
- Generic Publisher reports download
- Handle X-Rate-Limit header
git clone https://github.com/niiknow/anx-api-proxy
cd anx-api-proxy
composer install
npm install
- set your
.env
by copying from.env.example
php artisan key:generate
- Run/Serve the Site
- laravel valet:
valet link anx-api-proxy
- homestead:
homestead up
- laravel valet:
- after
valet link anx-api-proxy
, visit anx-api-proxy.test/ or npm run watch - visit anx-api-proxy.test/api/documentation for api docs
- Package the project, this will create
dist.tar
file
composer app:package
- Create the necessary database and user on your server. Take note of the database credentials; we will use it on
step 7
below. - Create sub-domain and its folder, example:
anx-api-proxy.niiknow.org
with folder as/home/{user}/anx-api-proxy.niiknow.org
- Update your hosting folder as
/home/{user}/anx-api-proxy.niiknow.org/public
- Upload the resulting file in
dist.tar
to your sub-domain folder/home/user/anx-api-proxy.niiknow.org/
(note not your public folder) and extract it to the current director. - Visit
http://anx-api-proxy.niiknow.org/init.php
to initialize the project. This will update required permissions forstorage/framework/
,storage/logs/
, andbootstrap/cache/
and create the.env
file from.env.example
file. If it doesn't automatically redirect you to/install
, then visit/install
and complete the setup to finalize your.env
file with the necessary database and other configuration. Take note of theAPI_KEYS
that was generated or provide your own key to be use withX-API-Key
header. Take note ofREPORT_KEY
for report authentication. - Follow the installation wizard. Fill in the necessary
DB_DATABASE
,DB_USERNAME
, andDB_PASSWORD
that you've taken note earlier. Make sure you fill in everything such as (APP_URL
,APP_DOMAIN
,APP_DEBUG
, etc...) and not just the database values. Then clicksave .env
, you want to make sure you save your changes. Then clicksave and install
, this will perform database initial migration for you. Then click theclick here to exit
button to complete the installation. - Congratulation, you're all set! You can always update your
.env
file now if you need to make any additional changes.
TO UPDATE/UPGRADE
- run
composer app:package
again - upload and extract like you've done in installation above
- public/init.php - execute this by visiting example.app/init.php in the browser
- then visit your site
/update
instead of/install
Configuration/env Note
API_KEYS
=set this to secure your api withX-API-Key
headerREPORT_KEY
=set this to authenticate with report download
If you get redirect to /install
and the page is blank. Check your cpanel error log for details. Make sure you pick the correct php version. Some older server default to php7+
instead of php8+
.
If you have an issue and need to restart installation, simply delete the file storage/installed
and visit /install
again.
At the moment, we really have no reason for having a database since this is only use as a Proxy.