What is Advertise API?

Advertise API is very simple and flexible mechanism which allows users to acquire various information about advertisements directly from Advertise.com.ng and then display it somewhere in the Internet (personal web-pages, blogs, company websites and so forth).

How to use Advertise API?

There are several ways to obtain and display information you are interested in:

  • usage of library of predefined widgets;
  • usage of HTTP requests and retrieval of information in various formats (JSON, XML or RSS);

Usage of Advertise API via library of predefined widgets

Ordinary users who are not familiar with web-technologies can in a very simple manner gain benefits from using predefined set of widgets which were specially developed for quick setup and easy usage.

We host a number of sample widgets. Such widgets may be easily customized and used at your website(s).

Just try_it! It is very easy (basically it only takes several minutes to select, customize and setup desired widget).

Usage of Advertise API via HTTP requests

If you are an advanced WEB user (or developer) then you can obtain required information by means of Advertise API calls.

In order to continue deeper Advertise API consideration it is required to get acquainted with a couple of terms.

Advertise API Call - HTTP request of special format which is charge of information retrieval from Advertise.com.ng. Actually typical Advertise API Call is an URL like bellows:

http://www.advertise.com.ng/api/SPACE/NAME.FORMAT[?PARAM_1=VALUE_1[&PARAM_N=VALUE_N]]

where:

  • SPACE - Advertise API method space;
  • NAME - Advertise API method name;
  • FORMAT - Advertise API response format;
  • PARAMN=VALUEN - additional Advertise API request parameters.

Advertise API format - format in which data is sent upon request. Currently there are 3 formats supported:

  • json (JavaScript Object Notation format)
  • xml (eXensible Markup Language format)
  • rss (Really Simple Syndication format)

Response formats

There are samples of responses in different formats below.

JSON

With JSON format any method can accept an additional request parameter callback - a JavaScript callback function.

http://www.advertise.com.ng/api/ad/get.json?callback=displayAd&iad=218

displayAd({
   "ad":{
      "id":218,
      "title":"MINI WASHING MACHINE",
      "name":"MINI WASHING MACHINE",
      "text":"MINI WASHING MACHINE (2.5 WASHING CAPACITY)\n\n- Very low power consumption (powered with smallest generator)\n- 2.5kg Washing Capacity\n- Washes jeans, bed sheets, shirts, etc.\n- Portable\n- Japanese origin\n- No plumbing work needed\n- Free Delivery (within Lagos only)",
      "publisher":"3A & FAM VENTURES",
      "category":"HOME & HOUSEHOLD\/Laundry & Dishwashers",
      "categoryId":79,
      "region":"Lagos",
      "regionId":25,
      "city":"Lagos",
      "cityId":33910,
      "person":"j",
      "term":"2 months",
      "type":"For Sale",
      "price":16000,
      "actual":"Y",
      "youtubeVideo":null,
      "pdf":null,
      "published":"Mon, 30 Jan 2012 13:12:02 +0100",
      "publishedUnixtime":1327925522,
      "expired":"Sun, 01 Apr 2012 14:13:27 +0200",
      "expired_unixtime":1333282407,
      "expiredUnixtime":1333282407,
      "URL":"http:\/\/lagos-lagos.advertise.com.ng\/mini-washing-machine-218.html",
      "url":"http:\/\/lagos-lagos.advertise.com.ng\/mini-washing-machine-218.html",
      "images":[
         {
            "id":168,
            "url":"http:\/\/www.advertise.com.ng\/images\/00001\/0\/mini-washing-machine.jpg",
            "thumbUrl":"http:\/\/www.advertise.com.ng\/images\/00001\/1\/mini-washing-machine.jpg",
            "imageURL":"http:\/\/www.advertise.com.ng\/images\/00001\/0\/mini-washing-machine.jpg",
            "thumbnailURL":"http:\/\/www.advertise.com.ng\/images\/00001\/1\/mini-washing-machine.jpg",
            "width":122,
            "height":160
         }
      ]
   }
})

There is a very simple example of callback function displayAd available. Please, check it (ad.js) if you are intrested in more detailed examples of usage and how to render simple widget using Advertise API.

XML

http://www.advertise.com.ng/api/ads/get.xml?category=vehicles&count=1

