SOMA API

Introduction

The Smaato Open Mobile Advertising (SOMA) infrastructure is the mainframe infrastructure to the Smaato exchange. The SOMA Application Programming Interface (API) is designed enable the needs of mobile and in-app publishers and developers to connect to the Smaato exchange (SOMA). The SOMA API can be requested by calling a specific URL with a query string of certain parameters and then the SOMA server will respond via JSON. Please follow this detailed guide for proper integration using the SOMA API and for further questions reach out to your dedicated Account Manager.

Important New Features

Native, Richmedia, Image, and Video (in China region) are only supported by JSON. VAST is only supported by XML(except in China region).

Click Tracking is now available and is mandatory to implement.

If you’re looking to ‘ad-enable’ a mobile application, please refer to our SDKs for information on all major platforms.

For a copy and paste client-side integration into your mobile site or app, check out our Ad Tag.

Adspace Sizes

The Adspace is the area you have designated for advertisements on your mobile website or application. For in-application advertising, the size of the Adspace is usually fixed. It is required that you adjust the size of your Adspace according to the internationally accepted ad formats defined by the Mobile Marketing Association (MMA).

Your Adspace must fit one of the following sizes:

SIZEDESCRIPTION
320 x 50 (MMA XXLarge)The most common format and our recommendation
768 x 1024Fullscreen interstitial portrait mode – Tablet
1024 x 768Fullscreen interstitial lanscape mode – Tablet
480 x 320Fullscreen interstitial landscape mode
320 x 480Fullscreen interstitial portrait mode
300 x 50 (MMA XLarge) 
216 x 36 (MMA Large) 
168 x 28 (MMA Medium) 
120 x 20 (MMA Small) 

Format Notes:

IAB ad formats

Smaato supports ads in the IAB medium rectangle (300 x 250), skyscraper (120 x 600) and leaderboard (728 x 90) format. The formats are designed to be used on tablets and on startup, interstitial or closing screens on smartphones.

Full Screen Ads

Smaato supports full screen ads that can be displayed for example as pre-roll, post-roll or interstitials. To request a full screen ad, use a full screen dimension parameter value (see parameter list below).

VAST Video Ads

VAST Video can be used for example for Pre-/Post-/Mid-Roll ads. They can ONLY be requested with “format=video”. VAST video ads supports only xml response format (except in China region).

If you’re planning to use these formats, please contact us.

Native Ads

Smaato supports Native Ads. These are ads that can be shown the way you want and will look as if they are part of the app content. They can ONLY be requested with “format=native”.

Privacy

Smaato is committed to protect privacy and data protection and strictly complies with applicable data protection laws. We require the client to inform the end user about the personable identifiable information it collects. Moreover, the client is obliged to give the end user the option to “Opt-out” from such action. If the end user chooses to “Opt-out” at any time, the client is required to promptly inform Smaato of an “Opt-out”.

Using the SOMA API

The SOMA API call consists of two separate http-requests. The first request can be established from a web server or from a mobile device directly. The response will contain the URL to download the image from the ad network’s server (or the ad text) and the click URL as well as URLs to impression tracker beacons for 3rd party validation. The second request, which downloads the banner image and impression tracker beacons (if applicable) must be made from the mobile device directly (!). Downloading the impression trackers is always required – even if the ad type is text!

Requesting advertisements from the SOMA API is done by calling the request URL (see below) with a set of parameters in the query string.

Figure 1: Ad Request Workflow

HTTP Header Forwarding

When using a Client<->Server<->SOMA architecture (the request to SOMA is not done directly by a mobile device) 

Which headers are needed?

In general, we need to have ALL headers that the publisher’s server receives from the communication with the mobile device forwarded. The only exceptions are custom headers that are set by your mobile application (for internal reasons).

Examples for original headers (your server received from the mobile device):

Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.133 Mobile Safari/535.19
X-Forwarded-For: 203.177.91.193, 62.159.30.165, 67.69.254.254

Impression and Click Tracking

Impression Trackers

Impression trackers, a.k.a. tracking pixels, impression beacons, view beacons, help to count the view of the advertiser’s ad via a third party and to double check ad server delivery.

An impression tracker is a transparent 1×1 GIF, which has to be requested by the mobile device directly after the ad is displayed.

Click tracking

