API Example Account Creation

From InClickAdServer

Creating A New Advertiser

This API Service Request will create an advertiser account. When compared to the factory user interface, this is comparable to the last step of the New Advertiser work flow.

The Code Example

Breaking Down the Code

This require references the local inClick Ad Server deployment configuration files allowing your code to utilize the pre-packaged API Objects as well as the bundled PHPOlait services.


These requires (includes) contain the API Objects and Classes needed for this API Service Request.


The $base_url is the URL to your inClick Ad Server deployment, the ad server root URL. For local host API usage, the constant of INCLICK_WEB_URL is defined in the globals.php file referenced earlier. Remote deployments, deployments where the ad server and API Request Location are not on the same server, would change this to the fully qualified URL to the ad server root directory.

The $service_key is one of the the api_service_keys values you created for your ad server. (more information)


This is where we create an instance of the classes needed to create a new advertiser account.


This is where we define the values of the account we will be creating.

NOTE: You will notice that the inClick Ad Server standard work flow for new advertisers actually comprises of three actions - Creating a Campaign, Creating an Account, and Funding the Account. While the work flow looks to create the campaign first, the actual interaction with the system creates the account first, then creates the campaign of which is stored as a session until the account is created. The payment processing is performed after the account and first campaign is created.

This line processes the API Server Request using the data as defined above.


This section of code is provided to give you a visual confirmation of what occurred, or to give you a visual confirmation of the error that occurred.