API:Api-installation

From InClickAdServer

(Redirected from Api-installation)

Contents

Getting Started - API Activation / Installation

NOTICE: We are in the process of rewriting the API documentation.

Through the use of the inClick API, developers can interact with inClick Ad Server objects and processes from a remote server. Since the inClick API is a web service API, you are able to integrate the inClick Ad Server into just about any other service regardless of environment or operating system. Examples include:

  • Integration into an accounting system
  • Integration into a CRM (Customer Relationship Manager) system such as [Salesforce] or [SugarCRM]
  • Connecting the inClick Ad Server into your own user interface
  • Extending functionality of the core system (adding your own features)
  • Creating your own software application on the inClick Ad Server foundation.

The inClick Ad Server API will allow you to add, modify, delete and retrieve data. Nearly all functionality found in the existing user interface has a corresponding API service. Some functionality includes:

  • Advertiser
    • Account Information, Creation and Modification
    • Advertisement Creation and Modification. Includes:
      • Geographical Targeting
      • Keyword Targeting
      • Region Targeting
      • Channel Selection
      • Custom Filter Options (3)
    • Reporting and Statistics
    • Conversion Tracking Creation
    • Account Funding
  • Publisher
    • Account Information, Creation and Modification
    • Reporting and Statistics
  • System Administrator
    • Reporting and Statistics
    • Account Lists
    • Campaign Lists and Status
    • Publisher Account Processing - Clear, Post, and Pay
    • Advertiser Payment Processing
    • User Authentication
  • API Exclusive - Advanced Advertisement Request and Delivery Processor
    • Separated tracking for impressions from a given request. For example, request ten ads from the system, then tell the system which three were delivered.
    • Allows for external filtering and targeting options outside the platform.

Quick Start Checklist

The below is an abbreviated checklist on getting the inClick Ad Server API up and running. Each point below is outlined in depth within this document.

  1. Obtain the Developers API Key for your inClick Cloud Server deployment. This will be provided to you in a support ticket.
  2. Download the [API Client] package.
  3. Download [PHPOlait], a boiler-plate set of PHP code that provides a transparent bridge to your inClick Cloud Server deployment.
  4. Setup API Client and PHPOlait files on server (see below).
  5. Create your first API Call

System Requirements and Dependencies

The following list oulines requirements and dependencies that must be in place to use the inClick Ad Server API:

  • API Key(Required) - If you do not have an API Key for your inClick Cloud Server, please open a support ticket to have one generated for you.
  • The API PHP Client Package - The API Client Package contains the PHP objects to connect to your inClick Cloud Server.
  • PHPOlait - PHPOlait is a boiler-plate set of PHP code that provides a transparent bridge between PHP methods using a [JSON (JavaScript Object Notation)] RPC layer.
  • An inClick Ad Server deployment.

Setting Up inClick Developers API

In this example setup, we will be using the DOCUMENT_ROOT location on a web server. You may change this as needed.

Step 1: Unpack inClick Developer API Package

Download and unpack / unzip the inClick Developer API package locally maintaining the directory / folder structure. Once unpacked, the directory structure should look like this:

../inclick_api/
../inclick_api/docs/
../inclick_api/export/
../inclick_api/test/
  • /docs/ - This contains the technical documentation outlined all of the available objects available within the API. This also outlines file dependencies for each object.
  • /export/ - This is the inClick Developers API client files. For ease of use and readability, files are contained in folders named around their function within the platform.
  • /test/ - These are the unit tests we perform on the API. These are provided for reference.

Step 2: Upload inClick Developer API Files to Server

Upload the contents of the /export/ folder to the document root folder on your web server. This should result in a single folder named /classes of which will contain 13 more folders.

Step 3: Unpack the PHPOlait Package

Download and unpack / unzip the PHPOlait package locally maintaining the directory / folder structure. Once unpacked, the directory structure should look like this:

../phpolait/

Step 4: Upload PHPOlait to Server

Upload the folder /phpolait/ to the document root folder on your web server.

Step 5: Create a Test API Query

The following is a simple API query that will obtain an accounts balance. This can serve as a basis for other Developer API queries.

  • Create a /globals directory, and a file globals.php
  • Within this file (globals.php), insert the following: Replace "your.inclickadserver.com" with the URL of your inClick Cloud Server, and "XXXXXXXXXXXXXXX" with your inClick Developer API Key that was issued to you.
    NOTICE: We suggest changing the $_SERVER['DOCUMENT_ROOT'] with the actual path since $_SERVER['DOCUMENT_ROOT'] may not be available from the command line, where your API request could be triggered by a cron job or event where this environment variable may not exist.
  • Create a file test.php in the root directory.
  • Within this file (test.php), insert the following:

Step 6: Test the Query

Visit test.php from your web browser. You should see something like this:

Account Balance for Account Number 1001: 10.00

If you receive an error, the code and error message will be provided.