FCM HTTP V1 API returns 404 for unregistered token - google-cloud-messaging

FCM HTTP v1 API supposed to return error code "UNREGISTERED" when device is unregistered (app uninstalled). However API returns 404 "Requested entity was not found".
Have anyone experienced this? Is this the expected one? There is no mention about this anywhere in the documentation.
Is it safe to assume device is unregistered when 404 error with the message "Requested entity was not found" received?
Following is the full body of the error received.
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"errors": [
{
"message": "Requested entity was not found.",
"domain": "global",
"reason": "notFound"
}
],
"status": "NOT_FOUND"
}
}
Exception:
Caused by: com.google.firebase.messaging.FirebaseMessagingException: Requested entity was not found.
at com.google.firebase.messaging.FirebaseMessaging.handleSendHttpError(FirebaseMessaging.java:266) ~[firebase-admin-5.9.0.jar:?]
For reference API documentation:
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode

Yes, I've experienced this with the firebase-admin-node module, which has been updated recently to map NOT_FOUND to an "unregistered" error, so it appears that it is an expected response.
https://github.com/firebase/firebase-admin-node/commit/069c9cd50502b0fa7cc6843ea3ef9d8d85dca9b9#diff-ce3edf3ab3ed8957259b6bd4035a0256R617
(Though it looks to be the status being NOT_FOUND is the key info rather than the "Requested entity was not found" message)
One thing you may want to confirm is unregistered tokens from different browsers/devices. I.e., I think unregistered tokens from chrome returned a different error than one from firefox.

We face error 404 error code when sending notifications to Unregistered Devices via the old FCM endpoint:
https://fcm.googleapis.com/fcm/send
The documentation for API v1 has been updated and and does not contain this error code.

Related

Microservice subscript to subtenant REST Endpoint not working

I deployed my microservice over master tenant and subscript it onlty to subtenant.
If I call:
GET https://subtenant.cumulocity.com/service/mymicroservice/health i get Status Code 200 and UP
However if I call:
GET https://subtenant.cumulocity.com/service/mymicroservice/myendpoint/data
I get Status Code 500 and
{
"timestamp": 1534235792950,
"status": 500,
"error": "Internal Server Error",
"exception": "com.cumulocity.sdk.client.SDKException",
"message": "Http status code: 403\n{error=\"security/Forbidden\",message=\"Access is denied\",info=\"https://www.cumulocity.com/guides/reference-guide/#error_reporting\",details=\"null\"}",
"path": "/ mymicroservice /data"
}
When I subscribe to the master tenant, the microservice is working fine! It seems that the user of subtenant is not allowed to access the Cumulocity APIā€¦ I also checked the user and the role. The access rights are all granted. How can i access my microservice at subtenants?
I solved the problem by my self. I made a mistake; i forgot to add a role to the manifest to requiredRoles. It was also not working in master tenant.

RingCentral giving me error of "[OutboundFaxes]" at the time of sending FAX

I am trying to send FAX using POSTMAN using following URL "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/****88004/fax"
and I'm getting:
{
"errorCode": "CMN-408",
"message": "In order to call this API endpoint, user needs to have [OutboundFaxes] permission for requested resource.",
"errors": [
{
"errorCode": "CMN-408",
"message": "In order to call this API endpoint, user needs to have [OutboundFaxes] permission for requested resource.",
"permissionName": "OutboundFaxes"
}
],
"permissionName": "OutboundFaxes"
}
There was a problem in Bearer Token at the time of making Send Fax request.
Because I was using primary account details for generating Token and at the time of sending FAX I was using extensionid of extension 102 and Bearer Token was generated with Main account extension 101. That is why it was throwing [OutboundFaxes] permission error.
To send FAX with ExtensionId of extension 102 , then generate the token using subaccount 102 details instead of main account.
I have successfully reproduced the issue.
test case
The root cause is just what #Jack said: authorize with extension 101 then try to send the fax with extension 102.
The error message is
{ errorCode: 'CMN-408',
message: 'In order to call this API endpoint, user needs to have [OutboundFaxes] permission for requested resource.',
errors:
[ { errorCode: 'CMN-408',
message: 'In order to call this API endpoint, user needs to have [OutboundFaxes] permission for requested resource.',
permissionName: 'OutboundFaxes' } ],
permissionName: 'OutboundFaxes' }
I think the error message needs to be improved. It's very hard to figure out the root cause by reading it. I have reported this issue to RingCentral engineering team.

Google Page Speed Insights API: Internet Error

I am getting an error from Google PageSpeed Insights API. Its just returns Internal Error with Code 500.
Here is the detailed response:
"error": {
"errors": [
{
"domain": "global",
"reason": "internalError",
"message": "An error occurred while fetching or analyzing the page."
}
],
"code": 500,
"message": "An error occurred while fetching or analyzing the page."
}
}
I also Tried with Google API key from within Google Cloud Console (Enabled
PageInsights APi for my account). No Luck still the same message.
Here is a result screenshot of the same page tested on tools.pingdom.com
It would be helpful if Google Provided detailed error messages which can help us identify where the issue is. Any help or pointers on this would be great.
The issue was with an SVG image. Once it was removed Page Speed starting working. Still not sure what was wrong with the image.
You have too many resources loading on page load. The Render limit is 200.
You can also try to test your site with think with Google

Pinterest API calls failing - internal server errror

This is an internal server error so it seems to be an issue on Pinterest's side. I've tried a few things but these accounts always seem to have the internal error.
Here's an example URL that caused the problem:
URL: https://api.pinterest.com/v1/boards/533324849561780294/pins?access_token=AX1gRVqQ2O-VNVVlWy1wAkz3JDvAFDeLJQ7Eom1C53m7hgAuWgAAAAA&fields=url,creator,created_at,counts,image,color,media,attribution,note,link
Exception Error: HTTP request failed! HTTP/1.1 500 INTERNAL SERVER ERROR
Response:
{"message": "A InstantContentBlockField was passed an unknown block_type: text", "type": "api"}
Remove "link" from the fields you will get normal response.

401 with Google Proximity API

after following the step-by-step instructions (https://developers.google.com/beacons/proximity/guides) I can successfully enable the Google Proximity Beacon API and create both API key and OAuth 2.0 client IDs for the App I created in the Google Developers Console.
Everything appears to be set up fine: the Google Proximity Beacon API shows to be active and "Credentials" tabs shows both API Key and OAuth 2.0 client ID.
The problem occurs when I try calling my Beacon: the Response gives me a "401" error:
...
"code": 401,
"message": "The request does not have valid authentication credentials.",
"status": "UNAUTHENTICATED"
...
The strange thing is that if I try the oauthplayground, again following google's proximity docs, I get a 403 error:
{
"error": {
"status": "PERMISSION_DENIED",
"message": "Project has not enabled the API. Please use Google Developers Console to activate the 'proximitybeacon' API for your project.",
"code": 403,
"details": [
...
I'm kind of lost here...anyone?
Thank you in advance.
Flik