New HTTP v1 API got UNIMPLEMENTED error

235 views
Skip to first unread message

Jeffrey Tang

unread,
Sep 11, 2024, 5:51:34 PMSep 11
to Firebase Google Group
Hi teams,

We recently experienced "Notification not receive" issues and after checking, it is found that majority of the send-notification requests are returning error as follow,

{
  "error": {
    "code": 501,
    "message": "Operation is not implemented, or supported, or enabled.",
    "status": "UNIMPLEMENTED"
  }
}

Furthermore, in some situations, sending different notifications to the same token would be resulted as "Some success, but some fail".

Would someone please advise to us
1. what is this error actually referring to? &
2. how should we trouble shoot the situation?

Thanks in advance.

References:
Get Registration-Token method >> via Firebase BoM ver33.2.0
Send notification function >> calling the HTTP v1 REST API directly
Language >> Java

Joe Spiro

unread,
Sep 11, 2024, 5:53:22 PMSep 11
to Firebase Google Group
Hello,

Can you please post the code you are using to send this? 

Adeem Salik

unread,
Sep 12, 2024, 9:59:02 AMSep 12
to Firebase Google Group
Hi,
I am getting the same error 501. following are the details:

<PackageReference Include="FirebaseAdmin" Version="3.0.0" />

Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", dcmFilePath);
string projetoId = "myProjId";
defaultApp = FirebaseApp.Create(new AppOptions()
{
    Credential = GoogleCredential.FromFile(dcmFilePath),
    ProjectId = projetoId,
});

var messages = new List<Message>();
messages.Add(new Message()
            {
                Notification = new Notification()
                {
                    Title = "My test message 123",
                    Body = "Test Message body 123" 
                },
                Data = new Dictionary<string, string>()
                {
                    { "score", "850" },
                    { "time", "2:45" },
                },
                Token = fcm_token,
            }

var responses = await FirebaseMessaging.DefaultInstance.SendAllAsync(messages)

Joe Spiro

unread,
Sep 12, 2024, 10:05:45 AMSep 12
to Firebase Google Group
All versions of SendAllAsync are obsolete: use  Use SendEachAsync instead.

For more info: all calls to the batch API were deprecated in June of 2023 and are being disabled now in 2024. Check out our guide on migrating to the v1 send API.

To the original poster, unless shown otherwise, I assume this is also what's happening with you but wanted the code because what MAY have happened is that the methods you are calling (despite the SDK you are using being configured for the V1 send API) might be using the Batch API which is NOT compliant/current.

Joe Spiro

unread,
Sep 12, 2024, 10:09:11 AMSep 12
to Firebase Google Group
Sorry this is the correct first link.

Jeffrey Tang

unread,
Sep 13, 2024, 8:58:28 AMSep 13
to Firebase Google Group
Hi all,

After our further investigate, we found that the cause of getting 501 - UNIMPLEMENTED error is the outdated private-key JSON file.

When we are migrating from the old FCM Send API to the new HTTP v1 API, the same private-key file is used and so the SEND API sometime returned success but sometime returned 501.
After that, we have refreshed the keys on Firebase console, then download & applied the new file to the program. The push notification service is now resumed.

BR.
Reply all
Reply to author
Forward
0 new messages