Note: This API is not activly used anymore.

This API will provide an array of banners that are displayed in Y8 mobile games. This helps get more than one game on each device and build brand knownledge. To get started, ask your contact for the API link.

Output example

{
  "success": true,
  "ad_types": {
    "Example 200x200": [
      {
        "url": "https://img-hw.y8.com/system/mobile-banner/27/iconFootBall_200x200.png?1495040759",
        "link": "https://play.google.com/store/apps/details?id=air.com.madpuffers.football&referrer=utm_source%3DCP_NNC_200x200",
        "width": 200,
        "height": 200
      },
      {
        "url": "https://img-hw.y8.com/system/mobile-banner/28/asgard200x200.png?1495124561",
        "link": "https://play.google.com/store/apps/details?id=air.net.annieandmark.AsgardSkillMaster&referrer=utm_source%3DCP_NNC_200x200",
        "width": 200,
        "height": 200
      }
    ]
  }
}

Usage

As each platform is different, we provide some psudo code below.

  1. You will need to download the json sent from that address.
  2. Then parse it into an object, usally something similar to obj = JSON.parse(jsonString)
  3. Verify api was a success if (obj.success)
  4. Find the ad type depending on the location ads = obj.ad_types['Example 200x200']

There are multiple ads as they should be cycled through. For example, this 200x200 banner would go on a main menu maybe.

So we start at index 0

index = 0

Next time the main menu opens, add 1 to the index or loop around

if ads.length == index + 1
  index = 0
else
  index++

Finally get your banner data

banner = ads[index]

Some banner images need to be resized down to fit with the display. One example, is a intro banner. A close button should be place at the top right.

This following button can be resized and placed as needed.

close button