Site

Abstract

Use Sites to register websites and mobile apps in the system.

Note

Site(s) are used through this document to refer to website(s) or mobile App(s).

Overview

Website domain names and mobile App bundle ID/package names for each site need to be “allowlisted,” that is, permitted to be included in a list. Otherwise, ads won’t be served for ad units under the site.

Fields

The Site contains the following fields:

Name

Description

Type

Add

Update

id

The ID of the site to retrieve.

long

N/A

Required

status

The status of the site. Valid input values are: ACTIVE, DELETED.

enum

Required

Optional

platform

The platform of the site. Valid input can be WEBSITE, MOBILE_IOS, MOBILE_ANDROID. When this field is not provided, it will default to WEBSITE.

enum

Optional

Optional

siteUrls

The array of SiteUrl that holds URLs of the site or package name of the Mobile App. Valid input can be URL or packageName.

SiteUrl[]

Required

Optional

publisherId

The publisher account ID.

long

Required

Optional

name

The name of the site.

string

Required

Optional

country

The Two letter country code of the site, for example: valid input values are: AU, CA, UK and etc. When this field is not populated, it will default to US.

enum

Required

Optional

sourceType

The External Source Type. Can be one of SYNDICATION, RECOMMENDS, FLURRY, SSP.

enum

Required

Optional

sourceId

The external source Id. The ID that belongs in the external system for book keeping purpose

long

Optional

Optional

SiteUrl Usage

SiteUrl holds the information of a site. In the case of a website, the url should be populated. In case of mobile apps, the packageName should be populated.

Name

Description

Type

Add

Update

url

The URL of the site. Mandatory in case of a website.

string

Required

Optional

packageName

The package name of a site. Mandatory in case of mobile apps.

string

Required

Optional

id

ID of the SiteUrl.

long

No

Required

status

Site URL status

enum

Yes

Optional

Endpoint

Resource URI

https://api.gemini.yahoo.com/v3/rest/site

Operations

Create a New Site

Method: To create one or more sites, make a POST call to the Site endpoint with the required fields. Batch create is supported; either a site or a site array can be passed. The response will be the newly created site, or a list of multiple new sites if an array is passed.

For example:

POST https://api.gemini.yahoo.com/v3/rest/site

Data passed
[
  {
     "status": "ACTIVE",
     "platform": "MOBILE_IOS",
     "country": "CA",
     "publisherId": 973462,
     "siteUrls": [{
           "packageName": "com.xyz.news",
           "status": "ACTIVE"
     }],
     "name": "11796734:1837"
  }
]
Example response
  {
     "errors": null,
     "dataObject": [{
     "status": "ACTIVE",
     "platform": "MOBILE_IOS",
     "createdDate": 1561480942110,
     "lastUpdatedByUser": "edwardsu",
     "createdByUser": "edwardsu",
     "lastUpdated": 1561480942110,
     "country": "CA",
     "publisherId": 973462,
     "siteUrls": [{
           "packageName": "com.xyz.news",
           "status": "ACTIVE"
     }],
     "id": 153730,
     "name": "11796734:1837"
     }
      ]
  }

Update an Existing Site

Method: To update one or more existing sites, make a PUT call to the Site endpoint with one or more site objects. Specify the fields to update; please note that id is the only required parameter, all other fields are optional. The result will be the list of updated sites. Partial update is supported; fields that are either not passed or passed as null will be ignored for the update.

For example: Make a PUT call to update an existing site with ID=153730.

PUT https://api.gemini.yahoo.com/v3/rest/site

Data passed
[
  {
     "id": 153730,
     "name": "11796734:1837"
  }
]

Example response
  {
     "errors": null,
     "dataObject": [{
     "status": "ACTIVE",
     "platform": "MOBILE_IOS",
     "createdByUser": "edwardsu",
     "lastUpdatedByUser": "edwardsu",
     "lastUpdated": 1561481118174,
     "siteUrls": [{
           "packageName": "com.xyz.news",
           "status": "ACTIVE"
     }],
     "createdDate": 1561480942110,
     "country": "CA",
     "publisherId": 973462,
     "id": 153730,
     "name": "11796734:1837"
     }
      ]
  }

Read Specific demandentity Data

Method: To retrieve data for a specific site, make a GET call with the ID parameter.

For example: Make a GET call to retrieve a site with ID=1537300.

GET  https://api.gemini.yahoo.com/v3/rest/site/1537300

Response:
{
  "id": 153730,
  "status": "ACTIVE",
  "platform": "MOBILE_IOS",
  "createdDate": 1561480942110,
  "createdByUser": "edwardsu",
  "lastUpdatedByUser": "edwardsu",
  "lastUpdated": 1561481118174,
  "publisherId": 973462,
  "country": "CA",
  "siteUrls": [{
           "packageName": "com.xyz.news",
           "status": "ACTIVE"
     }],
  "name": "11796734:1837"
}

Response: The site associated with the given ID.

Read data for filtered list of sites

Method: To retrieve data for a filtered list of sites, make a GET call using the following parameters:

Name

Description

Type

publisherId

The ID of the publisher to filter sites by.

long

mr

The maximum number of rows to retrieve.

int

si

The start index or the first element to retrieve.

int

status

The status of the site to filter by.

enum

For example: Make a GET call to retrieve all the sites under publisher account ID 973462 and limit the maximum number of rows to 2.

GET https://api.gemini.yahoo.com/v3/rest/site?publisherId=973462&mr=2

Response:

[
  {
     "id": 153730,
     "status": "ACTIVE",
     "createdByUser": "edwardsu",
     "lastUpdatedByUser": "edwardsu",
     "lastUpdated": 1561481118174,
     "platform": "MOBILE_IOS",
     "country": "CA",
     "siteUrls": [{
           "packageName": "com.xyz.news",
           "status": "ACTIVE"
     }],
     "createdDate": 1561480942110,
     "publisherId": 973462,
     "name": "11796734:1837"
  },
  {
     "id": 15600,
     "status": "ACTIVE",
     "createdByUser": "jennyhung",
     "lastUpdatedByUser": "jennyhung",
     "lastUpdated": 1477454550900,
     "platform": "WEBSITE",
     "country": "US",
     "siteUrls": [{
           "packageName": "com.yahoo.news",
           "status": "ACTIVE"
     }],
     "createdDate": 1421186202543,
     "publisherId": 973462,
     "name": "02323:1233"
  }
]

Important

Only one publisherId parameter is allowed to be passed in as a query parameter for all filtered lists site calls.

Note

You can either: (1) pass filters (status=…. publisherId=…. si=… mr=….) and get a paginated list of sites back or (2) pass specific site ids and get the specified entities with matching ids. If you pass specific site ids, all filters will be ignored.