Skip to content

Latest commit

 

History

History
1004 lines (590 loc) · 18.1 KB

PromoteAPI.md

File metadata and controls

1004 lines (590 loc) · 18.1 KB

User Acquisition API

Methods

Enums

Methods

createAsset

createAsset(titleId, type, filePath, fileName?): Promise<string>

Parameters

Name Type
titleId number
type string
filePath string
fileName? string

Returns

Promise<string>


createAudienceList

createAudienceList(audienceListMeta): Promise<string>

Parameters

Name Type Description
audienceListMeta AudienceListMeta AudienceListMeta meta data of the audience list to create

Returns

Promise<string>


createCreative

createCreative(titleId, creatives): Promise<string>

Parameters

Name Type
titleId number
creatives Creative[]

Returns

Promise<string>


deleteAudienceList

deleteAudienceList(audienceListId): Promise<string>

Parameters

Name Type Description
audienceListId string Audience List ID to delete

Returns

Promise<string>


deleteBids

deleteBids(campaignBids): Promise<string>

Parameters

Name Type Description
campaignBids CampaignBidList[] list of CampaignBids to delete.

Returns

Promise<string>

  • Arry with API results.

getAdvertiserStatistics

getAdvertiserStatistics(startDate, endDate, metrics, reportingOptions?): Stream

Parameters

Name Type Description
startDate string report start date in the following format YYYY-MM-DD
endDate string report end date in the following format YYYY-MM-DD
metrics Metrics[] list of report metrics.
reportingOptions? Object Optional additional parameters.
reportingOptions.adUnit? AdUnits Ad Unit from AdUnits
reportingOptions.breakdowns? Breakdowns[] list of breakdowns.
reportingOptions.bundleId? string[] list of bundle ids
reportingOptions.campaignId? number[] list of campaign ids
reportingOptions.count? number maximum number of records in the report
reportingOptions.country? string[] list of country code in 2 letter country code, as per ISO 3166-1 Alpha-2
reportingOptions.creativeId? number[] list of creative ids.
reportingOptions.deviceType? "phone" | "tablet" -
reportingOptions.direction "desc" | "asc" either 'asc' or 'desc'
reportingOptions.format? "json" | "csv" report format type 'csv' or 'json' only
reportingOptions.order? Metrics | Breakdowns order report according to a specific Breakdown or Metric
reportingOptions.os? "android" | "ios" either 'ios' or 'android'.

Returns

Stream

  • Readable Stream with results - in case of when format is json each chunk will be a json list.

getAssets

getAssets(options?): Promise<string>

Example

{
"assets": [
{
"id": 200303,
"type": "html_iec",
"titleId": 501567,
"orientation": "all",
"source": "playworks",
"duration": null
},
{
"id": 200302,
"type": "video",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": 17
}
],
"totalResultsCount": 6,
"requestId": "MjA1MzUzLjIwMDMwMy40LjM1OTY="
} 

Parameters

Name Type Description
options? Object Optional parameters
options.ids? number[] List of assets ids.
options.pageNumber? number For paginated requests pass the next page of the request.
options.requestId? string For paginated requests pass the requestId from the response.
options.resultsBulkSize? number For paginated requests pass the amount of titles to return, default 100.
options.titleId? number ID of the title of which the assets belongs to.
options.type? string Asset type ('video', 'html', 'html_iec')

Returns

Promise<string>

in json format of the audience list


getAudienceLists

getAudienceLists(): Promise<string>

Example

 {
 "count": 1,
 "audiences": [
   {
     "id": 1,
     "type": "targeting",
     "name": "batz",
     "description": "batz",
     "bundleId": "com.adsd.sdf",
     "platform": "android",
     "lastModified": "2017-01-31T20:00:00.000Z",
     "hasActiveCampaigns": true
   }
 ]
}

Returns

Promise<string>

in json format of the audience list


getBidsForCampaign

getBidsForCampaign(campaignId, maxRecords?): Stream

Parameters

Name Type Description
campaignId number campaign id to get bids for
maxRecords? number (optional) max number of records - default 10000

Returns

Stream

  • ReadableStream that will contain the result

getCreatives

getCreatives(options?): Promise<string>

Parameters

Name Type
options? Object
options.pageNumber? string
options.requestId? string
options.resultsBulkSize? number
options.titleId? number
options.type? CreativeType

