I encounter a status 500 error when using the mediationGroup.create method

47 views
Skip to first unread message

강병구

unread,
May 13, 2025, 12:09:34 AMMay 13
to AdMob API Developer Forum

Hello,

I would like to inquire about a status 500 error that occurred while using the AdMob API.

I am trying to create a mediation group using the Java API as shown below. We have obtained the management API permission, and I successfully created a mediation group in the first request without any issues. However, from the second request onwards, I'm getting the error shown below. Could you please help me understand why this is happening?


- response
com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
POST https://admob.googleapis.com/v1beta/accounts/{account}/mediationGroups
{
  "code": 500,
  "errors": [
    {
      "domain": "global",
      "message": "Internal error encountered.",
      "reason": "backendError"
    }
  ],
  "message": "Internal error encountered.",
  "status": "INTERNAL"
}

- code example
val admob = getAdMob()
val targeting = MediationGroupTargeting().setAdUnitIds(adUnitIds).setPlatform(platform.name)
if (platform == Platform.IOS) {
targeting.setIdfaTargeting(IdfaTargeting.AVAILABLE.name)
}

val mediationGroup = MediationGroup().setDisplayName(displayName).setState(State.ENABLED.name).setTargeting(targeting)

val request = admob.accounts().mediationGroups().create("accounts/$publisherId", mediationGroup)
val createdMediationGroup = request.execute()

AdMob API Developer Forum

unread,
May 13, 2025, 12:16:52 AMMay 13
to AdMob API Developer Forum
Hi,

Are you still experiencing this issue?

Is there any major difference between the first request(the successful one) and the following request(the failed ones)?

There are two things I can see from the snippet that might be problematic:
1)  The display name of the second mediation group should be unique and different from the one already created.
2)  The "format" is also missing.


Thanks,

강병구

unread,
May 13, 2025, 4:41:16 PMMay 13
to AdMob API Developer Forum
When I put in the format as mentioned, the following error occurs.

{
  "code": 400,
  "errors": [
    {
      "domain": "global",
      "message": "The format='rewarded,interstitial' of the targeted ad units is not supported by the mediation group '...'.",
      "reason": "failedPrecondition"
    }
  ],
  "message": "The format='rewarded,interstitial' of the targeted ad units is not supported by the mediation group '...'.",
  "status": "FAILED_PRECONDITION"
}


Instead, is it not possible to use the formats REWARDED and INTERSTITIAL? 
It seemed like I could use them when creating in the UI, but I'm inquiring because this error occurs when using the API



2025년 5월 13일 화요일 오후 1시 16분 52초 UTC+9에 AdMob API Developer Forum님이 작성:

AdMob API Developer Forum

unread,
May 13, 2025, 4:44:11 PMMay 13
to AdMob API Developer Forum
Great that you are able to proceed.

For this particular error, I would recommend two things:

1) Please use "rewarded_interstitial" instead of "rewarded,interstitial"
2) Ensure that the ad unit being targeted by the MediationGroup has the same format i.e, "rewarded_Interstitial"


On our end, we will try to improve these error messages to make it more clean and intuitive.

Reply all
Reply to author
Forward
0 new messages