<?xml version="1.0" encoding="UTF-8"?>
<ads>
    <item>
        <ad>
        <id>3337</id>
        <title>
            Cheapest and most effective Car tracking device ever.
        </title>
        <name>
            Cheapest and most effective Car tracking device ever.
        </name>
        <text>
            king: White Blank Package Model NO.: TK668 Unit Price: Negotiable Shipment Terms: FOB Payment Terms: T/T,Western Union,Paypal Minimum Order: 50 Pieces Price Valid Time: From Feb 16,2012 To Feb 16,2013 Trademark: Topten Origin: Guangzhou, China Type: Car/Motorcycle Alarm Usage: Auto Export Markets: North America, South America, Eastern Europe, Southeast Asia, Africa, Oceania, Mid East, Eastern Asia, Western Europe
        </text>
        <publisher>Grace Dikio Opolo</publisher>
        <category>VEHICLES/Auto Parts & Accessories</category>
        <categoryId>10</categoryId>
        <region>Rivers</region>
        <regionId>33</regionId>
        <city>Port Harcourt</city>
        <cityId>50492</cityId>
        <person>p</person>
        <term>24 months</term>
        <type>For Sale</type>
        <price>18000</price>
        <actual>Y</actual>
        <youtubeVideo/>
        <pdf/>
        <published>Thu, 23 Feb 2012 18:04:22 +0100</published>
        <publishedUnixtime>1330016662</publishedUnixtime>
        <expired>Sat, 22 Feb 2014 18:06:51 +0100</expired>
        <expired_unixtime>1393088811</expired_unixtime>
        <expiredUnixtime>1393088811</expiredUnixtime>
        <URL>
            http://port-harcourt-port-harcourt.advertise.com.ng/cheapest-and-most-effective-car-tracking-device-ever-3337.html
        </URL>
        <url>
            http://port-harcourt-port-harcourt.advertise.com.ng/cheapest-and-most-effective-car-tracking-device-ever-3337.html
        </url>
        <phone>08029161914</phone>
            <images>
                <item>
                    <id>2048</id>
                    <url>
                        http://www.advertise.com.ng/images/00003/0/cheapest-and-most-effective-car-tracking-device-ever.jpg
                    </url>
                    <thumbUrl>
                        http://www.advertise.com.ng/images/00003/1/cheapest-and-most-effective-car-tracking-device-ever.jpg
                    </thumbUrl>
                    <imageURL>
                        http://www.advertise.com.ng/images/00003/0/cheapest-and-most-effective-car-tracking-device-ever.jpg
                    </imageURL>
                    <thumbnailURL>
                        http://www.advertise.com.ng/images/00003/1/cheapest-and-most-effective-car-tracking-device-ever.jpg
                    </thumbnailURL>
                    <width>160</width>
                    <height>160</height>
                </item>
            </images>
        </ad>
    </item>
</ads>
RSS

http://www.advertise.com.ng/api/ads/get.rss?category=vehicles&count=1

<rss version="2.0">
    <channel>
        <title>GG RSS</title>
        <description>GG RSS</description>
        <link>
            http://www.advertise.com.ng/api/ads/get.rss?category=vehicles&count=1
        </link>
        <copyright>InnovateIt.com</copyright>
        <docs>http://cyber.law.harvard.edu/rss/rss.html</docs>
        <generator>GAPI</generator>
        <language>sv</language>
        <lastBuildDate>Thu, 23 Feb 2012 17:10:29 GMT</lastBuildDate>
        <pubDate>Thu, 23 Feb 2012 17:10:29 GMT</pubDate>
        <ttl>15</ttl>
        <item>
            <title>
                Cheapest and most effective Car tracking device ever.
            </title>
            <description>
                king: White Blank Package Model NO.: TK668 Unit Price: Negotiable Shipment Terms: FOB Payment Terms: T/T,Western Union,Paypal Minimum Order: 50 Pieces Price Valid Time: From Feb 16,2012 To Feb 16,2013 Trademark: Topten Origin: Guangzhou, China Type: Car/Motorcycle Alarm Usage: Auto Export Markets: North America, South America, Eastern Europe, Southeast Asia, Africa, Oceania, Mid East, Eastern Asia, Western Europe
            </description>
            <link>
                http://port-harcourt-port-harcourt.advertise.com.ng/cheapest-and-most-effective-car-tracking-device-ever-3337.html
            </link>
            <author>Grace Dikio Opolo</author>
            <guid>
                http://port-harcourt-port-harcourt.advertise.com.ng/cheapest-and-most-effective-car-tracking-device-ever-3337.html
            </guid>
            <pubDate>Thu, 23 Feb 2012 18:10:29 +0100</pubDate>
        </item>
    </channel>
