Since today I have problem with one of 2 similar calls to Google Calendar API v3:
calendar.events.list
Both calls are requesting list of assignemnts and use privateExtendedProperty to filter them, but key=Value pairs are different.
When I have privateExtendedProperty set to myStatus=READY it returns events I need,
but when I set privateExtendedProperty to myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM
it returns no events, though I'm sure there are several events with this myId...
It appears that the calendar API list is returning an empty list when querying by a privateExtendedProperty with 90 characters long.
Everything worked fine for years, but it suddenly broke for some of my users this morning...
This is my request:
GET googleapis.com/calendar/v3/calendars/****/events?privateExtendedProperty=myId%3Dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYwauk6QgM&key={YOUR_API_KEY}
This is the result I see in API explorer:
{
"kind": "calendar#events",
"etag": "\"*****\"",
"summary": "*****",
"description": "*****",
"updated": "2018-02-20T03:18:35.098Z",
"timeZone": "Asia/Tokyo",
"accessRole": "owner",
"defaultReminders": [
],
"nextSyncToken": "CJDv1KDEs9kCEJDv1KDEs9kCGAU=",
"items": [
]
}
Update 1:
My privateExtendedProperty looks like this:
{
"myStatus": "READY",
"myId": "agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM",
"another": "Another value",
"another2": "Another value2"
}
When I query events with "myStatus=READY" - event is returned, but when I do the same with "myId=agxzfm1..." - it returns emtpy list.
Update 2:
For those who have the same issue. As per suggestion, I created a new calendar and then duplicated some test data and tried long value in privateExtendedProperty query and it returned event as expected. It means, if this is a bug - not all calendars are affected and moving things to a new calendar might be a way to go.
The document for Extended Properties says the limitations as follows.
The maximum size of a property's key is 44 characters, and properties with longer keys will be silently dropped.
The maximum size of a property's value is 1024 characters, and properties with longer values will be silently truncated.
An event can have up to 300 shared properties totaling up to 32kB in size (keys size + value size).
An event can have up to 300 private properties, totaling up to 32kB in size (keys size + value size), across all "copies" of the event.
From this, it seems that your case is out of the above limitations. In my environment, also I tried your situation. As the result, it was found that myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM can be used.
So can you confirm the following points again?
It seems that your result retrieved by API explorer doesn't included extendedProperties in the property of items. When you set extendedProperties, it can be seen. If you use fields, it might be not able to be seen.
Can you set extendedProperties with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM again?
You can set it using calendar.events.patch.
When you retrieve events with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM using calendar.events.list, if you use the URL encoded value of myId%3dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM, please try to use the value without URL encode.
If this was not useful for you and I misunderstand your question, I'm sorry.
Edit :
If you retrieve the event using calendar.events.get, can the extendedProperties you set be seen? If you cannot see it, please insert extendedProperties again.
The endpoint is GET https://www.googleapis.com/calendar/v3/calendars/### calendar Id ###/events/### event Id ###?fields=extendedProperties%2Fprivate
In my environment, the same endpoint of yours works fine. So as a test, can you try to create new calendar and run that query? Because I worried whether the recent update of calendar affects this situation.
Related
I'm currently working on a project in which we perform "Nearby" queries for places using keywords, and then we make follow-up "Detail" requests to obtain more information about specific places of interest.
With Google's new pricing model in the works, the documentation warns about the cost of the Nearby search, but the warning seems to imply that the follow-up detail request will no longer be necessary because our original search should give us everything we need:
By default, when a user selects a place, Nearby Search returns all of
the available data fields for the selected place, and you will be
billed accordingly. There is no way to constrain Nearby Search
requests to only return specific fields. To keep from requesting (and
paying for) data that you don't need, use a Find Place request
instead.
However, I'm not seeing this. When I run a sample request, the results from my Nearby request contains only minimal data related to the places Google finds. To get details, I still have to do a follow-up detail request.
Does anyone know if there's something I may be overlooking? I'm including my request URL (sans API key).
https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=xxxxxxxxxx&location=30.7329,-88.081987&radius=5000&keyword=insurance
And this is an example of one of the results I received:
{
"geometry": {
"location": {
"lat": 30.69254,
"lng": -88.0443999
},
"viewport": {
"northeast": {
"lat": 30.69387672989272,
"lng": -88.04309162010728
},
"southwest": {
"lat": 30.69117707010728,
"lng": -88.04579127989273
}
}
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id": "53744cdc03f8a9726593a767424b14f7f8f86049",
"name": "Ann M Hartwell - Aflac Insurance Agent",
"place_id": "ChIJj29KxNZPmogRJovoXjMDpQI",
"plus_code": {
"compound_code": "MXV4+26 Mobile, Alabama",
"global_code": "862HMXV4+26"
},
"reference": "CmRbAAAAcHM1P7KgNiZgVOm1pWojLto9Bqx96h2BkA-IyfN5oAz1-OICsRXiZOgwmwHb-eX7z679eFjpzPzey0brgect1UMsAiyawKpb5NLlgr_Pk8wBJpagRcKQF1VSvEm7Nq6CEhCfR0pM5wiiwpqAE1eE6eCRGhQPJfQWcWllOVQ5e1yVpZYbCsD01w",
"scope": "GOOGLE",
"types": [
"insurance_agency",
"point_of_interest",
"establishment"
],
"vicinity": "70 N Joachim St, Mobile"
}
I thought about deleting this question, but I guess I'll leave it up in case anyone else is confused like I was.
It turns out the extra detail fields I was looking for in the Nearby Search results were there...sort of.
Google's new pricing model categorizes place data fields into three tiers: Basic, Contact, and Atmosphere (Basic data is free, but the other two add to the cost).
As part of these changes, Place API calls have been expanded to allow users to specify the data fields they want so that they don't have to pay for that extra data if they don't need it.
The Nearby Search query, as per the note in the question, includes all the data fields available, and doesn't support a parameter for controlling the data -- it's always going return data that falls into the [Basic + Contact + Atmosphere] bucket.
So far, that's all well and good.
Where things became confusing to me, though, is the specifics of what is included in the different data tiers. I skimmed through these notes several times before I noticed the contents were different.
This is how the fields break down with the Places details request:
Basic
The Basic category includes the following fields: address_component,
adr_address, alt_id, formatted_address, geometry, icon, id, name,
permanently_closed, photo, place_id, plus_code, scope, type, url,
utc_offset, vicinity
Contact
The Contact category includes the following fields:
formatted_phone_number, international_phone_number, opening_hours,
website
Atmosphere
The Atmosphere category includes the following fields: price_level,
rating, review
And this is how it looks for the Places search request:
Basic
The Basic category includes the following fields: formatted_address,
geometry, icon, id, name, permanently_closed, photos, place_id,
plus_code, scope, types
Contact
The Contact category includes the following field: opening_hours
(Place Search returns only open_now; use a Place Details request to
get the full opening_hours results). Atmosphere
The Atmosphere category includes the following fields: price_level,
rating
I haven't found documentation for it, specifically, but the results from a Nearby Search request seems close (but not identical) to the Place search (including Contact and Atmosphere).
I had originally thought the fact that Nearby Search results now include Contact and Atmosphere data (when available), that meant it would contain all the fields itemized as Contact and Atmosphere data in the Place details documentation, but that's not the case.
I've been tasked with updating a legacy Notes application - I'd rather do basically anything else, but such is life. As per the API, I should be able to update a rich text field if the data is in format
FieldName: { contentType: 'text/html', data: newData, type: 'richtext' }
(serialized to JSON, of course)
But what happens is that the original RT field gets replaced by three MIME Part fields (with the same name, containing what you'd expect, "Content-Type: multipart/mixed", "boundary" and so on), and "newData" gets stored in a $FILE attachment. And also few MIME-specific fields get added to the document ($MIMETrack, $NoteHasNativeMIME, MIME_Version).
Now this certainly wouldn't be the first time that Notes documentation doesn't match actual functionality, but I was wondering if anyone has been successfully able to do this? Alternatively, any other way to update an RT field via AJAX (preferably with HTTP PATCH)?
EDIT: upon further inspection, this seems to be a configuration issue. I tried doing a GET from a document with an RT field (that contains the text "testing rt field", submitted via a regular web form), the expected result would be according to the API
"FieldName": {
"contentType":"text/html",
"data":"testing rt field",
"type":"richtext"
}
but instead what is returned is
"FieldName": {
"type":"multipart",
"content": [
{
"contentType":"multipart\/alternative; Boundary=\"0__=4DBB0A82DFA47A268f9e8a93df938690918c4DBB0A82DFA47A26\"",
"contentDisposition":"inline"
},
{
"contentType":"text\/plain; charset=US-ASCII",
"data":"testing rt field",
"boundary":"--0__=4DBB0A82DFA47A268f9e8a93df938690918c4DBB0A82DFA47A26"
},
{
"contentType":"text\/html; charset=US-ASCII",
"contentDisposition":"inline",
"data":"<html><body><font size=\"2\" face=\"sans-serif\">testing rt field<\/font><\/body><\/html>",
"boundary":"--0__=4DBB0A82DFA47A268f9e8a93df938690918c4DBB0A82DFA47A26"
}
]
}
(sorry for the formatting)
So I'm guessing there is a problem with our Domino configuration somewhere. Where, I have no idea, any tips would be greatly appreciated.
In Domino 8.5.3 UP1 the data service represented rich text fields as one HTML part ("type": "richtext" as described in the 8.5.3 doc). This had some severe limitations. For example, you couldn't create a rich text field with embedded images and attachments.
Since Domino 9.0 the data service represents rich text fields as multiple parts ("type": "multipart" as described in the 9.0.1 doc). However, you can still PUT and POST the old rich text format, and you can GET the old format by specifying multipart=false in the URL. In other words, the original poster seems to be using Domino 9.0 and it is working as expected.
We have an internal database ID for each course we have. When using the batch function to create courses, the returned information doesn’t not give us any way to get this ID back so we cannot update our database and let it know that the course has been created.
Also updating the deletion response for the same reason would also be handy.
The response for a batch of deletes looks like:
--batch_123456
{}
--batch_123456
--batch_123456
{}
--batch_123456
--batch_123456
{}
--batch_123456
If they are all successful then it's not really a problem, but if something goes wrong then it's impossible to tell which ones were deleted and which ones were not deleted, because according to the API:
" The server may perform your calls in any order. Don't count on their being executed in the order in which you specified them."
A simple message that said "course #123 has been deleted" would be very helpful. That way I could program the callback code to update the database using the ID
For the course creation the response looks like:
--batch_123456
{
"id": "208571459",
"name": "***",
"section": "***",
"ownerId": "123456",
"creationTime": "2015-09-14T13:13:59.622Z",
"updateTime": "2015-09-14T13:14:02.820Z",
"enrollmentCode": "***",
"courseState": "PROVISIONED",
"alternateLink": "***"
}
--batch_123456
I only put in one response to save space. The ID is the new GoogleID of the course, the ID we actually send in which corresponds to the records in our DB does not get returned. So we have to use a combination of other data (ownerID + name) to get the record and update it, but this is not ideal and may not work fro everyone. Again adding in all of the information that get's sent into the response would be very helpful so we can use the callback properly.
I also want to add the more useful specific information should also be added to all error messages. In fact every batch response should have some sort of ID, that way the callback functions can be more useful.
As mentioned briefly in the documentation, you can pass an alias into Courses.id when creating a course to assign an alias to a course as you create it. The alias can include your internal identifier for the course and can be used in future requests.
Alternatively, each request in a batch can be assigned a unique Content-ID header, which will be returned in the response. Many client libraries provide built-in support for setting and getting these IDs.
I have a bit of a unique problem. I've been reading RestKit docs for days and I'm pretty sure RK can do it, I'm just not sure how to set things up. When I first login my API returns a Contacts JSON that looks like below and I need to load the Group and Team that are referenced but NOT nested. If at all possible, I really need those loads to happen before the CoreData context gets saved.
Is it possible to configure RestKit to recurse these references automatically? If not, any suggestions on a good general approach?
{
"contactid": "003i0000016aiI8AAI",
"signed_waiver": "1",
"current_groupid": "T1Gj6mxcoXposmVUAA",
"current_teamid": "T1Gj6mxcoXposmVU11",
"createdby": "003i000001M4Y6fAAF",
"created": "Fri, 16 Jan 2015 21:14:07 +0000",
"updatedby": "003i0000016aiI8AAI",
"updated": "Sat, 13 Jun 2015 15:13:35 +0000"
}
If the waiver, current_groupid, or current_teamid is not set I need to display an on boarding wizard, if they then I proceed directly into the app which then requires loading details about the group and team (name, geometry, members, etc.). I can't change the server API to nest this structure directly.
I've been able to get my CoreData entity Contact to map and save. I struggled mightily with the current_groupid relationship and finally got it to not crash when I found 1787 and followed its advice. However, it's still getting saved as nil so I'm still doing something wrong...
let mapping = RKEntityMapping(forEntityForName: "Contact", inManagedObjectStore: rkManagedObjectStore)
mapping.identificationAttributes = ["apiID"]
mapping.addAttributeMappingsFromDictionary([
"contactid": "apiID",
"signed_waiver": "signedWaiver",
"current_groupid": "rkCurrentGroupId",
])
mapping.addConnectionForRelationship("currentGroup", connectedBy: ["rkCurrentGroupId": "apiID"])
For clarity, my Contact entity has String attributes for all of the above and a relationship for currentGroup that connects to Group.currentCanvassers.
No, it can't do it. RestKit doesn't automatically trigger any downloads, that's up to your code. RestKit takes your request and encodes it, then handles the response to decode it, performing mapping as required in both cases.
You could trigger automatic downloads in your code handling the completion or, more messily, in some of the other callbacks, but you can't make the save wait for them to complete.
When using the action breakdown to view the offsite conversions:
act_[ACT_NUM]/reportstats?date_preset=last_3_days&increment=1&data_columns=['campaign_group_id','campaign_group_name','actions']&actions_group_by=['action_type','action_target_id']&limit=1000
amongst the response will usually be something like:
...
{
"action_type": "offsite_conversion.lead",
"action_target_id": "[object_id_1]",
"value": 3
},
{
"action_type": "offsite_conversion.other",
"action_target_id": "[object_id_1]",
"value": 1
},
{
"action_type": "offsite_conversion.other",
"action_target_id": "[object_id_2]",
"value": 7
}
...
We've been using the action_target_id to link to conversion pixels by their id and this still mostly works. However the facebook report on conversion pixels seems to have added the action values for stats with the same tag as the conversion pixel but with different action_target_ids. For example the above referenced object_id_1 for the lead stat appears to link to a creative but its value has been added to the total conversions for one of the lead tagged conversion pixels attached to the account. Not sure if it's relevant but this seems to only be happening to multi product ads on the accounts I've looked at.
Anyone have an idea why this might be the case and whether or not it is possible to consistently link the response from the action breakdown in report stats to conversion pixels?