Giter Club home page Giter Club logo

cas-api-documentation's Introduction

CAS.AI Reporting API

This guide is for developers who want to use the CAS.AI API to programmatically get information about their CAS.AI account.

The CAS.AI API is built on HTTP and JSON, so any standard HTTP client can send requests to it and parse the responses.

Authorization

Every request your application sends to the CAS.AI API must include an authorization token.

https://b2b.cas.ai/api/login

POST Request: multipart/form-data

{ "email": "[email protected]", "password": "account password" }

Response: JSON

{ "access_token": "Authorization token" }

Use token for Authorization every API request using the Bearer scheme. For example in request header:

Authorization: Bearer <access_token>

Note

Token lifetime: 15 minutes.

Mediation report

https://b2b.cas.ai/api/mediation/data

POST Request body: application/json

Request object structure:

Field Type Description
filter array of objects Mandatory filter options for report. See table of filter below.
columns array of objects List of columns for report. See table of columns below.
calcTotal boolean Append total row for report. (true or false)
currency string Currency of revenue, euro or usd supported only.

Filters

The filter options have the following structure:

"filter": [
    { "type": "app", "value": 1 },
    { "type": "app", "value": 2 }
]
Filter type Description Value Example
date (Required) The first and last days you want in the report, in «YYYY»-«MM»-«DD» format. "value": { "beginDate": "YYYY-MM-DD", "endDate": "YYYY-MM-DD" }
app Report for selected application(s) id. Use id from Applications Ids list response. "value": 1
country Report for selected country(s) id. Use id from Countries Ids list response. "value": 4
format Report for selected format(s) id. See table of ad format ids below. "value": 2
ad_source Report for selected ad source(s) id. Use id from Ad Sources Ids list response. "value": 3

Warning

You must add date filter for each report request.

Columns

The filter options have the following structure:

"columns": [
    { "id": "app" },
    { "type": "date" }
]
Column id Description
ad_source Ad source id column. Use id from Ad Sources Ids list response.
app Application id column. Use id from Applications Ids list response.
date or week or month Date, Week or Month column
country Country id column. Use id from Countries Ids list response.
format Ad Format id column. See table of ad format ids below.
platform Application name platform column
impressions Number of impressions shown
observed_ecpm Observed ECPM column
est_earnings Estimated earnings column
dau DAU column. Available only if ad_source and format columns not requested.
arpu ARPU column. Available only if ad_source and format columns not requested.

Ad Format ids

Id Name
1 Banner Ad
2 Interstitial Ad
3 Rewarded Ad

Ad Sources Ids list

https://b2b.cas.ai/api/mediation/adsources

GET Request:

NO Parameters

Response: JSON

[
    {
        "Id ": 2,
        "AdSource_Name": "AdMob"
    },
    {
        "Id ": 3,
        "AdSource_Name": "Mintegral"
    }
]

Array of objects with structure

Field Type Description
Id integer Ad source database id
AdSource_Name string Name of the Ad Source

Countries Ids list

https://b2b.cas.ai/api/mediation/country

GET Request:

NO Parameters

Response: JSON

[
    {
        "Id": 4,
        "Country_Name": "Azerbaijan"
    },
    {
        "Id": 5,
        "Country_Name": "Bangladesh"
    },
    {
        "Id": 6,
        "Country_Name": "Belgium"
    }
]

Array of objects with structure

Field Type Description
Id integer Country database id
Country_Name string Name of the Country

Applications Ids list

https://b2b.cas.ai/api/mediation/apps

GET Request:

NO Parameters

Response: JSON

[
    {
        "App_ID": 998,
        "Bundle_ID": "com.psv.ladybug.color_by_number",
        "Name": "Miraculous Ladybug: Coloring",
        "Status": "active"
    },
    {
        "App_ID": 999,
        "Bundle_ID": "com.hyppo.goodnight",
        "Name": "Good Night Hippo",
        "Status": "active"
    }
]

Array of objects with structure

Field Type Description
App_ID integer Database id
Bundle_ID string Android bundle name or iTunes Id
Name string Name of the application.
Status string Status: active or test or inactive

Mediation report POST Request example

{
    "filter": [
        {
            "type": "date",
            "value": {
                "beginDate": "2021-12-09",
                "endDate": "2021-12-15"
            }
        },
        { "type": "app", "value": 1 },
        { "type": "country", "value": 4 }
    ],
    "columns": [
        { "id": "ad_source" },
        { "id": "week" },
        { "id": "format" },
        { "id": "impressions" },
        { "id": "observed_ecpm" },
        { "id": "est_earnings" }
    ],
    "calcTotal": true
}

Mediation report response example

{
    "list": [
        {
            "impressions": "219",
            "observed_ecpm": 0.5342465693547845,
            "est_earnings": 0.11699999868869781,
            "week": "2021-0",
            "ad_source": 2,
            "format": 2
        },
        {
            "impressions": "141",
            "observed_ecpm": 0.19148935345893212,
            "est_earnings": 0.026999998837709427,
            "week": "2021-0",
            "ad_source": 2,
            "format": 3
        }
    ],
    "totals": {
        "impressions": "6820",
        "observed_ecpm": 0.31428592090250496,
        "est_earnings": 2.1434299805550836
    }
}

cas-api-documentation's People

Contributors

str4tos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.