Returns

Promise<string>


getSkanReporting

getSkanReporting(startDate, endDate, metrics, reportingOptions?): Stream

Parameters

Name Type Description
startDate string report start date in the following format YYYY-MM-DD
endDate string report end date in the following format YYYY-MM-DD
metrics Metrics[] list of report metrics.
reportingOptions? Object Optional additional parameters.
reportingOptions.adUnit? AdUnits -
reportingOptions.breakdowns? Breakdowns[] list of breakdowns.
reportingOptions.bundleId? string[] list of bundle ids
reportingOptions.campaignId? number[] list of campaign ids
reportingOptions.count? number maximum number of records in the report
reportingOptions.country? string[] -
reportingOptions.creativeId? number[] -
reportingOptions.deviceType? "phone" | "tablet" -
reportingOptions.direction? "desc" | "asc" either 'asc' or 'desc'
reportingOptions.format? "json" | "csv" report format type 'csv' or 'json' only
reportingOptions.order? Metrics | Breakdowns order report according to a specific Breakdown or Metric
reportingOptions.os? "android" | "ios" -

Returns

Stream

  • Readable Stream with results - in case of when format is json each chunk will be a json list.

getTitles

getTitles(options?): Promise<string>

Example

{
       "titles": [
       {
           "id": 113366,
           "bundleId": "com.yourcompany.MiniGame",
           "os": "android",
           "name": "Gaming mania"
       },
       {
           "id": 225566,
           "bundleId": "com.yourcompany.BestGame",
           "os": "ios",
           "name": "The Best Game"
       }
       ],
       "totalResultsCount": 5,
       "requestId": "MzUzMjIuODI5OTk5OS41LjI5"
       }

Parameters

Name Type Description
options? Object Optional Params
options.os? string 'android' or 'ios'
options.pageNumber? number For paginated requests pass the next page of the request.
options.requestId? string For paginated requests pass the requestId from the response.
options.resultsBulkSize? number For paginated requests pass the amount of titles to return, default 100.
options.searchTerm? string Filter by the name or partial name of the title.

Returns

Promise<string>

in json format of the audience list


getUniversalSkanReport

getUniversalSkanReport(date): Promise<undefined | string>

returns a copy of the raw winning postbacks data from every network, directly from Apple.

Parameters

Name Type Description
date string report date

Returns

Promise<undefined | string>

json with list of urls of the report

Example

{
    "urls": [
        "https://postback-hub.s3.amazonaws.com/athena/raw_data_rtm_postback_hub_csv_file/outputs/athena/cf23fe03-cf05-4189-adda-d1cc009a9b59/3/output/companyid%123456/partition_date%3D2021-10-10/compaction_id%3D1/2021_10_11_00_00_output.csv?AWSAccessKeyId=ASIAQO6NX2IJOKSSQ34R&Expires=1633937977&Signature=um69g30FsSp%2BWENsxABotPnk0q8%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEG4a"
    ],
    "expiration": "2021-10-11 07:39:37"
}

updateAudienceList

updateAudienceList(audienceListData): Promise<string>

Parameters

Name Type Description
audienceListData AudienceListData AudienceListData Audience List data to update

Returns

Promise<string>


updateBids

updateBids(campaignBids): Promise<string>

Parameters

Name Type Description
campaignBids CampaignBidList[] List of CampaignBids to update

Returns

Promise<string>

  • Array with API results.

Class: AudienceListData

constructor

new AudienceListData()

Methods

addAudienceListToRemove

addAudienceListToRemove(audienceListId): void

Parameters
Name Type
audienceListId string
Returns

void


addAudienceListToUpdate

addAudienceListToUpdate(audienceListId): void

Parameters
Name Type
audienceListId string
Returns

void


addDevices

addDevices(devices): void

Parameters
Name Type
devices string[]
Returns

void

addDevices(device): void

Parameters
Name Type
device string
Returns

void


toObject

toObject(): any

Returns

any

Class: AudienceListMeta

constructor

new AudienceListMeta(name, type, description, options?)

Parameters
Name Type
name string
type AudienceListType
description string
options? Object
options.bundleId? string
options.platform? PLATFORM

Methods

toObject

toObject(): any

Returns

any

Class: CampaignBid

constructor

