Google Calendar API - Event List - FileMaker - api

I am building a Calendar Syncing solution in FileMaker using the Google API
I can add and update events to my selected calendar just fine. Using the INSERT URL:
“https://www.googleapis.com/calendar/v3/calendars/" & $calendar & "/events?access_token="& $accessToken”
and
Curl:
"-X POST
-H \"Content-type: application/json\"
--data " & Quote ( $data )
Now I am trying to PULL a LIST of all Events from a specific calendar using:
https://www.googleapis.com/calendar/v3/calendars/{CalendarID}/events?key={APIKEY}
Now I am trying to PULL a LIST of all Events from a specific calendar using the INSERT URL::
https://www.googleapis.com/calendar/v3/calendars/{CalendarID}/events?key={APIKEY}
CURL
"-X GET
--header 'Accept: application/json'\
In response I get:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
Clearly there is something wrong my query, but despite my best efforts reading the google reference material the answer eludes me. I am new to using API's so any suggestions would be most appreciated

Related

Insert Multiple records in BigQuery using WSO2

I am using BigQuery Connector in WSO2 to insert multiple records in BigQuery cloud.
I followed this link and was able to insert a single record successfully.
First I tried to pass multiple records by separating them using a comma.
However, in this case, only the first record gets inserted and other records are skipped.
Please note that no error is returned in this case.
My Json message with multiple records:
{"insertId":"101","json":{"NAME":"Vishal_101","ADDRESS":"UK","ID":"vbordia"}},{"insertId":"102","json":{"NAME":"Vishal_102","ADDRESS":"UK","ID":"vbordia"}}
Second I tried this link which explain how to build multiple records.
However, this time I get an invalid response from BigQuery. Since the response message is not well explanatory I am unable to understand the cause.-
Messagean :
{
"rows":
[
{
"insertId":"209",
"json":
{
"NAME": "NewRow1",
"ADDRESS": "NewAddr",
"ID": "123"
}
},
{
"insertId":"210",
"json":
{
"NAME": "NewRow2",
"ADDRESS": "NewAddr",
"ID": "123"
}
}
]
}
Error Message Returned from BigQuery :
{
"insertErrors": [
{
"index": 0,
"errors": [
{
"reason": "invalid",
"location": "",
"debugInfo": "",
"message": ""
}
]
}
]
}
Can anyone please help me here.What is the correct way of inserting multiple records in BigQuery via Wso2.
Thanks in advance.
This was a bug in WSO2 Bigquery connector. We have raised with WSO2 and they have now released new version of connector which is capable of inserting multiple records.You can find the latest version at WSO2 market place.
Based on your data I created a test table in my project
And used the API to upload your example data as follow:
curl --request POST \
'https://www.googleapis.com/bigquery/v2/projects/myproject/datasets/dataset/tables/testInsert/insertAll' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"rows":[{"insertId":"z1","json":{"NAME":"Vishal_z1","ADDRESS":"UK","ID":"vbordia"}},{"insertId":"z2","json":{"NAME":"Vishal_z2","ADDRESS":"UK","ID":"vbordia1"}}]}' \
--compressed
using this SELECT:
SELECT * FROM `project.dataset.testInsert` LIMIT 1000
I confirmed the data is in the table:

Can we add multiple labelId in history.list API for gmail?

I want to get the result of all INBOX mails and all SENT mails in one API call using the historyID and the history.list Gmail-API.
Refer:
https://developers.google.com/gmail/api/v1/reference/users/history/list
When I am hitting the following GET request :
https://www.googleapis.com/gmail/v1/users/{userID}/history?startHistoryId={historyID}&labelId=SENT&labelId=INBOX
I only get the SENT label messages.
Seems like the API only accepts single & first query param for labelId.
Is there a way to get multiple labelIds' response in a single API call?
I think it would not be possible, I tried making a multiple request and it this response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid label value in query"
}
],
"code": 400,
"message": "Invalid label value in query"
}
}
I would suggest to call it separately for each labelID but you can try filing a feature request for this.
Hope this helps.

Request unlisted videos from youtube user via php