For API integrations, Smaato relies on publishers to call what we call a ‘click tracking’ beacon. In every ad response (Image, Rich Media, Native and Video), Smaato can include zero (if the click tracking is made in a different way by using the creative itself for example) to multiple beacons under the clicktrackers object.

The click tracking beacons are included as an array of URLs inside of the “clicktrackers” object (see sample below). All Click Tracking beacons in the response must be called as soon as the end user clicks on the ad.

An ad response can also contain multiple click URLs which need to be called in case of a click event  (see the “clicktrackers”: section in the response sample above). If you request ads using the API then you need to ensure that those click URLs are called from your client integration and not server side.

Response Example for IMG (Impression Tracker Excerpt)

{
   "image":{
      "img":{
         "url":"http://some.creative.url",
         "w":"320",
         "h":"50",
         "ctaurl":"http://landing.page.url/buyMe"
       },     
       "impressiontrackers": [
            "http://www.mytracker.com/impressiontracker01",
            "http://www.mytracker.com/impressiontracker02"
       ],
       "clicktrackers": [
            "http://www.mytracker.com/clicktracker01",
            "http://www.mytracker.com/clicktracker02"
      ]
   }
}

Responses may return multiple impression trackers; please note that all of them need to be handled in the same way.

This especially refers to the following case:

  • If an interstitial is being loaded in the background, the impressiontracker(s) should be called as soon as the creative is displayed, not when it’s been fully returned.

Please also respect the following in regards to the set-up of Click trackers and Impression trackers:

  • Modifying or redirecting the impressiontrackers or clicktracker URLs, placing the impression trackers or click trackers in a frame or layer or loading via JavaScript are not allowed.

AdSpaceID/PublisherID (parameters)

You can retrieve your IDs from the Smaato publisher portal.

Unique ID Parameters (IDFA, Google Advertising ID, Android ID)

Certain high-priced campaigns of our ad network partners require to anonymously identify users. The parameters above are used to transfer different types of these IDs.

For mobile application traffic at least one of these parameters is required.

Query String

It is important that you take care that the query string is separated and encoded correctly. Please refer to the encoding guidelines, e.g. RFC 3986 or Wikipedia if you are not sure.

A quick overview:

  • ? separates the query string from the rest of the URL.
  • & separates the field-value pairs (parameters).
  • The syntax for a parameter is [fieldname]=[value].
  • Only the following characters are allowed: 
    • Letters (A-Z and a-z)
    • Numbers (0-9)
    • The characters ‘.’, ‘-‘, ‘~’ and ‘_’
  • Space is encoded as +.
  • All other special characters are encoded with percent-encoding (e.g. %40 means @)
  • Use commas to separate multiple values of the same parameter (e.g. kws=hello,world,app)

Example:

https://api.ad.smaato.net/oapi/v6/ad?pub=0&adspace=0&format=display&extensions=omid

General Parameters

