Developer API 1.0

Campaigns

An interface designed for retrieval of active and runnable campaigns in JSON format. Campaigns may be removed from the feed at any time and therefore proper integration requires a differential every 5 minutes. For example, one might pull all previous offers from a database and build a deactivation list based on which ones are missing in the API.

val systemOffers = DB.getOffers()
val apiOffers = Http.get(API_URL).as[Offers]

val offerIdsInactive = SystemOffers.filterNot{ offer => apiOffers.contains(offer.id) }.map(_.id)
DB.deactivate(offerIdsInactive)

Contents

Releases

1.0

1.1

See the updated documentation here
  • Added description field to the campaigns object

Requests

Methods

Method Endpoint
GET http://api.castleads.com/1.0/campaign

Examples

Get all campaigns

wget http://api.castleads.com/1.0/campaign?token=a7740b207caa6b861378dc280626edcb

Results

The API returns a high level object with information about the request and a list of offers in the results attribute.

{
    "status": "ok",
    "results": [
        {
            id: "7564f30f-7ccb-4fbc-9537-23799d0d289a",
            name: "Candy Crush Saga",
            itunesId: "14466662",
            androidPackageName: "com.candycrush.saga",
            urlPreview: "http://play.google.com/com.candycrush.saga",
            campaigns: [

            ]
        }
        // ..
    ]
}

Offer object

Property Type Description
id String Internal UUID
name String
itunesId Integer nullable Identifier used in store URIs. https://itunes.apple.com/us/app/mobile-security-cloud-mdm/id567173760?mt=8
androidPackageName String nullable Java package name convention for Android/Google Play
urlPreview String nullable Preview to landing page or creatives
campaigns List[Object] Every active campaign object for this offer

Campaign object

Property Type Description
id String Internal UUID
conversionMethod String
description String nullable Additional text describing the campaign, including KPIs, targeting, and restrictions
price Double Bounty for completing offer requirements
capRevenueDaily Double nullable Max price * conversions per day
capRevenueMonthly Double nullable Max price * conversions per month
capImpressionDaily Double nullable Max impressions per day
capClickDaily Double nullable Max clicks per day
capClickDaily Double nullable Max clicks per day
capConversionDaily Double nullable Max conversions per day
targets List[Object] All target objects for this offer
urlClick String See Tracking Links for detail
urlImpression String Ditto

Targeting

Compliance with the target objects on each campaign will result in the greatest performance. Failure to do so may jeopardize your account or cause technical failures. Please familiarize yourself with the targeting requirements for a campaign before going live.

Target object

Property Type Description
attribute String Describes the targetable property, e.g. countryIso
operator String See Target Operators
value Mixed The value of the attribute operator acts on

Target Attributes

Attribute Description
countryIsoISO 3166-1 alpha-2 code, e.g. US, CA, RU
operatingSystemOS, e.g. iOS, Android, Windows
deviceTypePhone, Tablet, Desktop, etc

Target Operators

Operator Description
inin list
ninnot in list
eqequal to
neqnot equal to
gtgreater than
ltless than