According to https://developers.google.com/drive/api/v3/reference/changes/watch,
you need an https address to make it works if you need to watch over a change of resources.
I've configured the domain successfully by going to Google Cloud Console > Domain Verification > Add Domain.
Then I use Postman to make a call to test it:
https://www.googleapis.com/drive/v3/changes/watch?pageToken=nextPageToken
{
// "kind": "api#channel",
"id": "1234231",
"expiration": 1656402233000,
"type": "webhook",
"payload": true,
"address": "https://mrnoc.blogspot.com",
"params": {
"pageToken": "nextPageToken"
}
}
However, it failed and generated this error message:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://mrnoc.blogspot.com"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://mrnoc.blogspot.com"
}
}
I have no idea how it doesn't work, I've tried to look around but it a dead end as it seems like I've configured everything properly.
Please help if you know what might stop it from working.
Thank you
Related
I have an existing client-id (Web) with some working UIDs, I added a time ago. I now wanted to add one more and when I press the save button it just does not work (ProgressIndicator is spinning infinitely). I have a working internet connection and tried with several browsers (Safari,Chrome).
Has anyone seen this?
Edit:
I just tried again with it. I got this error in the web console:
{
"error": {
"code": 400,
"message": "The request failed because one of the field of the resource is invalid.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "client_auth_config",
"subject": "?error_code=9&error_field_name=pending_domains&error_field_value=test-page.web.app"
}
]
}
]
}
}
When I added a domain that ended in .firebaseapp.com, everything worked. Since the domain I want to use ends in .web.app, I have a problem with this though.
We have a hybrid Exchange deployment. Trying to create a subscription to get updates, creates, deletes on Calendar and Contacts.
In Graph Explorer I'm logged in as an Office 365 user that has full access to the On-Premise mailbox I'm trying to access (user#domain.com). I'm entering:
POST | v1.0 | https://graph.microsoft.com/v1.0/subscriptions
Request Body:
{
"changeType": "updated",
"notificationUrl": "https://our.URL/WebHooks/Graph/GraphMessagesHook.php",
"resource": "users/user#domain.com/contacts",
"expirationDateTime": "2018-10-23T04:00:00Z",
"clientState": "secret"
}
Response is:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]",
"innerError": {
"request-id": "981c0892-e6d8-490b-838d-880d8268037f",
"date": "2018-10-20T20:32:07"
}
}
}
As a test, I created another user in Office 365 and did the same request body:
{
"changeType": "updated",
"notificationUrl": "https://our.URL/WebHooks/Graph/GraphMessagesHook.php",
"resource": "users/userOn365#domain.com/contacts",
"expirationDateTime": "2018-10-23T04:00:00Z",
"clientState": "secret"
}
This time instead of a 404 NotFound, I got a 403:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]",
"innerError": {
"request-id": "1f378cf0-b1ec-4b87-ba03-8dee120b748b",
"date": "2018-10-21T20:42:46"
}
}
}
What am I missing?
The Microsoft Graph API for on premise mailboxes is only a subset of the cloud functionality.
Don’t think they implemented subscriptions for on-premise mailboxes. That would be pretty resource intensive on both sides.
To my knowledge they just proxy the request to your local Exchange (which is configured to accept the Azure tokens). For rest calls that is easy, for subscriptions the routing would be difficult.
I want to limit the capabilities of a file in personal Google Drive. When I use the API explorer Google Drive v3 API with the following request:
POST https://www.googleapis.com/drive/v3/files?key={YOUR_API_KEY}
{
"capabilities": {
"canCopy": false
},
"name": "testfile"
}
I get the following response:
403
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "fieldNotWritable",
"message": "The resource body includes fields which are not directly writable."
}
],
"code": 403,
"message": "The resource body includes fields which are not directly writable."
}
}
Which is the same response that I get when trying to update a file with:
PATCH https://www.googleapis.com/drive/v3/files/FileIdHere?key={YOUR_API_KEY}
{
"capabilities": {
"canCopy": false
}
}
It seems that there are no methods to accomplish this or has anyone a workaround?
If you check file resource you will notice that some fields are writeable while others are not.
The message you are seeing is because the field you are trying to set is not writeable this means you can not change it from the API
I'm trying to access oneDrive via Graph api, and when I hit the api, I get User's mysite not found.
GET https://graph.microsoft.com/beta/me/drive
{
"error": {
"code": "ResourceNotFound",
"message": "User's mysite not found.",
"innerError": {
"request-id": "13eb583d-c29a-42af-8868-bae06d554538",
"date": "2018-05-18T06:06:55"
}
}
}
So, looking out for the solution, I saw an issue where they said to get OneDrive for Business' location, But this returns UnauthorizedAccessException
GET https://graph.microsoft.com/beta/me?select=mySite
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message":
"Access denied. You do not have permission to perform this action or access this resource.",
"innerError": {
"request-id": "3489894e-faa0-42c6-9f3b-e76c4708ce15",
"date": "2018-05-18T06:10:00"
}
}
}
And when I hit for /me endpoint, there I see an empty array for provisionedPlans.
GET https://graph.microsoft.com/beta/me
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users/$entity",
"id": "7e8397a6-b299-34a2-af06-d3487t5b5174",
//...
"onPremisesProvisioningErrors": [],
"provisionedPlans": []
}
My access token is
eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFBQUFEWDhHQ2k2SnM2U0s4MlRzRDJQYjdySGc5dDJ4SmxkODFMRURNY1FuN3pMYVgyektLaDR2SF9FSFltd1JaQ3Y5TU55VDJOR250VmlDQVFmTXpiTWxoYkZWQ19nSEdtaWhfWlJfcVlpaGRyMHlBQSIsImFsZyI6IlJTMjU2IiwieDV0IjoiaUJqTDFSY3F6aGl5NGZweEl4ZFpxb2hNMllrIiwia2lkIjoiaUJqTDFSY3F6aGl5NGZweEl4ZFpxb2hNMllrIn0.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20vIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvM2FjMThiOGMtNjY4ZC00NzBhLWJhMDctYWU0MjdlMTkwZGEyLyIsImlhdCI6MTUyNzE0MDg2MCwibmJmIjoxNTI3MTQwODYwLCJleHAiOjE1MjcxNDQ3NjAsImFjciI6IjEiLCJhaW8iOiJBVFFBeS84SEFBQUE4UitBY2U4bnpGU0JXRGg4NUFHUWE1VXowT05yZEZ5VzhXQnYvZ1BnVE1nMW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s24ItQIIPBEZj93Go5z0QowyZCy-msAw7-heGu7yQZrppuvBfv-rrAS1bvFw_aBDBALzX7rlHwsiU9KaEzrRdzUgc9lciDhuGsPZddGEZrSpTuhBPvLa-xI8_1bLMhSChLECU63rMnBYHZJesenWqPL0w1DsmkUHeR01Ff7l8pgsH3jemRK2NAr4LD-wyQrumJxz2h45luO9dICqPOGjI9hwrjNpSDJnhienDkUsrcOA2ijnWglCJ3GRN9RfrJ93osCaO3WpUoTIy66NApYR__YDGzO4HsTk_MA9OSQCHcw5mOaOeRKZmRTDPIokyYpeNgXBK9FmZivBg
Can't figure out that it is a access problem or provisioning problem. Can anyone suggest what's going wrong here.
I'm using Google CustomSearch API v1 for image search but I have a problem with my JSON request.
When I filled out the search.cse.list (here) I got the JSON request like this:
GET https://www.googleapis.com/customsearch/v1?q=test&cref=AIzaSyAreDhTh3IqaGPqC44t08sQF_qbSGzzA7Q&cx=010855067127206535986%3Aqdh_vhglb4u&fileType=jpg&filter=1&imgSize=medium&imgType=news&num=4&searchType=image&start=1&key={YOUR_API_KEY}
And the response of this request:
{
"kind": "customsearch#search",
"url": {
"type": "application/json",
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
},
"queries": {
...
},
"context": {
...
},
"searchInformation": {
...
},
"items": [
{
"kind": "customsearch#result",
"title": "free student testing cartoons | Home > Clipart > Cartoons ...",
"htmlTitle": "free student <b>testing</b> cartoons | Home > Clipart > Cartoons <b>...</b>",
"link": "https://s-media-cache-ak0.pinimg.com/236x/30/0c/a5/300ca57d460ab787202e36bdf0364e57.jpg",
"displayLink": "www.pinterest.com",
"snippet": "free student testing cartoons",
"htmlSnippet": "free student <b>testing</b> cartoons",
"mime": "image/jpeg",
"image": {
"contextLink": "https://www.pinterest.com/pin/568157309212095926/",
"height": 213,
"width": 236,
"byteSize": 14426,
"thumbnailLink": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQ-JefdKWd1WZkuesaq01zldYRW2JmYd_z0cW0SF9OEXFMVr6M8XZO4kg",
"thumbnailHeight": 98,
"thumbnailWidth": 109
}
},
But when I tried to use this request at the browser bar I got an error:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}
}
I guess that I should use Ajax call, but I dont know how can I do it, because I am beginner.
I also made an API Key, "cx" and have enabled CustomSearch API at my console.developer account.
So the question is: How can I get values from this JSON request and then operate with them if I even cant get values in my browser? I want to get an image-link from this request.
Sorry for my English.
The Google Image Search API was deprecated in 2011, and has finally, now, been switched off :( You'll have to find something else to use, sorry :(