ParameterMandatoryDescriptionTypeExample
adspaceYesAdSpaceID (assigned by Smaato). ID “0” can be used for unattended testing purpose.integer123456789
pubYesPublisherID (assigned by Smaato). ID “0” can be used for unattended testing purpose.integer4711
formatYesThe format of the ad to be returned (All formats will be returned in JSON except Video which will be in XML):display: Image or rich media (strongly recommended!)img: Any image formatrichmedia: Rich mediavideo: Video Adsnative: Native Adssplash: ad type defined based on adspace configuration (SPX)stringimg
devipYes (‘no’ if the device is requesting directly or if you’re sending an x-forwarded-for header)The IP address of the requesting mobile device (this may differ from the request IP e.g. if a publisher’s web server is between the mobile device and SOMA).IP123.45.678.90
refYes for web traffic (‘no’ if the device is requesting directly or if you’re sending the correct referer header of the requesting webpage)Referer: The URL that identifies the address of the webpage where the ad request is coming from.stringhttp%3A%2F%2Fwww.example.com
deviceYes (‘no’ if the device user agent is sent as a header)The user agent of the devicestringMozilla%2F5.0%20(Linux%3B%2
0U%3B%20Android%202.2.1%3B%
20en-us%3B%20Nexus%20One%20
Build%2FFRG83)%20AppleWebKit%2F533.1%20(K
HTML%2C%20like%20Gecko)%20V
ersion%2F4.0%20Mobile%20Saf
ari%2F533.1
mraidverNo3 – MRAID 15 – MRAID 26 – MRAID 3integer2
vastver Yes (if format=video) 2,3,4 or 4.1integer 4
videotypeNo (if adspace videotype configured in SPX), otherwise Yes (if format=video) Choose between:instream-preinstream-midinstream-postoutstreaminterstitialrewardedstringinstream-pre
dimensionNoThe desired dimension of ad to be returned:xxlarge (recommended): this is the most common size (320 x 50)medrect: IAB Medium Rectangle (300 x 250)sky: IAB Skyscraper (120 x 600)leader: IAB Leaderboard (728 x 90)full_320x480: Interstitial ad for smartphones (portrait – switch dimensions for landscape)full_640x960: Interstitial ad for tablets (portrait – switch dimensions for landscape)full_640x1136: Interstitial ad for tablets (portrait – switch dimensions for landscape)full_768x1024: Interstitial ad for tablets (portrait – switch dimensions for landscape)full_800x1280: Interstitial ad for tablets (portrait – switch dimensions for landscape)stringxxlarge
ifaStrongly recommendedIdentifier for advertisingstring1D76F5D1-1983-47C8-B18D-119D52E4597A
dntNoDo not track status: (true = user has decided against tracking). If not set the we assume user is okay with tracking. Not that potential other signals like coppa, ccpa, and gdpr would of course limit tracking even when this one is not set.boolean 
androididNoThe Android device’s Android ID (Settings.Secure.ANDROID_ID)string9774d56d682e549c
coppaYes“0” will indicate that your content should not be treated as child-directed for purposes of COPPA.
“1” will indicate that your content should be treated as child-directed for purposes of COPPA.
integer 0 or 10
gdprNo1 = subject to GDPR
0 = not subject to GDPR
value omited = unknown / unset (default)
integer0 or 10
gdpr_consentNoConsent string according to iAB’s consent string format 1.1stringBOMT6szOMT6szAAABAENAAAAAAAAoAAA
us_privacyNo string
see possible values here
1YNN
skadnYes (for SKAdNetwork support on iOS 14+)List of SKAdNetwork IDsstring: comma separated valuesabc123.skadnetwork, 123abc.skadnetwork, a1b2c3.skadnetwork
skadnvYes (for SKAdNetwork support on iOS 14+)Version of SKAdNetwork (2.0)string2.0
attYes (for iOS 14 support on iOS 14+)Apple AppTrackingTransparency (ATT) framework value (user’s IDFA permission)
0: undetermined
1: restricted
2: denied
3: authorized
integer

0 or 1 or 2 or 3
3
idfvYes (for iOS 14 support on iOS 14+)Apple Identifier for Vendors (IDFV). See herestringFKDALGIF-FAKSL-3IAK-39AL
heightNoHeight of the ad space. Recommended for in-application advertising.integer36
widthNoWidth of the ad space. Recommended for applications.integer36
privacyIconNoWhether to add privacy field for Native requestsstring0 or 1 or false or true1
deeplinkingNoWhether the publisher supports deeplink-supported ad creatives (handling of our deep link schema):
Automatically handled by our NextGen SDK in iOS version 21.6.15+ and Android version 21.6.0+Handled by the publisher (API): Smaato Deep Linking Schema
true or falsetrue
appnameNoThe name of the appstringMy Great App
appstourlNoThe app store URLstringhttps://play.google.com/store/apps/details?id=com.myapp.game
appverNo (currently only required by vlion adnetwork connector in china)The app versionstring1.1.1
allowNativeRichmediaNoWhether the publisher supports Native Rich Media as an ad format (supports Native ads with HTML as an additional creative type, besides just static image, WebView needed instead of ImageView):Automatically handled by our NextGen SDK in iOS version 21.6.15+ and Android version 21.6.0+Handled by the publisher (API): use Response.ext.adm instead of Response.imgtrue or falsetrue
lgpdNoIndicates if a request is a subject to LGPD (Brazil personal information regulation): 1 (is a subject to LGPD) or 0 (not a subject)integer
1 or 0
1
lgpd_consentNoLGPD consent: 1 (consent given) or 0 (not given)integer
1 or 0
1
extensionsNoFor enabling Open Measurement, pass “omid”.stringomid

OTT Parameters