</rss>

Advertise API errors handling

Whenever errors are occured Advertise API provides you with meaningful information regarding what actually happen so you can deal with it according to your policy of handling errors. Errors are returned exactly in the same format the request was sent.

Below listed example requests that contain errors. Bad parameters are underlined.

JSON

http://www.advertise.com.ng/api/ad/get.json?callback=displayAd&adId=XYZ

displayAd({"error":{"code":400,"text":"invalid parameter: iad or adId"}})
XML

http://www.advertise.com.ng/api/ads/get.xml?category=nonexistent&count=1

<?xml version="1.0" encoding="UTF-8"?>
  <error>
    <code>400</code>
    <text>invalid parameter: category or categoryId</text>
  </error>

Authorization

For services that require authorization OAuth 1.0a must be used.

Request token URL

http://www.advertise.com.ng/oauth/request_token

Authorize URL

http://www.advertise.com.ng/oauth/authorize

Access token URL

http://www.advertise.com.ng/oauth/access_token

Consumer key and consumer secret

Consumer key and consumer secret can be obtained by creating a new application or you can list already created applications.

Signing requests

Requests must be signed with HMAC-SHA1 signature method.

API Calls

List categories

http://www.advertise.com.ng/api/categories/list

Returns list of categories of one level (without children).

Authentication

Not required.

Arguments
  • parentCategoryId or parentCategory (Optional) ID or name of parent category. If specified, then list of child categories will be returned.
  • withChildren (Optional) 1 to return categories with its children, 0 to not. Defaults to 0.
Examples

http://www.advertise.com.ng/api/categories/list.json?parentCategory=VEHICLES

{
   "categories":[
      {
         "id":5,
         "name":"Cars",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-cars\/"
      },
      {
         "id":10,
         "name":"Auto Parts & Accessories",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-auto-parts-_-accessories\/"
      },
      {
         "id":14,
         "name":"Boats",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-boats\/"
      },
      {
         "id":15,
         "name":"Boat Parts & Accessories",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-boat-parts-_-accessories\/"
      },
      {
         "id":19,
         "name":"Motorcycles",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-motorcycles\/"
      },
      {
         "id":20,
         "name":"Motorcycle Parts & Accessories",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-motorcycle-parts-_-accessories\/"
      },
      {
         "id":18,
         "name":"Mopeds",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-mopeds\/"
      },
      {
         "id":21,
         "name":"Trucks",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-trucks\/"
      },
      {
         "id":17,
         "name":"Caravans & Motorhomes",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-caravans-_-motorhomes\/"
      },
      {
         "id":22,
         "name":"Forestry & Agricultural Machinery",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-forestry-_-agricultural-machinery\/"
      },
      {
         "id":16,
         "name":"Bicycles",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-bicycles\/"
      },
      {
         "id":66,
         "name":"Other",
         "url":"http:\/\/www.advertise.com.ng\/vehicles-other\/"
      }
   ]
}

http://www.advertise.com.ng/api/categories/list.json?withChildren=1

{
   "categories":[
      {
         "id":36,
         "name":"PROPERTIES",
         "url":"http:\/\/www.advertise.com.ng\/properties\/",
         "children":[
            {
               "id":101,
               "name":"Homes & Townhouses",
               "url":"http:\/\/www.advertise.com.ng\/properties-homes-_-townhouses\/"
            },
            {
               "id":103,
               "name":"Leaseholds",
               "url":"http:\/\/www.advertise.com.ng\/properties-leaseholds\/"
            }
         ]
      },
      {
         "id":2,
         "name":"VEHICLES",
         "url":"http:\/\/www.advertise.com.ng\/vehicles\/",
         "children":[
            {
               "id":5,
               "name":"Cars",
               "url":"http:\/\/www.advertise.com.ng\/vehicles-cars\/"
            },
            {
               "id":10,
               "name":"Auto Parts & Accessories",
               "url":"http:\/\/www.advertise.com.ng\/vehicles-auto-parts-_-accessories\/"
            }
         ]
      }
   ]
}

