Publishers: Examples

To help get you on the right track, below are some example queries / mutations.

Look up all apps and get their placements

References:

query {
  publisher{
    apps(first: 50){
      edges{
        node{
          id
          name
          placements{
            id
            name
            mediationName
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}
{
  "data": {
    "publisher": {
      "apps": {
        "edges": [
          {
            "node": {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "XXX YYY ZZZ",
              "placements": [
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": "ironsource"
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                }
              ]
            }
          },
          {
            "node": {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "XXX YYY ZZZ",
              "placements": []
            }
          }
        ],
        "pageInfo": {
          "endCursor": "Mg",
          "hasNextPage": true
        }
      }
    }
  }
}

Note that you can use the endCursor from the above response to request the next page. For example:

query {
  publisher{
    apps(first: 2, after: "Mg=="){
      edges{
        node{
          id
          name
          placements{
            id
            name
            mediationName
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}
{
  "data": {
    "publisher": {
      "apps": {
        "edges": [
          {
            "node": {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "XXX YYY ZZZ",
              "placements": [
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": "ironsource"
                },
                {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "name": "XXX YYY ZZZ",
                  "mediationName": null
                }
              ]
            }
          },
          {
            "node": {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "XXX YYY ZZZ",
              "placements": []
            }
          }
        ],
        "pageInfo": {
          "endCursor": "NA",
          "hasNextPage": true
        }
      }
    }
  }
}

Look up user time zones

References:

Note that utcOffset is +/- the number of hours and minutes that the time zone is from UTC. If the time zone is UTC, it will be returned as +00:00.

Additionally, information will change based on if the time zone is currently experiencing daylight savings time. For example you may see EDT or EST for Eastern Time's abbreviation.

query {
  user {
    firstName
    lastName

    timeZone {
      utcOffset
      name
      abbreviation
    }
  }
}
{
  "data": {
    "user": {
      "firstName": "Jane",
      "lastName": "Doe",
      "timeZone": {
        "utcOffset": "-05:00",
        "name": "Eastern Time (US & Canada)",
        "abbreviation": "EDT"
      }
    }
  }
}

Look up placements for a specific app id

References:

query {
  publisher{
    placements(appId: "00000000-0000-0000-0000-000000000000"){
      id
      name
      mediationName
    }
  }
}
{
  "data": {
    "publisher": {
      "placements": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "AppLaunch",
          "mediationName": null
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "InsufficientCurrency",
          "mediationName": null
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo",
          "mediationName": "ironsource"
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_High",
          "mediationName": null
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_Interstitial",
          "mediationName": null
        }
      ]
    }
  }
}

Look up content cards

References:

query {
  publisher {
    placements (appId:"00000000-0000-0000-0000-000000000000") {
      id
      name
      contents {
        id
        name
      }
    }
  }
}
{
  "data": {
    "publisher": {
      "placements": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "AppLaunch",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "Content for AppLaunch testing by Tapjoy"
            },
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "Content for testing placement by Tapjoy"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "InsufficientCurrency",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "Content for InsufficientCurrency testing by Tapjoy"
            },
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "Content for testing placement by Tapjoy"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "RV"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_High",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "High_RV_iOS"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_Interstitial",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "INT"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_B",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "RV B"
            },
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "IS_RewardedVideo_B"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_High_B",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "High_RV_iOS_B"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_Interstitial_B",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "INT B"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_Mid",
          "contents": []
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_Mid_B",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "IS_RewardedVideo_Mid_B"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "FairwaySolitaire_iOS_RV_Bidder",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "FairwaySolitaire_iOS_RV_Bidder"
            }
          ]
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "FairwaySolitaire_iOS_INT_Bidder",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "FairwaySolitaire_iOS_INT_Bidder"
            }
          ]
        }
      ]
    }
  }
}

Look up placement reports

References:

{
  publisher{
    placements(appId: "00000000-0000-0000-0000-000000000000") {
      id
      name
      contents {
        id
        name
        type
        ecpmSettings {
          country
          cpmFloorType
          price
        }
      }
      insights(timePreset: TODAY) {
        reports {
          clicks
          conversions
          impressions
          dailyUniqueViewers
          dailyUniqueConversions
          earnings
        }
        timestamps
      }
    }
  }
}
{
  "data": {
    "publisher": {
      "placements": [    
       {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "offerwall_unit",
          "contents": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "Offerwall (Offerwall+)",
              "type": "OFFERWALL",
              "ecpmSettings": [
                {
                  "country": "US",
                  "cpmFloorType": "BALANCED",
                  "price": 5
                }
              ]
            },
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "name": "offerwall_plus",
              "type": "OFFERWALL",
              "ecpmSettings": [
                {
                  "country": "US",
                  "cpmFloorType": "BALANCED",
                  "price": 5
                }
              ]
            },
          ],
          "insights": {
            "reports": [
              {
                "clicks": [
                  4
                ],
                "conversions": [
                  1
                ],
                "impressions": [
                  6
                ],
                "dailyUniqueViewers": [
                  1
                ],
                "dailyUniqueConversions": [
                  1
                ],
                "earnings": [
                  0
                ]
              }
            ],
            "timestamps": [
              "2021-09-22T00:00:00Z"
            ]
          }
        }
      ]
    }
  }
}

Look up mediation reports, ONLY for mediation partners use

Mediation partners include Fyber, Admob, Consoliads, ironSource, Chartboost, and Ad Generation

References:

query {
  publisher{
    placements(appId: "00000000-0000-0000-0000-000000000000"){
      id
      name
      mediationName
      mediationInsights{
          reports{
            revenue
            conversions
            impressions
          }
        }
    }
  }
}
{
  "data": {
    "publisher": {
      "placements": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo",
          "mediationName": "ironsource",
          "mediationInsights": {
            "reports": [
              {
                "revenue": [
                  111
                ],
                "conversions": [
                  222
                ],
                "impressions": [
                  333
                ]
              }
            ]
          }
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "AppLaunch",
          "mediationName": null,
          "mediationInsights": {
            "reports": [
              {
                "revenue": [
                  0
                ],
                "conversions": [
                  0
                ],
                "impressions": [
                  0
                ]
              }
            ]
          }
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "InsufficientCurrency",
          "mediationName": null,
          "mediationInsights": {
            "reports": [
              {
                "revenue": [
                  0
                ],
                "conversions": [
                  0
                ],
                "impressions": [
                  0
                ]
              }
            ]
          }
        },
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "IS_RewardedVideo_High",
          "mediationName": null,
          "mediationInsights": {
            "reports": [
              {
                "revenue": [
                  0
                ],
                "conversions": [
                  0
                ],
                "impressions": [
                  0
                ]
              }
            ]
          }
        }
      ]
    }
  }
}