ParameterMandatoryDescriptionTypeExample
channelIdYesId of the source of the video content (assets or broadcast)integer12
adBreakIdYesId of the ad break the request is forinteger400000021
playbackSessionYesSession for the user’s current viewing session (required for VMAP)string40d9e394-740a-4225-83f1-766a04154b83
availDurationSecYes(For Live channel)The duration in seconds of the ad availability slotinteger100
inventoryTypeYesIndicate that SSAI request is from an app or a website, possible values: app or webstringapp
platformNoPlatform the user is watching video content onstringNetflix
assetIdNoUnique identifier of the specific VOD content the user is watching (channelId is provided if Live)string50d9e394-740a-4225-83f1-766a04154b83
assetTitleNoTitle of the specific VOD video content the user is watchingstringEndgame
assetGenreNoGenre of the specific VOD video content the user is watchingstringaction
assetEpisodeNoEpisode number of the specific VOD video content the user is watching (can be for both movies and TV shows in terms of assetType), if applicableinteger1
assetSeriesNoSeries of the specific VOD video content the user is watching (can be for both movies and TV shows in terms of assetType), if applicablestringStar Wars
assetSeasonNoSeason number of the specific VOD video content the user is watching (for TV shows in terms of assetType), if applicablestringSeason 3
assetTypeNoType of the specific VOD video content the user is watching (can be movie, tv-show, or short)stringmovie
assetLengthNoLength in seconds of the specific VOD video content the user is watchinginteger100
assetSourceTypeNoIndicates whether the specific video content the user is watching was originally produced (DIRECT) or if it’s licensed content (INDIRECT)integer1
assetCategoriesNoIAB categories of the specific VOD video content the user is watching (comma separated)stringIAB1-1
assetKeywordsNoString of keywords that describe the specific VOD video content the user is watching (comma separated)stringhorror
assetStudioNoThe producer that created the specific VOD video content that the user is watching (channel name is used if Live)stringWarner Bros
assetUrlNo.mp4 URL of the specific VOD video content that the user is watchingstringhttp://akamaihd.net/video.300k.mp4
productionQualityNoThe production quality of the specific video content (VOD or Live) that the user is watching (UNKNOWN, PROFESSIONAL_PRODUCED for professionally-produced where a studio or company produced it, PROSUMER for prosumer where an amateur with professional equipment produced it, or USER_GENERATED for user-generated content where an amateur filmed it with their phone)integer1

Additional Targeting Parameters

The following parameters can be sent with the ad request in order to allow Smaato a more precise targeting of ads. Even though all of these parameters are optional it is strongly recommended to fill as many of them as possible. Better targetable inventory has a higher value to advertisers and is therefore very likely to be better monetized.
Important: Please inform your users what data you’re sending to third parties and allow them to opt-out. 

Parameter NameMandatoryDescriptionRange Of ValuesExample
Key Value Pairs
cs_keynameNoUsing the prefix cs_ will allow us to identify key value pairs. Please make sure that what you define as an API parameter matches with your key value setup in the Smaato Platform.string: comma separated values.football,tennis,basketball
Content
kwsNoTags (free text, case insensitive) describing the content.string: comma separated valuesmotorsport, news, cars
User
ageNoThe user’s age. 2-digit number. If only a range is available, use the mean average.integer30
genderNoThe user’s gender.m, f, o, M, F, Om
qsNoQuery String: A search term entered by the user within the mobile site.string: comma separated valuescoffee, san+francisco
Location: Information on the user’s location
gpsNoGPS coordinates of the user’s location.string: Latitude and longitude in decimal degrees format, comma separated37.530676,-122.262447
regionNoThe region or state, the user is located in. (Abbreviated with two letter state code)stringCA (for California)
zipNoThe postal code of the user’s location.string94402
geotypeyes if gps is providedSource of location data;integer1 GPS/Location Services2 IP Address3 User provided (e.g., registration data)1
ipserviceyes if geotype=2If geotype=2, please provide the enrichment service you use:integer1 ip2location2 Neustar (Quova)3 MaxMind4 NetAcuity (Digital Element)3
Device
devicemodelNoThe device model. For iOS devices: The exact model.stringiPhone3,1
connectionNoNetwork connection typestringwifi

Request URLs

Endpoint

The Endpoint – /oapi/v6/ad – is used for making requests to the SOMA Server.

Example URL: api.ad.smaato.net

For maximum monetization results we strongly advise you to use this URL.

This Endpoint is also used to make requests in a secure SSL enabled environment.

Example Ad Request

https://api.ad.smaato.net/oapi/v6/ad?pub=0&adspace=0&format=display&extensions=omid