List regions

http://www.advertise.com.ng/api/regions/list

Returns list of regions.

Authentication

Not required.

Arguments

None.

Examples

http://www.advertise.com.ng/api/regions/list.json

{
   "regions":[
      {
         "id":1,
         "name":"Abia",
         "url":"http:\/\/abia.advertise.com.ng\/"
      },
      {
         "id":2,
         "name":"Abuja (FCT)",
         "url":"http:\/\/abuja-fct.advertise.com.ng\/"
      }
   ]
}

List cities

http://www.advertise.com.ng/api/cities/list

Returns list of cities.

Authentication

Not required.

Arguments
  • region or regionId (Optional) ID or name of region.

If specified, then list of cities from that region will be returned. Otherwise list of all cities will be returned.

Examples

http://www.advertise.com.ng/api/cities/list.json?region=Norrbotten

{
    "cities": [
        {
            "id": 110,
            "name": "Kiruna",
            "url": "http://www.advertise.com.ng/norrbotten-kiruna/"
        },
        {
            "id": 111,
            "name": "Pajala",
            "url": "http://www.advertise.com.ng/norrbotten-pajala/"
        },
        {
            "id": 112,
            "name": "Jokkmokk",
            "url": "http://www.advertise.com.ng/norrbotten-jokkmokk/"
        }
    ]
}

Post ad

http://www.advertise.com.ng/api/ads/new

Posts a new ad.

Authentication

Required OAuth.

HTTP method

POST.

Arguments
  • cityId or city (Required) Name of city where to post ad. City name must be in format: Region/City, example: Norrbotten/Pajala.
  • categoryId or category (Required) ID or name of category where to post ad. Category name must be in format: Category/Subcategory, example: FORDON/Bilar.
  • type (Optional) Ad type. One of: sell, buy, rent, wish-to-rent, swap, giveaway, job-available, seeking-job, lost, found. Defaults to sell.
  • term (Required) Term to show ad. Specified in months. E.g. 1, 2, 3, 6, 12.
  • title (Required) Ad title.
  • description (Required) Ad description.
  • price (Optional)
  • advertiserType (Optional) One of: person, company. Defaults to person.
  • advertiserName (Optional) Name of advertiser. By default your profile name will be used.
  • phone (Required) Phone of advertiser.
  • showPhone (Optional) 1 to show phone number on the ad page, 0 to not. Defaults to 0.
  • imageDatas[] (Optional) Contents of ad images. Every image file must be read, encoded with Base64 and at last URL-encoded.
  • imageUrls[] (Optional) URLs of ad images.
  • youtube (Optional) URL of YouTube Video or EMBED HTML code of YouTube video.
  • pdfData (Optional) Content of PDF file. File must be read, encoded with Base64 and at last URL-encoded.
  • pdfUrl (Optional) URL of PDF file.
  • link (Optional)
  • linkTitle (Optional)
  • eCommerce (Optional) 1 to display "Buy now" button (links to your e-Commerce site or add to shopping cart on Advertise.com.ng) on the ad page, 0 to not. Defaults to 0
Examples

Example result:

{
    "ad": {
        "id": "86476",
        "name": "Utebord + 4 stolar",
        "url": "http://www.advertise.com.ng/uppsala-uppsala/hem-_-hush%C3%A5ll-tr%C3%A4dg%C3%A5rd/utebord-4-stolar.html"
    }
}

Get Ad

http://www.advertise.com.ng/api/ad/get

Get ad info.

Authentication

Not required.

Arguments
  • adId (Required) Ad ID.
