API - How to Generate a token

Gamoshi enables users to issue reports using API, in an easy & fast way.

Gamoshi created a  method for Advertisers and Publishers to get reports using an HTTP GET request by using the following endpoint - https://{dashboard host}/api/v1/report.


  1. In the  Analytics module  -> API tab. Upon the first login, users need to press the 'Generate a token' button.
    You can override the token by using the ''Override token' button. Unless overridden, the token will be valid for 30 days.
  2. You should press the 'Copy' button and place the token in your HTTP GET request URL. 
  3. Users can add parameters to the REST API request, for better filtering and analysis.
    The full list of allowed parameters & values is in the table below.


    Permitted Request Parameters & values - REST API request

Parameter name 

Description 

Supported values

Mandatory

Example

date_range


 

The date range of the report

 

today (default)*

yesterday
last_7_days
this_week
this_month
last_month
last_3_months

No  

from_date

The customized beginning of a date range.

yyyy-mm-dd

No (if exist overrides the date_range value)

2021-02-01

to_date

The customized end of a date range.

yyyy-mm-dd

No

2021-02-28

timezone

The customized time zone. The default is ETC/UTC

America/Los_Angeles America/Yellowknife
America/Phoenix
America/Denver America/Mexico_City
America/Chicago America/New_York America/Argentina/Buenos Aires Etc/UTC Asia/Jerusalem
Europe/Paris Asia/Seoul Asia/Tokyo Asia/Hong_Kong Pacific/Guam Asia/Kathmandu

Or use the format:
GMT+<num>
GMT-<num>
where the <num> is the number of hours, URL encoded 

No

America/Chicago

For GMT+2:
GMT%2B2

For GMT-2:
GMT%2D2

dimensions

The results will be grouped by the chosen value.
Users can choose up to 2 dimensions in one report.

country

inventory_id

advertiser_id

inventory_business_partner_id

advertiser_business_partner_id

device_os

day

ad_size

browser

app_id

campaign_id

ad_type

device_type

app_bundle

site_domain

app_or_site

adomains

No

dimensions=ad_size

perspective

Inventory or Advertiser.

For analytics user of a business partner who has both Advertiser and Inventory. Otherwise, this param would be disabled.

Inventory
Advertiser

No

perspective=
advertiser

granularity

The time granularity of the report

none (default)

hour, day, month

Yes

granularity=hour

output format

The response format.

 

json (default)*
csv
Excel

Yes

output_format=csv

include_sum

If summaries appear at the start

true/false(=default)

No

true

limit

the number of records in the results set

 1-10000

No

default=500

filters

Users can filter the results, multi filters can be applied.
You can use the following:
'contains' or 'notContains'
 '=' or '!='
 '>'  or '<'

All the dimensions

No

filters=country|contains|USA,DEU;ad_type|equals|Banner

metric_filters

Users can filter the results, multi filters can be applied.
You can use the following:
 '=' 
 '!='
 '>'
 '<'

The supported metric dimensions:
impressions
video_impressions
video_start
video_25_pct
video_50_pct
video_75_pct
video_complete

No

metric_filters=impressions|>|1000

Each parameter added should be preceded by '&' and then parameter name = value

Example: A request for data between the date range of 1.4.24 to 30.4.24, daily by dimension 'Country':
https://dashboard.gamoshi.io/api/v1/report?from_date=2024-04-01&to_date=2024-04-30&granularity=day&report_token=report_2024-05-07_3faa738d-79c6-4064-a91c-f74f4e7eg36b&dimensions=country

 


Each response includes zero or more row objects packed into one response as shown below in the example:

"event": {

               "fired_impressions": 1033679,

               "fired_video_impressions": 0,

               "clicks": 0,

               "cost": 773.578,

               "revenue": 531.045,

               "profit": 242.532,

               "partner_legal_name": "",

               "inventory_id": 7700,

              "inventory_name": "example inventory"

           }
Response values  & types

Value Type Description
success boolean success/failed
created date The timestamp of the request
cached boolean true/false
fromTo the date range of the response  
numberOfRows    
timeInMili Number  
rows array of objects  

 

When the same request is issued within the time range of 5-minutes, the response data will not be refreshed (cache value will be true).