Example Ad Responses

SOMA Video/VAST Response

VAST Ads are supported by XML format only (except in China region)For documentation on VAST XML response values, please refer to the IAB’s VAST 2.0 Documentation.

Sample VAST Response

<VAST version="2.0">
    <Ad id="223626102">
        <InLine>
            <AdSystem version="2.0">Smaato</AdSystem>
            <AdTitle>Smaato Mobile Video</AdTitle>
            <Description>Press Play on Mobile Video Advertising</Description>
            <Survey/>
            <Impression>
                <![CDATA[
                  http://ets-us-east-1.track.smaato.net/v1/view?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e70ecf45fa8e30&originalRequestTime=1535447705863&expires=1535448605863&winurl=rsBTUn82AM1g4bGwBcBAh3gMv7gaABsAhJy0CJtG3hekp8qLiV0xbaZENjWBMaRY-5POt4aCYvvxrdWrwJ8qo2jKEOX0dtFMc3T4wvfXbo91VddS0urPsGxCiPT3OJQW4CTPzOL9pmcbnjGCyfubKtyZKtRc_sPzNnqoXoBL-y_n3F97HyF-uHeTjmgUbhOogMM57dwXX15P2HcEPHB7IGP_1VDzV4PVMJog5RqM3WMXS1g4myP8QGt6DqSc1S1WhHlqo5wsp1A8dWCd87HtNA%3D%3D%7Cc_8jfAnqtYhkb67D-h8R7Q%3D%3D
                ]]>
              </Impression>
            <Creatives>
                <Creative AdID="" sequence="1">
                    <Linear>
                        <Duration>00:00:12</Duration>
                        <TrackingEvents>
                            <Tracking event="start">
                                <![CDATA[ https://soma.smaato.net/videoStart ]]>
                            </Tracking>
                            <Tracking event="midpoint">
                                <![CDATA[ https://soma.smaato.net/midPoint ]]>
                            </Tracking>
                            <Tracking event="midpoint">
                                <![CDATA[ https://soma.smaato.net/midPoint2 ]]>
                            </Tracking>
                            <Tracking event="firstQuartile">
                                <![CDATA[ https://soma.smaato.net/firstQuartile ]]>
                            </Tracking>
                            <Tracking event="firstQuartile">
                                <![CDATA[ https://soma.smaato.net/firstQuartile2 ]]>
                            </Tracking>
                            <Tracking event="thirdQuartile">
                                <![CDATA[ https://soma.smaato.net/thirdQuartile ]]>
                            </Tracking>
                            <Tracking event="thirdQuartile">
                                <![CDATA[ https://soma.smaato.net/thirdQuartile ]]>
                            </Tracking>
                            <Tracking event="complete">
                                <![CDATA[ https://soma.smaato.net/complete ]]>
                            </Tracking>
                            <Tracking event="complete">
                                <![CDATA[ https://soma.smaato.net/complete2 ]]>
                            </Tracking>
                            <Tracking event="mute">
                                <![CDATA[ https://soma.smaato.net/mute ]]>
                            </Tracking>
                            <Tracking event="pause">
                                <![CDATA[ https://soma.smaato.net/pause ]]>
                            </Tracking>
                            <Tracking event="fullscreen">
                                <![CDATA[ https://soma.smaato.net/fullscreen ]]>
                            </Tracking>
                            <Tracking event="fullscreen">
                                <![CDATA[ https://soma.smaato.net/fullscreen2 ]]>
                            </Tracking>
                            <Tracking event="start">
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/start?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </Tracking>
                            <Tracking event="firstQuartile">
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/firstQuartile?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </Tracking>
                            <Tracking event="midpoint">
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/midpoint?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </Tracking>
                            <Tracking event="thirdQuartile">
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/thirdQuartile?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </Tracking>
                            <Tracking event="complete">
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/complete?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </Tracking>
                        </TrackingEvents>
                        <AdParameters/>
                        <VideoClicks>
                            <ClickThrough>
                                <![CDATA[ https://www.smaato.com ]]>
                            </ClickThrough>
                            <ClickTracking id="DART">
                                <![CDATA[ https://soma.smaato.net/clickTracking ]]>
                            </ClickTracking>
                            <ClickTracking id="ThirdParty">
                                <![CDATA[ https://soma.smaato.net/clickTracking2 ]]>
                            </ClickTracking>
                            <ClickTracking>
                                <![CDATA[
                                  http://ets-us-east-1.track.smaato.net/v1/click?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </ClickTracking>
                        </VideoClicks>
                        <MediaFiles>
                            <MediaFile bitrate="457" delivery="progressive" height="720" id="1" type="video/mp4" width="1280">
                                <![CDATA[
                                  https://demofiles.smaato.com/creatives/assets/video/Outstream%20Demo%20Asset%20Mockup.mp4?test=true
                                ]]>
                            </MediaFile>
                        </MediaFiles>
                    </Linear>
                </Creative>
                <Creative AdID="" sequence="1">
                    <CompanionAds>
                        <Companion height="250" width="300">
                            <HTMLResource>
                                <![CDATA[
                                  <a href="https://www.smaato.com/resources/adformats/#section1" target="_blank"><img src="https://smt-demofiles.s3.amazonaws.com/creatives/assets/images/600x500.png" alt="" /></a>
                                ]]>
                            </HTMLResource>
                            <TrackingEvents>
                                <Tracking event="creativeView">https://myTrackingURL/secondCompanion</Tracking>
                            </TrackingEvents>
                            <CompanionClickTracking>
                                <![CDATA[
                                  http://vet-us-east-1.track.smaato.net/companionClickTracking?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863
                                ]]>
                            </CompanionClickTracking>
                        </Companion>
                    </CompanionAds>
                </Creative>
            </Creatives>
            <Error>
                <![CDATA[
                  http://vet-us-east-1.track.smaato.net/error?sessionId=255b66a9-d91f-4dd5-b50f-0ae2e4a781ea&adSourceId=b32698c9-f344-4938-b3e7-0ecf45fa8e30&originalRequestTime=1535447705863&errorCode=$ERRORCODE$
                ]]>
            </Error>
        </InLine>
    </Ad>
</VAST>

SOMA JSON Responses

Below you will find JSON response examples for Image, Rich Media, Native Ads, and Video (in China region)

SOMA Video VAST-JSON Response (in China)

VAST-JSON Response Example: (with deep links)

{
  "VAST" : {
    "Ad" : [ {
      "id" : "229",
      "InLine" : {
        "Error" : [ {
          "content" : "http://vet.track.smaato.net/error?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china&errorCode=[ERRORCODE]"
        } ],
        "Creatives" : {
          "Creative" : [ {
            "id" : "9873",
            "Linear" : {
              "TrackingEvents" : {
                "Tracking" : [ {
                  "event" : "start",
                  "content" : "http://vet.track.smaato.net/start?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                }, {
                  "event" : "firstQuartile",
                  "content" : "http://vet.track.smaato.net/firstQuartile?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                }, {
                  "event" : "midpoint",
                  "content" : "http://vet.track.smaato.net/midpoint?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                }, {
                  "event" : "thirdQuartile",
                  "content" : "http://vet.track.smaato.net/thirdQuartile?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                }, {
                  "event" : "complete",
                  "content" : "http://vet.track.smaato.net/complete?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                } ]
              },
              "VideoClicks" : {
                "ClickTracking" : [ {
                  "content" : "http://ets.track.smaato.net/v1/click?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china"
                }, {
                  "content" : "https://deeplinkTracker1.com"
                }, {
                  "content" : "https://deeplinkTracker2.com"
                } ],
                "ClickThrough" : {
                  "content" : "https://deeplinkURL.com"
                }
              },
              "Duration" : {
                "content" : "00:00:01"
              },
              "MediaFiles" : {
                "MediaFile" : [ {
                  "width" : "370",
                  "type" : "application/x-shockwave-flash",
                  "content" : "http://ad.smaato.com/ads/vpaidad3.swf",
                  "height" : "270"
                } ]
              }
            }
          } ]
        },
        "Impression" : [ {
          "content" : "http://ets.track.smaato.net/v1/view?sessionId=0a49ee2f-4b83-49b9-904e-b42e8ea25ca8&adSourceId=e37030f4-17b5-42f0-aeed-246b6dccd7f7&originalRequestTime=1628848084308&e=china&expires=1628848144308&dpid=SejiqV9iLVAcnZM0hhO1KQ%3D%3D%7C--U8q07dbWiDYyVyLM2RDQ%3D%3D"
        }, {
          "id" : "LR",
          "content" : "http://ImpressionURLInsideTheVast"
        } ],
        "Extensions" : {
          "Extension" : [ {
            "AdServer" : "smaato",
            "Fallback" : {
              "content" : "https://fallbackURL.com"
            },
            "FallbackTracker" : [ {
              "content" : "https://fallbackTracker1.com"
            }, {
              "content" : "https://fallbackTracker2.com"
            } ],
            "type" : "deeplink",
            "creativeId" : "9873"
          } ]
        },
        "AdSystem" : {
          "version" : "4.11.1-3",
          "content" : "LiveRail"
        },
        "AdTitle" : {
          "content" : "LiveRail creative 1"
        }
      }
    } ],
    "version" : "4.1"
  }
}

Image Response type

AttributeTypeDescription
imageObjectThe root object
image.clicktrackersArrayAn array of URLs that contains all click trackers. The click tracking URLs must be called as soon as the user clicks on the creative. (If deeplink trackers were provided in the adresponse, then those are added here as well)
image.fallbacktrackersArrayOnly populated if these fallback trackers were provided to us in the ad response.
image.imgObjectThe creative object
image.img.ctaurlStringThe creative click url. This url needs to be called when the user clicks on the ad. (If a deeplink url is available then that is placed here instead)
image.img.fallbackurlStringThe fallback deeplink url. Only filled if adresponse returned us some deeplink data.
image.img.hIntegerthe height of the creative
image.img.urlStringThe url of the image. Use this image to download and show the image creative in your app.
image.img.wIntegerThe width of the creative
image.impressiontrackersArrayAn array of URLs that contains all impression trackers. The impression trackers should be all called when the creative is visible on the screen.

Example Image Response

(With impression trackers & click trackers)

{
   "image":{
      "img":{
         "url":"http://some.creative.url",
         "w": 320,
         "h": 50,
         "ctaurl":"http://landing.page.url/buyMe"
       },     
       "impressiontrackers": [
            "http://www.mytracker.com/impressiontracker01",
            "http://www.mytracker.com/impressiontracker02"
       ],
       "clicktrackers": [
            "http://www.mytracker.com/clicktracker01",
            "http://www.mytracker.com/clicktracker02"
      ]
   }
}

Rich Media/JavaScript Response Attributes

AttributeTypeDescription
richmediaObjectRoot object
richmedia.mediadataObjectCreative object
richmedia.mediadata.contentStringThe javascript code that needs to be rendered on the screen.
richmedia.mediadata..wIntegerCreative width
richmedia.mediadata.hIntegerCreative height
richmedia.mediadata.ctaurlStringThe creative click url. Filled with the deeplink url if that was provided instead.
richmedia.mediadata.fallbackurlStringDeeplink fallback url.
richmedia.impressiontrackersArrayAn array of URLs that contains all impression trackers. The impression trackers should be all called when the creative is visible on the screen.
richmedia.clicktrackersArrayAn array of URLs that contains all click trackers. The click tracking URLs must be called as soon as the user clicks on the creative.
richmedia.fallbacktrackersArrayAn array of deeplink fallback trackers which is only populated if these were provided to us in the ad response.

Example Rich Media Response

(With impression trackers & click trackers) 

{
   "richmedia": {
        "mediadata": {
            "content": "<THE CONTENT>",
            "w": 800,
            "h": 600
        },
        "impressiontrackers": [
            "http://www.mytracker.com/impressiontracker01",
            "http://www.mytracker.com/impressiontracker02"
       ],
       "clicktrackers": [
            "http://www.mytracker.com/clicktracker01",
            "http://www.mytracker.com/clicktracker02"
        ]
    }
}

Native Ads Response Type

Example Native Ads Response 

(With impression trackers & click trackers) 

{
   "native":{
      "ver": "1.1",
      "link":{
         "url":"http: //i.am.a/URL",
         "clicktrackers":[
            "http://www.mytracker.com/tracker.js",
            "http://www.mytracker.com/tracker.php"
        ]
      },
      "assets":[
         {
            "id": 1
            "title":{
               "text":"Learn about this awesome thing"
            }
         },
         {
            "id": 2
            "img":{
               "type": 1,
               "url":"http://www.myads.com/thumbnail1.png"
            }
         },
         {
            "id": 3,
            "img":{
                "type": 3,
               "url":"http://www.myads.com/largethumb1.png",
               "w":"800",
               "h":"600"
            }
         },
         {
            "id": 4,
            "data":{
               "type": 2,
               "value":"My Brand"
            }
         },
         {
            "id": 5,
            "data":{
               "type": 3,
               "value":"Rating in stars."
            }
         }
      ],
      "eventtrackers":[
         {
            "event":1,
            "method":1,
            "url":"http://www.mytracker.com/tracker.js"
         },
         {
            "event":1,
            "method":1,
            "url":"http://www.mytracker.com/tracker.php"
         }
      ],
      "ext":{
         "smaatoexts":[
            {
               "name":"Moat",
               "script":"<script>MOAT beacon<script/>",
               "conf":{
                  "moatClientLevel1":"20",
                  "moatClientLevel2":"2446",
                  "moatClientLevel3":"53",
                  "moatClientLevel4":"16969427",
                  "moatClientSlicer1":"17",
                  "moatClientSlicer2":"21"
               }
            }
         ]
      }
   }
}
For img and Data objects please refer to tables below to match each type id with the name and the description of the filed.

Data Asset Types

Below is a list of common asset element types of native advertising in OpenRTB Dynamic Native Ads API Specification Version 1.1

Type IDNameDescriptionFormat
1sponsoredSponsored By message where response should contain the brand name of the sponsor.text
2descDescriptive text associated with the product or service being advertised. Longer length of text in response may be truncated or ellipsed by the exchange.text
3ratingRating of the product being offered to the user. For example an app’s rating in an app store from 0-5.number formatted as string
4likesNumber of social ratings or “likes” of the product being offered to the user.number formatted as string
5downloadsNumber downloads/installs of this productnumber formatted as string
6pricePrice for product / app / in-app purchase. Value should include currency symbol in localised format.number formatted as string
7salepriceSale price that can be used together with price to indicate a discounted price compared to a regular price. Value should include currency symbol in localised format.number formatted as string
8phonePhone numbernumber formatted as string
9addressAddresstext
10desc2Additional descriptive text associated with the product or service being advertisedtext
11displayurlDisplay URL for the text ad. To be used when sponsoring entity doesn’t own the content. IE sponsored by BRAND on SITE (where SITE is transmitted in this field).text
12ctatextCTA description – descriptive text describing a ‘call to action’ button for the destination URL.text
500+XXXReserved for Exchange specific usage numbered above 500Unknown

Image Asset Types :

Below is a list of common image asset element types of native advertising described in OpenRTB Dynamic Native Ads API Specification Version 1.1

Type IDName
1Icon
2Logo
3Main
500+xxx

No Ad/ Error Response and Response Headers

VAST No Ad Available Response:

<VAST version="VAST_VERSION"/>
VAST_VERSION being something like e.g. 2.0 or 4.1

VAST-JSON No Ad Available Response (in China region):

{
  "VAST" : {
    "version" : "VAST_VERSION"
  }
}VAST_VERSION being something like e.g. 2.0 or 4.1

HTTP No Ad/Error Response

In case of no ad available or error the SOMA API will respond with following HTTP codes:

HTTP CodeDescriptionComment
204Currently no ad availableNo ad is currently available matching the requesting parameter.
400General ExceptionSomething went wrong on our side.
403ForbiddenThis is returned e.g. when the request was blocked due to IVT

To know more about the kind of error, the SOMA API will add a description of the error in the response header X-SMT-MESSAGE

MessageDescription
Unknown or blocked publisherReturned when the publisher id is wrong or blocked internally.
Publisher Adspace mismatchWhen the publisher and adspace id don’t belong to each other. Please check your ids in SPX and try again.
Unknown or blocked or deleted adspaceAdspace id blocked or removed
Invalid parameters for format VIDEOMissing parameters for the video ad request.
Invalid parameters for format NativeMissing parameters for the native ad request.
General ExceptionAll other errors

General Response Headers

SOMA also returns the Ad Type in the response headers when an Ad is being returned. 

HeaderDescriptionPossible Values
X-SMT-ADTYPEContains the ad response type to determine if the format is an image, rich media, native or video.Img, Richmedia, Native, Video
X-SMT-PRICE-TYPEContains the ad response price type to determine if the value in “X-SMT-PRICE” header is net or gross value.PRICE-BEFORE-REV-SHARE, PRICE-AFTER-REV-SHARE
X-SMT-PRICEContains the ad response CPM price.1.34
Doc Feedback Product Feedback

Last Modified: August 31, 2023 at 11:48 am