Examples
http://www.advertise.com.ng/api/ad/get.json?adId=21866
{
    "ad":{
        "id": 21866,
        "name": "Audi TT",
        "text": "Audi TT",
        "publisher": "Daniel",
        "category": "FORDON\/Bilar",
        "categoryId": 12,
        "region": "V\u00e4stra G\u00f6taland",
        "regionId": 34,
        "city": "G\u00f6teborg",
        "cityId": 45,
        "person": "p",
        "term": "1 m\u00e5nad",
        "type": "S\u00e4ljes",
        "price": 85000,
        "actual": "Y",
        "published": "Tue, 07 Jul 2009 08:20:41 +0200",
        "publishedUnixtime": 1246954841,
        "expired": "Fri, 07 Aug 2009 10:20:41 +0200",
        "expiredUnixtime": 1249633241,
        "url":" http:\/\/www.advertise.com.ng\/v%C3%A4stra-g%C3%B6taland-g%C3%B6teborg\/fordon-bilar\/audi-tt.html",
        "youtubeVideo":{
            "code":"Pnc4AoLoQn0",
            "url":"http:\/\/www.youtube.com\/watch?v=Pnc4AoLoQn0",
            "thumbnailURL":"http:\/\/www.advertise.com.ng\/yi\/Pnc4AoLoQn0.jpg"
        },
        pdf":{
            "url":"http:\/\/www.advertise.com.ng\/uploads\/00001\/0\/audi-tt.pdf ",
            "thumbnailURL":"http:\/\/s3.advertise.com.ng\/img\/pdf.png"
        },  
        "images":[
            {
                "id": 12,
                "url": "http:\/\/www.advertise.com.ng\/images\/00001\/0\/audi-tt.jpg",
                "thumbUrl": "http:\/\/www.advertise.com.ng\/images\/00001\/1\/audi-tt.jpg",
                "width": 640,
                "height": 425
            }
        ]
    }
}

List ads

http://www.advertise.com.ng/api/ads/get

List ads.

Authentication

Not required. But if OAuth used then will be listed only ads of current user.

Arguments
  • regionId or region (Optional) ID or name of region. If specified, then list of cities from that region will be returned. Otherwise list of all cities will be returned.
  • cityId or city (Optional) Name of city where to post ad. City name must be in format: Region/City, example: Norrbotten/Pajala.
  • categoryId or category (Optional) ID or name of category where to post ad. Category name must be in format: Category/Subcategory, example: FORDON/Bilar.
  • userId (Optional) ID of ad owner (advertiser).
  • tag (Optional) Search keywords
  • rand (Optional) Y to get random list of ads, N otherwise.
  • page (Optional) Starts from 1. Defaults to 1.
  • count (Optional) Count of ads per page. Defaults to 20.
Examples

http://www.advertise.com.ng/api/ads/get.json?count=2

{ "ads" : [
      { "ad" : {
            "actual" : "Y",
            "category" : "FORDON/Mopeder",
            "categoryId" : 18,
            "city" : "Boden",
            "cityId" : 47,
            "expired" : "Fri, 17 Jun 2011 11:52:17 +0200",
            "expiredUnixtime" : 1308304337,
            "id" : 80444,
            "name" : "API_test_2",
            "person" : "p",
            "phone" : "9876",
            "price" : 25,
            "published": "Tue, 07 Jul 2009 08:20:41 +0200",
            "publishedUnixtime": 1246954841,
            "publisher" : "Ronald McDonald",
            "region" : "Norrbotten",
            "regionId" : 1,
            "term" : "6 månader",
            "text" : "update_Desc_1",
            "type" : "Säljes",
            "url" : "http://www.advertise.com.ng/norrbotten-boden/fordon-mopeder/api-test-2.html"
          } },
      { "ad" : {
            "actual" : "Y",
            "category" : "FORDON/Mopeder",
            "categoryId" : 18,
            "city" : "Boden",
            "cityId" : 47,
            "expired" : "Tue, 07 Dec 2010 12:30:16 +0100",
            "expiredUnixtime" : 1291721416,
            "id" : 80442,
            "name" : "API_test_1",
            "person" : "p",
            "price" : 25,
            "published": "Tue, 07 Jul 2009 08:20:41 +0200",
            "publishedUnixtime": 1246954841,
            "publisher" : "John_Smith",
            "region" : "Norrbotten",
            "regionId" : 1,
            "term" : "6 månader",
            "text" : "API_test_1_desc",
            "type" : "Säljes",
            "url" : "http://www.advertise.com.ng/norrbotten-boden/fordon-mopeder/api-test-1_0002.html"
          } }
    ] }

Update ad

http://www.advertise.com.ng/api/ads/update

Update existing ad.

Authentication

Required OAuth.

