NAV Navigation
Shell HTTP JavaScript Ruby Python PHP Java Go

Advertising API v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Mariana Tek's Advertising API is an interface for client's ad servers.

Email: Support

Mobile Dashboard Ads

Return mobile dashboard ads for a given user.

Return Mobile Dashboard Ads

Code samples

# You can also use wget
curl -X POST /api/advertising/v1/mobile_dashboard_ads \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/advertising/v1/mobile_dashboard_ads HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "user_id": "231"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/advertising/v1/mobile_dashboard_ads',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/api/advertising/v1/mobile_dashboard_ads',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/api/advertising/v1/mobile_dashboard_ads', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/advertising/v1/mobile_dashboard_ads', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/advertising/v1/mobile_dashboard_ads");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/advertising/v1/mobile_dashboard_ads", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/advertising/v1/mobile_dashboard_ads

Return mobile dashboard ads for a given user.

Body parameter

{
  "user_id": "231"
}

Parameters

Name In Type Required Description
body body MobileDashboardAdBody true The request body contains the authenticated user's ID

Example responses

200 Response

{
  "primary_cards": [
    {
      "image_url": "https://link/to/your/image",
      "redirect_url": "https://link/to/your/landing/page"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK TrackingConsentLog created successfully. MobileDashboardAds
401 Unauthorized Authorization information is missing or invalid. None
422 Unprocessable Entity Request is invalid. None

Schemas

MobileDashboardAdBody

{
  "user_id": "231"
}

Properties

Name Type Required Restrictions Description
user_id string true none Authenticated user's ID

MobileDashboardAds

{
  "primary_cards": [
    {
      "image_url": "https://link/to/your/image",
      "redirect_url": "https://link/to/your/landing/page"
    }
  ]
}

Properties

Name Type Required Restrictions Description
primary_cards [MobileDashboardAd] false none none

MobileDashboardAd

{
  "image_url": "https://link/to/your/image",
  "redirect_url": "https://link/to/your/landing/page"
}

Properties

Name Type Required Restrictions Description
image_url string(URL) false none The URL of the image to display in the ad.
redirect_url string(URL) false none The URL to take the user to when tapping or clicking on the ad.