i'm trying to get unlisted videos from a user authenticated by api key
https://www.googleapis.com/youtube/v3/search?part=snippet&forMine=true&type=video&maxResults=50&key=keyremoved
i receive the error
"error": {
"errors": [
{
"domain": "youtube.search",
"reason": "invalidSearchFilter",
"message": "The request contains an invalid combination of search Note that you must set the \u003ccode\u003etype\u003c/code\u003e parameter to \u003ccode\u003evideo\u003c/code\u003e if you set a value for the \u003ccode\u003eeventType\u003c/code\u003e, \u003ccode\u003evideoCaption\u003c/code\u003e, \u003ccode\u003evideoCategoryId\u003c/code\u003e, \u003ccode\u003evideoDefinition\u003c/code\u003e, \u003ccode\u003evideoDimension\u003c/code\u003e, \u003ccode\u003evideoDuration\u003c/code\u003e, \u003ccode\u003evideoEmbeddable\u003c/code\u003e, \u003ccode\u003evideoLicense\u003c/code\u003e, \u003ccode\u003evideoSyndicated\u003c/code\u003e, or \u003ccode\u003evideoType\u003c/code\u003e parameters.",
as you can see my get request contains a type=video parameter.
When i try https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&forMine=true&maxResults=50&type=video
with logged in the youtube account using oauth2 it works fine
You can't use an API key for the forMine parameter.
You need to send an authorized OAuth2 request for it to work.
$ curl --header "Authorization: Bearer <YOUR_ACCESS_TOKEN>" https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&forMine=true&maxResults=50
{
"kind": "youtube#searchListResponse",
"etag": ...
https://developers.google.com/youtube/v3/docs/search/list#forMine

Fusion table API, INSERT query, bad request

I have a fusion table with fields: username, description,latitude,longitud,geolocation. I am trying to create a new row with information via the google API. I triple checked that the fusion table is open, the tableid and the apikey are correct, and I have the fusiontable API enabled with 0% of the quota. I think the wrong request must be because some coma or quotation mark but to be honest it completely escapes me. I have tried different combinations and cannot find the mistake. Below error that I get, the code that use in php to generate the link and the link itself. Any idea would be greatly appreciated.
Thank you
link returns:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
Php Code:
$apikey = "AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA";
$tableid = "1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03";
$username="webuser";
$description="nujkn";
$latitude="78";
$longitud="110";
$geolocation="98.8789, 150.1111";
$link = "https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+".$tableid."+(username,description,latitude,longitud,geolocation)+VALUES+('".$username."','".$description."','".$latitude."','".$longitud."','".$geolocation."')&key={".$apikey."}";
Link generated: https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+('webuser','nujkn','78','110','98.8789')&key={AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}
which in browser looks like: https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+(%27webuser%27,%27nujkn%27,%2778%27,%27110%27,%2798.8789%27)&key={AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}

How to list only assignable video categories youtube v3?

Using v2 of the API via: http://gdata.youtube.com/schemas/2007/categories.cat, I can see both assignable and deprecated video categories.
However, using the v3 google data API, I see all categories, but no flag indicating if they are usable as a category on a video upload. Case in point is the category labelled "Anime/Animation" (category 31). If you try to upload a video using this category, you will receive a "Bad Request" response from YT at the end of the upload process.
If you choose any of the categories in the "assignable" list as per the first URL, then the upload works. Here's a deprecated category using the Atom based API:
<atom:category term="Movies_anime_animation" label="Anime/Animation" xml:lang="en-US">
<yt:deprecated/>
</atom:category>
Here's the same thing, in JSON, from the Google API Explorer:
{
"id": "31",
"kind": "youtube#videoCategory",
"etag": "\"g-RLCMLrfPIk8n3AxYYPPliWWoo/-p_eJg3ji5PiNMcZrzS4hNfl4gQ\"",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Anime/Animation"
}
I've looked at the video.list v3 API docs, and also the raw JSON output from the same API. I can't see how I could differentiate between deprecated and assignable categories. Is this just plain missing from the API or have I missed something?
You can receive the list of assignable categories parsing XML document. This is an example on PHP:
$catURL = 'http://gdata.youtube.com/schemas/2007/categories.cat';
$cxml = simplexml_load_file($catURL);
$cxml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');
$result = $cxml->xpath('//atom:category/yt:assignable/..');
$categories = array();
foreach ($result as $row) $categories[(string)$row['term']] = (string)$row['label'];
For anyone who stumbles upon this question: YouTube V3 API now returns an assignable flag with each category snippet.
Request
curl \
'https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&regionCode=NL&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
Response
{
"kind": "youtube#videoCategory",
"etag": "7mqChSJogdF3hSIL-88BfDE-W8M",
"id": "17",
"snippet": {
"title": "Sports",
"assignable": true,
"channelId": "UCBR8-60-B28hp2BmDPdntcQ"
}
}