Arguments
  • adId (Required) Ad ID.
  • description (Optional) Ad description.
  • price (Optional)
  • advertiserName (Optional) Name of advertiser. By default your profile name will be used.
  • phone (Optional) Phone of advertiser.
  • showPhone (Optional) 1 to show phone number on the ad page, 0 to not. Defaults to 0.
  • youtube (Optional) URL of YouTube Video or EMBED HTML code of YouTube video.
  • pdfData (Optional) Content of PDF file. File must be read, encoded with Base64 and at last URL-encoded.
  • pdfUrl (Optional) URL of PDF file.
  • link (Optional)
  • linkTitle (Optional)
  • eCommerce (Optional) 1 to display "Buy now" button (links to your e-Commerce site or add to shopping cart on Advertise.com.ng) on the ad page, 0 to not. Defaults to 0
Examples

http://www.advertise.com.ng/api/ads/update.json?adId=86476&price=400&showPhone=1

Returns an empty success response if it completes without error.

Update ad status

http://www.advertise.com.ng/api/ads/updateStatus

Set new status for ad.

Authentication

Required OAuth.

Arguments
  • adId (Required) Ad ID.
  • active (Required) 1 to activate ad, 0 to deactivate.
Examples

http://www.advertise.com.ng/api/ads/updateStatus.json?adId=86476&active=1

Returns an empty success response if it completes without error.

Prolong ad

http://www.advertise.com.ng/api/ads/prolong

Prolong existing ad.

Authentication

Required OAuth.

Arguments
  • adId (Required) Ad ID.
  • term (Required) Term to show ad. Specified in months. E.g. 1, 2, 3, 6, 12.
Examples

http://www.advertise.com.ng/api/ads/prolong.json?adId=86476&term=6

Returns an empty success response if it completes without error.

Add images to ad

http://www.advertise.com.ng/api/ads.images/add

Add new images to existing ad.

Authentication

Required OAuth.

HTTP method

POST.

Arguments
  • adId (Required) Ad ID.
  • imageDatas[] (Optional) Contents of ad images. Every image file must be read, encoded with Base64 and at last URL-encoded.
  • imageUrls[] (Optional) URLs of ad images.
Examples

http://www.advertise.com.ng/api/ads.images/add.json?adId=86476&images[]={encodedBinaryData1}&images[]={encodedBinaryData2}

Returns URLs of added images.

{
    "images": [
        {
            "id": 10,
            "url": "http://www.advertise.com.ng/images/00001/0/audi-tt-0001.jpg",
            "thumbUrl": "http://www.advertise.com.ng/images/00001/1/audi-tt-0001.jpg",
            "width": 600,
            "height": 400
        },
        {
            "id": 11,
            "url": "http://www.advertise.com.ng/images/00001/0/audi-tt-0002.jpg",
            "thumbUrl": "http://www.advertise.com.ng/images/00001/1/audi-tt-0002.jpg",
            "width": 500,
            "height": 250
        }
    ]
}

Get ad image

http://www.advertise.com.ng/api/ads.images/get

Get image info.

Authentication

Required OAuth.

Arguments

imageId (Optional) ID of image uploaded by you.

Examples

http://www.advertise.com.ng/api/ads.images/get.json?imageId=10

{
    "image": {
        "id": 10,
        "url": "http://www.advertise.com.ng/images/00001/0/audi-tt-0001.jpg",
        "thumbUrl": "http://www.advertise.com.ng/images/00001/1/audi-tt-0001.jpg",
        "width": 600,
        "height": 400
    }
}

List ad images

http://www.advertise.com.ng/api/ads.images/list

Returns list of ad images.

Authentication

Required OAuth.

Arguments
  • adId (Required) Ad ID.
  • page (Optional) Starts from 1. Defaults to 1.
  • count (Optional) Count of ads per page. Defaults to 20.
Examples

http://www.advertise.com.ng/api/ads.images/list.json?adId=86476

{
    "images": [
        {
            "id": 10,
            "url": "http://www.advertise.com.ng/images/00001/0/audi-tt-0001.jpg",
            "thumbUrl": "http://www.advertise.com.ng/images/00001/1/audi-tt-0001.jpg",
            "width": 600,
            "height": 400
        },
        {
            "id": 11,
            "url": "http://www.advertise.com.ng/images/00001/0/audi-tt-0002.jpg",
            "thumbUrl": "http://www.advertise.com.ng/images/00001/1/audi-tt-0002.jpg",
            "width": 500,
            "height": 250
        }
    ]
}

