Sending a notification through Firebase's FCM API Test - firebase

I'm currently trying to send a notification using the " Try this API " interface of Firebase.
I filled my Request Body with this :
{
"validateOnly": false,
"message": {
"notification": {
"body": "Body",
"title": "Title"
}
}
}
and the RequestParameters with
projects/myprojectid
I didn't check the Google API Key since my project doesn't have one, but I checked the Google OAuth 2.0.
After executing, I get this error :
{
"error": {
"code": 400,
"message": "Recipient of the message is not set.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message",
"description": "Recipient of the message is not set."
}
]
},
{
"#type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
}
]
}
}
After some research, I don't understand what is missing in the request. Are all the parameters mandatory for the request ?

You're not specifying who the message is for, which is what the error message is trying to tell you. You can do by either including a token key with one of more device tokens, or a topic or condition key in the JSON.
Also see the Firebase documentation on building requests to send a message for more information and examples of each of these.

Related

Google Consent API

The samples and documentation for the Cloud Healthcare Consent API need a refresh. For instance, when POST to attributeDefinitions?attributeDefinitionId=requester_identity
with BODY:
{
"description": "what groups are consented for access",
"category": "REQUEST",
"allowedValues": [
"fhirUser"
]
}
{
"error": {
"code": 400,
"message": "attribute definition ID malformed, must match ^[_a-zA-Z][_a-zA-Z0-9]{0,255}$",
"status": "INVALID_ARGUMENT"
}
}
These are the values straight from the documentation.
This was an error on my side. The proxy was dropping the query string parameter. The value in the documentation is correct.

how can I send fcm using user segment

now I'm testing http request using POSTMAN
**"to": "/topics/all", ---> ?? how can i write this line??**
"priority": "high",
"notification": {
"title": "テスト Title",
"body": "テスト Body"
},
"data": {
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
I checked status 200 ok
when I send message with firebase web page, it works well
but without firebase cloud message service, it doesn't work
In firebase cloud message service, the targeting condition is
I'm suppose that if i can write targeting condition in http format, I can send message to my app
help me
What you are looking for is key "topic"
{
"topic": "all",
"notification":{
"title": "テスト Title",
"body": "テスト Body"
},
"data":{
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
}

Google Calendar Events Watch 400 pushNotSupportedForRequestedResource

I am trying to subscribe to all user's calendars, but some calendars do not support this functionality.
Request:
POST https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/watch
Response:
{
"error": {
"errors": [
{
"domain": "calendar",
"reason": "pushNotSupportedForRequestedResource",
"message": "Push notifications are not supported by this resource."
}
],
"code": 400,
"message": "Push notifications are not supported by this resource."
}
}
How I can find out whether the current calendar support "watch"?
Does it corresponding to "accessRole" from calendar#calendarListEntry.accessRole

Sabre Hotel Content Rest API stopped working

POSTing to https://api.sabre.com/v1.0.0/shop/hotels/content?mode=content yesterday worked fine, but with the same Postman request is failing today.
The fault code is: "Client.InvalidCustomerAppId" (but the Http status code is 200.)
Nothing changed on our end, is it possible that I was using an account that no longer has access to this API?
Full JSON response is:
{
"Fault": {
"faultcode": "{http://schemas.xmlsoap.org/soap/envelope/}Client.InvalidCustomerAppId",
"faultstring": "Field CustomerAppId is invalid",
"detail": {
"StackTrace": [
"com.sabre.universalservices.base.exception.ApplicationException: errors.xml.USG_INVALID_CUSTOMER_APP_ID"
]
}
},
"Links": [
{
"rel": "self",
"href": "https://api.sabre.com/v1.0.0/shop/hotels/content?mode=content"
},
{
"rel": "linkTemplate",
"href": "https://api.sabre.com/<version>/shop/hotels/content?mode=<mode>"
}
]
}

google datastore api explorer example

I am trying to understand
https://developers.google.com/apis-explorer/#p/datastore/v1beta1/datastore.datasets.blindWrite
but I always get
503 Service Unavailable
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 503,
"message": "Backend Error"
}
}
Can you provide a example as simple as possible I can paste to verify it actually works?
I tried something like this.
{
"mutation": {
"insertAutoId": [
{
"key": {
"path": [
{
"kind": "person",
"name": "gert"
}
]
}
}
]
}
}
Assuming that you followed one of the first two activation flows described in the documentation. And created the project recently, an App Engine application should be already associated with your project.
You need to:
Click Authorize your request using OAuth 2.0
Leave https://www.googleapis.com/auth/userinfo.email scope checked
Add https://www.googleapis.com/auth/datastore under Add additional scopes (optional)
Click Authorize and grant the permission
Specify the datasetId parameter (same as your project-id)
Use insert or upsert instead of insertAutoId if the key is complete (kind w/ name or id).
Example:
POST https://www.googleapis.com/datastore/v1beta1/datasets/my-dataset-id/blindWrite...
Content-Type: application/json
Authorization: Bearer ...
X-JavaScript-User-Agent: Google APIs Explorer
{
"mutation": {
"insert": [
{
"key": {
"path": [
{
"kind": "Foo",
"name": "iamfoo"
}
]
}
}
]
}
}
200 OK
{
"kind": "datastore#blindWriteResponse",
"mutationResult": {
"indexUpdates": 1
}
}

Resources