Try to patch TEXT in a Classroom announcements over API - api

I'm not able to change 'text' in an announcements using Google-Classroom API.
When I try to use the PATCH method I have the following error:
{
"error": {
"code": 400,
"message": "updateMask: Non-supported update mask fields specified",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "updateMask",
"description": "Non-supported update mask fields specified"
}
]
}
]
}
}
request and updateMask
I send a updateMask 'text' and a text in request body.
When I try with the updateMask 'state,scheduledTime' I get a successful.
Has anyone ever had this error?
References:
https://developers.google.com/classroom/reference/rest/v1/courses.announcements/patch

I had the same issue. Despite what the documentation seems to indicate (that updateMask can be text), I couldn't get it to work.
I got around it by creating a new post with the information from the announcement, and deleting the old announcement.
This is probably what you did too.

Related

Shopware 6 Admin Api - Updating existing record through patch method. Not working

shopware 6 admin api patch - why it's failing? I get error "Only single write operations are supported"
Following is api for rule-condition entity in the database, I update it with Id.
For same api get method is working!
url: api/rule-condition/dbb0d904c7c14860a9a94cf26b94eca6
method: patch
json body
[
{
"op": "replace",
"path": "/data/attributes/value/email",
"value": "test#gmail.com"
}
]
response:
{
"errors": [
{
"code": "0",
"status": "400",
"title": "Bad Request",
"detail": "Only single write operations are supported. Please send the entities one by one or use the /sync api endpoint.",
.......
I also tried changing json body to following
{
"data": {
"attributes": {
"value": {
"email": "test#gmail.com"
}
}
} }
Still it's not updating. Can somebody check and let me know what am i missing?
Documentation I followed:
https://shopware.stoplight.io/docs/admin-api/ZG9jOjEyMzA4NTQ5-writing-entities
This website has all apis and example methods. https://swagger.docs.fos.gg/,
rule-condition entity can also be found there.
Btw : I used postman for testing api
You're passing an array of objects in the request body, suggesting you want to update multiple records, but the endpoint only supports updating a single record. The correct payload in your case should look like this:
{
"value": {
"operator": "=",
"email": "test#gmail.com"
}
}
Notice that value is a json field and not only includes a single value. The exact content and the names of the properties of value depend on the type of condition used and usually it also includes the operator used in the condition.

Getting GoToWebinar registrant

I'm trying to get registrant info from GoToWebinarApi (api link).
First I'm making a request to get all registrants and getting the following response:
Response body
[
{
"firstName": "Test",
"lastName": "t",
"registrationDate": "2020-06-04T08:46:44Z",
"timeZone": "Europe/Helsinki",
"joinUrl": "https://global.gotowebinar.com/join/7649495216334202379/502991121",
"registrantKey": 6700838782913279000,
"email": "tes#gmail.com",
"status": "APPROVED"
}
]
After that I'm trying to use this registrant key to get registrant info in another query but persistently getting following response:
https://api.getgo.com/G2W/rest/v2/organizers/{{organizer_key}}/webinars/{{webinar_key}}/registrants/{{registrant_key}}
{
"errorCode": "NotFound",
"description": "Registrant with specified key does not exist",
"incident": "3599905930306030349"
}
I don't know what's wrong, maybe it's a bug? It has a lot of stuff like this.
Have you tried downloading Postman and importing their collection? You can just fill in the fields and see if there's any issues. Removing the possibilities you made a mistake in your code.
https://documenter.getpostman.com/view/7571707/SVzw4fq2?version=latest#97d099de-e2b2-413c-96aa-d441d2db80c9
EDIT: Issue/Problem:
I've found the issue. Basically the numbers are too big for Javascript. See: JSON Response Long is Rounded or Corrupted and Large numbers erroneously rounded in JavaScript

Unnable to make Google Cloud Messaging Work

I followed the new tutorial Implementing GCM Client on Android, and I'm unnable to make it work.
I get the token form my device succesfully, and when I send the following message
{
"to": "f19jCbaw-S4:APA91b....",
"notification": {
"body": "body",
"title": "title"
},
"data": {
"message": "test"
}
}
to https://gcm-http.googleapis.com/gcm/send, I get the result:
{
"multicast_id": 844556567...,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1433092445706613%..."
}
]
}
But my app is never entering into the the onMessageReceived of MyGcmListenerService class. The only clue that I have is the following log trace:
6399-6454/com.miapp.app W/GcmNotification﹕ Failed to show notification: Missing icon
I'm duplicated step by step the Google Cloud Messaging Quickstart sample project. Obviusly I use my api key and my sender id... but id does not work, my app never stops in my onMessageReceived method.
Anybody else is having this problem?
In fact the payload without notification should reach the "onMessageReceived" method and work fine, but if the notification is present into the payload, the same error is displayed "Failed to show notification: Missing icon".
I tried to set the icon inside the AndroidManifest.xml (on the both intent-filter, on the receiver), but nothing worked.
If you do not require notification, just remove them from the payload.
And if you need the notification, you need to add another required field inside the notification:
If your icon is inside the mipmap you can add:
"icon" : "ic_launcher"
if your icon is inside the drawable, you should have:
"icon" : "#drawable/ic_myicon"
So your new request would look like:
{
"to": "f19jCbaw-S4:APA91b....",
"notification": {
"body": "body",
"title": "title",
"icon" : "#drawable/ic_myicon"
},
"data": {
"message": "test"
}
}

Foursquare API - Tastes

When I try to send a GET request to Foursquare API below, I get "No matching endpoint." error.
I have validated my tokens and everything seems normal. Any advices?
REQUEST URL
https://api.foursquare.com/v2/users/USER_ID/tastes
RESPONSE MESSAGE
{
"meta": {
"code": 404,
"errorType": "endpoint_error",
"errorDetail": "No matching endpoint"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
}
}
],
"response": {}
}
FoursquareAPI twitter account has told me that I needed to pass m=foursquare in addition to version information.
The correct endpoint information is like
https://api.foursquare.com/v2/users/USER_ID/tastes?oauth_token=TOKEN&v=20150420&m=foursquare
The detailed information about v and m parameters are below.
https://developer.foursquare.com/overview/versioning

Instagram API getting error on UTF-8 characters (tested on /tags/{TAGNAME}/media/recent)

Shamelessly stolen from this ( https://groups.google.com/forum/#!topic/instagram-api-developers/tRfU444ZyhU ) thread as I have the exact same issue and hoping for better responses here.
Long story short, a few hours ago this was working, now it isn't.
The test platform can be found at both from my website and https://apigee.com/console/instagram
Sending https://api.instagram.com/v1/tags/türkiye/media/recent (careful with the "ü")
result: {
"meta": {
"error_type": "OAuthParameterException",
"code": 400,
"error_message": ""client_id" or "access_token" URL parameter missing. This OAuth request requires either a "client_id" or "access_token" URL parameter."
}
}
Sending https://api.instagram.com/v1/tags/turkiye/media/recent (now with "u")
result: {
"pagination": {},
"meta": {},
"data": [
{},
{},
{},
{},.. .. .. ... and so on
Sending https://api.instagram.com/v1/tags/türkiye/media/recent?client_id=7176aa6ef2fd47fd9cb373a5354bd30f ("ü" again and this time manually attached client_id)
result: {
"meta": {
"code": 200
},
"data": {
"media_count": 1471127,
"name": "t"
}
}
This time I'm getting the name as "t". It seems the query is broken just before the "ü" letter which is UTF-8 (Turkish if needed).
This is a bug on Instagram-side. There's an open discussion on Instagram Developers Google group. Although, from what I've seen in my application, the bug now resolve.