Delete images from ad

http://www.advertise.com.ng/api/ads.images/delete

Delete images from ad.

Authentication

Required OAuth.

Arguments
  • adId (Required) Ad ID.
  • imageIds (Optional) IDs of ad images to delete separated by semicolon (;). If omitted then all ad images will be deleted.
Examples

http://www.advertise.com.ng/api/ads.images/delete.json?adId=86476&imageIds=10;11

Returns an empty success response if it completes without error.

Mail advertiser

http://www.advertise.com.ng/api/ads/mailAdvertiser

Post message to ad owner (advertiser).

Authentication

Required captcha.

Arguments
  • adId (Required) Ad ID.
  • fromEmail (Required) Your contact email.
  • fromName (Optional) Your contact name. Defaults to your profile name.
  • message (Required) Message to post.
Examples

http://www.advertise.com.ng/api/ads/mailAdvertiser.json?{captcha_params}&adId=86476&email=john@example.com&name=John+Smith&message=Cool+ad! Returns an empty success response if it completes without error.

User profile. Create

http://www.advertise.com.ng/api/profile/new

Create user profile.

Authentication

Required captcha.

Arguments
  • email (Required)
  • password (Required)
  • name (Optional)
  • address (Optional)
  • type (Optional) One of: person, company. Defaults to person.
  • allowNotices (Optional) 1 if you want to receive notices/announcements, 0 to not. Defaults to 1.
Examples

http://www.advertise.com.ng/api/profile/new.json?{captcha_params}&email=john@example.com&password=123456&name=John+Smith&address=London

{
    "profile": {
        "id": 3456
    }
}

User profile. Get

http://www.advertise.com.ng/api/profile/get

Get info about user profile.

Authentication

Required OAuth.

Arguments

None.

Examples

http://www.advertise.com.ng/api/profile/get.json

{
    "profile": {
        "id": 3456,
        "email": "john@example.com",
        "name": "John Smith",
        "address": "London",
        "type": "person",
        "allowNotices": 1
    }
}

User profile. Update

http://www.advertise.com.ng/api/profile/update

Update user info.

Authentication

Required OAuth.

Arguments
  • name (Optional)
  • address (Optional)
Examples

http://www.advertise.com.ng/api/profile/update.json?name=John+Smith&address=Hollywood

Returns an empty success response if it completes without error.

User profile. Change password

http://www.advertise.com.ng/api/profile/changePassword

Change user password.

Authentication

Required OAuth.

Arguments
  • currentPassword (Required) Current password.
  • newPassword (Required) New password.
Examples

http://www.advertise.com.ng/api/profile/changePassword.json?currentPassword=123456&newPassword=qwerty

Returns an empty success response if it completes without error.

User profile. Change email

http://www.advertise.com.ng/api/profile/changeEmail

Change user email.

Authentication

Required OAuth.

Arguments
  • currentEmail (Required) Current email.
  • newEmail (Required) New email.
Examples

http://www.advertise.com.ng/api/profile/changeEmail.json?currentEmail=123456@example.com&newEmail=qwerty@example.com

Returns an empty success response if it completes without error.

Subscriptions. Advertise news

http://www.advertise.com.ng/api/subscriptions.news/update

Subscribe or unsubscribe to/from Advertise news.

Authentication

Required OAuth.

Arguments
  • subscribe (Required) 1 to subscribe, 0 to unsubscribe.
Examples

http://www.advertise.com.ng/api/subscriptions.news/update.json?subscribe=1

Returns an empty success response if it completes without error.

Subscriptions. Create

http://www.advertise.com.ng/api/subscriptions/new

Create new subscription.

Authentication

Required OAuth.

Arguments
  • categoryId (category) or cityId (city) or adId (Required) Category or city to find ads within. Or ID of pattern ad to find similar ads to. Category name must be in format: Category/Subcategory, example: FORDON/Bilar. City name must be in format: Region/City, example: Norrbotten/Pajala.
  • adTypes (Required) Ad types separated by semicolon (;). Available types: sell, buy, rent, wish-to-rent, swap, giveaway, job-available, seeking-job, lost, found. Examples: sell;rent.
  • periodicity (Required) Periodicity of checking for the new ads in seconds. Examples: every hour: 3600; every day: 86400; every 7 days: 604800.
