Topics
Support
Offer Add
Offer Add
Description
This function is intended to provide an offers list in XML format.
API function Information
| Info |
|---|
| API Function Name: offer_add |
| API Function Call: http://[your_system_domain_name]/api/offer_add/ |
POST Parameters
| Parameter | Option | Value Type | Example | Description |
|---|---|---|---|---|
| User_ID | required | string | 1 | User ID. |
| API_Key | required | string | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | API key. |
| name |
required | string | Name | Offer name. |
| exclusive |
optional | numeric | 1 | Exclusive name or not. |
| advertiser_id |
required |
numeric | 1 | Advertiser ID. |
| avail_type |
required |
numeric | 1 | Availability type. Рossible values |
| status_id |
required |
numeric | 1 | Status ID. Рossible values |
| type | required |
numeric | 1 | Types. Рossible values |
| lp_url | optional | numeric | 0 | Show landing page URL or not (0|1). |
| redirect_url |
required |
string | http://google.com | Redirect URL. |
| categories[] | required |
numeric | array(1, 2, 3) | List of categories. Рossible values |
| ed | optional |
numeric | 1 | Will offer have date end or not. |
| end_date | optional |
string | 12/02/2011 | If parameter ed = 2, this parameter will contain the end date |
| c_lifespan | optional | numeric | 60 | Cookie Lifespan. |
| opip | optional | numeric | 1 | Unique IPs. Рossible values |
| dcap_type | required | numeric | 1 | Is Daily Cap unlimited, or not. |
| dcap | required | numeric | 1 | If parameter dcap_type = 1 this parameter will contain some value. |
| tcap_type | required | numeric | 1 | If Total Cap unlimited, or not. |
| tcap | required | numeric | 1 | If parameter tcap_type = 1 this parameter will contain some value. |
| adcap_type | optional | numeric | 1 | IfAffiliates Daily Cap unlimited, or not.. |
| adcap | optional | numeric | 1 | If parameter adcap_type = 1 this parameter will contain some value. |
| atcap_type | optional | numeric | 1 | Affiliates Total Cap. |
| atcap | optional | numeric | 1 | If parameter atcap_type = 1 this parameter will contain some value. |
| pixel_type | optional | numeric | 1 | Pixel Type. Рossible values |
| payment_amount_2 | required | numeric | 0 | For offer_type = 1, 2, 3 Bounty ($). For offer_type = 4 Total Sale Share (%). |
| payment_amount_1_2 | required | numeric | 0 | For offer_type = 1, 2, 3 Premium Payout ($). For offer_type = 4 Premium Affiliate Share (%). |
| payment_amount_1_1 | required | numeric | 0 | For offer_type = 1, 2, 3 Standard Payout ($). For offer_type = 4 Standard Affiliate Share (%). |
| traffic_type | optional | numeric | 1 | Traffic Type. Рossible values |
| media_types[] | optional | numeric | 1 | Media Type Allowed. Рossible values |
| country | optional | numeric | 1 | If this parameter = 1 it will be used all countries, if parameter = 2 you can list it in countries[]. |
| countries[] | optional | array | array(1, 2, 3) | Countries list. Рossible values |
| notes | optional | string | Some notes | Notes. |
| image | optional | file | Logo image, but it required arttribute enctype=”multipart/form-data” in form tag. |
Request example
<?php // API Function URL $api_function_call = 'http://[your_system_domain_name]/api/offer_add/'; // POST parameters array $post_params = array( 'User_ID' => '0000000000', 'API_Key' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'name' => 'name', 'exclusive' => 1, 'advertiser_id' => 1, 'avail_type' => 1, 'status_id' => 1, 'type' => 1, 'lp_url' => 'http://google.com', 'redirect_url' => 'http://google.com', 'ed' => 1, 'end_date' => '12/02/2011', 'c_lifespan' => 60, 'opip' => 1, 'dcap_type' => 1, 'dcap' => 1, 'tcap_type' => 1, 'tcap' => 1, 'adcap_type' => 1, 'adcap' => 1, 'pixel_type' => 1, 'payment_amount_2' => 0, 'payment_amount_1_2 ' => 0, 'payment_amount_1_1' => 0, 'traffic_type ' => 1, 'country' => 1, 'notes' => 'Some notes', ); curl_setopt($ch, CURLOPT_URL, $api_function_call); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params); $aResult = curl_exec($ch); curl_close($ch); echo ''; var_dump( $aResult ); echo '';
?>
Response example
The offer has been successfully created