new CampaignBid(bid, country, applicationId?)

Parameters
Name Type
bid number
country string
applicationId? number

Class: CampaignBidList

constructor

new CampaignBidList(campaignId)

Parameters
Name Type
campaignId number

Methods

addBid

addBid(bid): void

Parameters
Name Type
bid CampaignBid
Returns

void


getObjectForDelete

getObjectForDelete(): any

Returns

any


getObjectForUpdate

getObjectForUpdate(): any

Returns

any

Class: Creative

Table of contents

Methods

constructor

new Creative(name, type, language, assets?)

Parameters

Name Type
name string
type CreativeType
language string
assets? CreativeAsset[]

Accessors

assets

get assets(): CreativeAsset[]

Returns

CreativeAsset[]


language

get language(): string

Returns

string


name

get name(): string

Returns

string


type

get type(): CreativeType

Returns

CreativeType

Methods

addAsset

addAsset(asset): void

Parameters

Name Type
asset CreativeAsset

Returns

void


isValidated

isValidated(): boolean

Returns

boolean

Class: CreativeAsset

Table of contents

Accessors

constructor

new CreativeAsset(id, usageType)

Parameters

Name Type Description
id number Asset ID from the asset API
usageType UsageType Usage Type of the asset:
For videoAndCarousel creative- video (mp4), left (image), middle (image), right (image).
For videoAndInteractiveEndCard creative- video (mp4), interactiveEndCard (html).
For videoAndFullScreen creative- video (mp4), phonePortrait (image), phoneLandscape (image), tabletPortrait (image) [optional], tabletLandscape (image) [optional].

Accessors

id

get id(): number

Returns

number


usageType

get usageType(): UsageType

Returns

UsageType

Enums

Enum: AdUnits

AppPromotionEnums.AdUnits

Enumeration Members

Banner

Banner = "banner"


Interstitial

Interstitial = "interstitial"


Offerwall

Offerwall = "offerWall"


RewardedVideo

RewardedVideo = "rewardedVideo"

Enum: Breakdowns

AppPromotionEnums.Breakdowns

Enumeration Members

AdUnit

AdUnit = "adUnit"


Application

Application = "application"


Campaign

Campaign = "campaign"


Country

Country = "country"


Creatives

Creatives = "creative"


Day

Day = "day"


DeviceType

DeviceType = "deviceType"


OS

OS = "os"


Title

Title = "title"

Enum: CreativeType

AppPromotionEnums.CreativeType

Enumeration Members

INTERACTIVE_VIDEO

INTERACTIVE_VIDEO = "interactiveVideo"


PLAYABLE

PLAYABLE = "playable"


VIDEO_CAROUSEL

VIDEO_CAROUSEL = "videoAndCarousel"


VIDEO_FULLSCREEN

VIDEO_FULLSCREEN = "videoAndFullScreen"


VIDEO_INTERACTIVE_ENDCARD

VIDEO_INTERACTIVE_ENDCARD = "videoAndInteractiveEndCard"

Enum: Metrics

AppPromotionEnums.Metrics

Enumeration Members

Clicks

Clicks = "clicks"


Completions

Completions = "completions"


Impressions

Impressions = "impressions"


Installs

Installs = "installs"


Spend

Spend = "spend"


StoreOpens

StoreOpens = "storeOpens"

Enum: PLATFORM

AppPromotionEnums.PLATFORM

Enumeration Members

Android

Android = "android"


iOS

iOS = "ios"

Enum: UsageType

AppPromotionEnums.UsageType

Enumeration Members

INTERACTIVE_ENDCARD

INTERACTIVE_ENDCARD = "interactiveEndCard"


LEFT

LEFT = "left"


MIDDLE

MIDDLE = "middle"


PHONE_LANDSCAPE

PHONE_LANDSCAPE = "phoneLandscape"


PHONE_PORTRAIT

PHONE_PORTRAIT = "phonePortrait"


RIGHT

RIGHT = "right"


TABLET_LANDSCAPE

TABLET_LANDSCAPE = "tabletLandscape"


TABLET_PORTRAIT

TABLET_PORTRAIT = "tabletPortrait"


VIDEO

VIDEO = "video"

Enum: AudienceListType

Enumeration Members

Suppression

Suppression = "suppression_static"


Targeting

Targeting = "targeting"