Examples

http://www.advertise.com.ng/api/subscriptions/new.json?categoryId=110&adTypes=sell;rent&periodicity=86400

{
    "subscription": {
        "id": 23,
        "name": "Sell, Rent in category FORDON/Bilar, every day",
        "category": "FORDON/Bilar",
        "categoryId": 110,
        "adTypes": "sell;rent",
        "periodicity": 86400
    }
}

Subscriptions. Get

http://www.advertise.com.ng/api/subscriptions/get

Get subscription info.

Authentication

Required OAuth.

Arguments
  • subscriptionId (Required) ID of your subscription.
Examples

http://www.advertise.com.ng/api/subscriptions/get.json?subscriptionId=23

{
    "subscription": {
        "id": 23,
        "name": "Sell, Rent in category FORDON/Bilar, every day",
        "category": "FORDON/Bilar",
        "categoryId": 110,
        "adTypes": "sell;rent",
        "periodicity": 86400
    }
}

Subscriptions. List

http://www.advertise.com.ng/api/subscriptions/list

List all subscriptions.

Authentication

Required OAuth.

Arguments

None.

Examples

http://www.advertise.com.ng/api/subscriptions/list.json

{
    "subscriptions": [
        {
            "id": 23,
            "name": "Sell, Rent in category FORDON/Bilar, every day",
            "category": "FORDON/Bilar",
            "categoryId": 110,
            "adTypes": "sell;rent",
            "periodicity": 86400
        },
        {
            "id": 45,
            "name": "Buy in city Norrbotten/Pajala, every hour",
            "city": "Norrbotten/Pajala",
            "cityId": 56,
            "adTypes": "buy",
            "periodicity": 3600
        },
        {
            "id": 67,
            "name": "Sell, Buy, Rent related to &quot;Utebord + 4 stolar&quot;, every week",
            "ad": "Utebord + 4 stolar",
            "adId": 86476,
            "adTypes": "sell;buy;rent",
            "periodicity": 7200
        }
    ]
}

Subscriptions. Update

http://www.advertise.com.ng/api/subscriptions/update

Update subscription.

Authentication

Required OAuth.

Arguments
  • subscriptionId (Required) ID of your subscription to update.
  • adTypes (Optional) Ad types separated by semicolon (;). Available types: sell, buy, rent, wish-to-rent, swap, giveaway, job-available, seeking-job, lost, found. Examples: sell;rent.
  • periodicity (Optional) Periodicity of checking for the new ads in seconds. Examples: every hour: 3600; every day: 86400; every 7 days: 604800.
Examples

http://www.advertise.com.ng/api/subscriptions/update.json?subscriptionId=23&adTypes=buy&periodicity=3600 Returns an empty success response if it completes without error.

Subscriptions. Delete

http://www.advertise.com.ng/api/subscriptions/delete

Delete subscription(s).

Authentication

Required OAuth.

Arguments
  • subscriptionIds (Required) IDs of your subscriptions to delete separated by semicolon (;).
Examples

http://www.advertise.com.ng/api/subscriptions/delete.json?subscriptionIds=23

Returns an empty success response if it completes without error.

Using of captcha

  • Request captcha ID and image URL.
  • Post captcha ID and text from image among with other method params. Indeed captcha ID is ID of PHP session.
Request new captcha session

http://www.advertise.com.ng/api/captcha/new No authentication required.

Example response:
{
    "captcha": {
        "id": "ca83eec01e85ccfce435ff8b0cd172e7",
        "imageUrl": "http://www.advertise.com.ng/captcha.html?captchaId=d801036882a46484a80e8ae74d8c0b59"
    }
}
Captcha params

To execute method that requires captcha such parameters must be posted:

  • captchaId (Required)
  • captchaText (Required) Text from captcha image.

Client Libraries and Samples

Advertise PHP API - API wrapper classes in PHP with samples of calls made to API.

Got a Question?

Contact us at clientapi@advertise.com.ng

See also

Advertise widgets

Ad Import Tool