I am trying to create a webhook for Autodesk BIM 360 project and ended with this error - "Access denied for the scope that you are trying to create hook on". I am using Postman to test the webhook creation - Here is the response which I am getting -
{
"hooks": [],
"errors": [
{
"id": "071ec72d-20b5-40c1-9451-ee9cdf573984",
"status": 403,
"code": "FORBIDDEN_ERROR",
"detail": [
"Access denied for the scope <projectId> that you are trying to create hook on"
],
"source": {
"sysType": "adsk.wipprod",
"eventType": "fs.file.added",
"callbackUrl": "http://6bd04cad.ngrok.io/webhooks/bim360",
"scope": {
"folder": "<projectId>"
},
"hookAttribute": null
}
}
]
}
What are the scopes you are passing on, did you follow this tutorial? Has the trial been activated for your keys?
https://developer.autodesk.com/en/docs/webhooks/v1/tutorials/create-a-hook-data-management/
I was facing this issue due to having old forge application which didn't configure the Webhook. Now I have enabled it and it's fixed.
Now I am facing a different issue which is related to access denied. Here is the detail -
creating a Webhook for BIM 360 docs using Autodesk forge custom integration. I am following this Webhook API documentation https://developer.autodesk.com/en/docs/webhooks/v1/reference/http/systems-system-events-event-hooks-POST/ and am constantly getting this response.
{
“id”: “888134c7-fd22-4676-b907-d8441477dde4",
“status”: 403,
“code”: “FORBIDDEN_ERROR”,
“detail”: [
“Access denied for the scope b.2210c698-4e4b-47d0-b579-f92a969ef365 that you are trying to create hook on”
]
}
From your question, it seems that you used the projectId or hubId, make sure to use folderId as the scope, it should be similar to urn:adsk.wipprod:fs.folder:abcd1234
Related
A webhook call fails, how do I see the detailed logs?
The testing webhooks page describes that the errors are put in output.webhook_error.<result_variable>. For example if your result variable is webhook_result_1 then the output is in output.webhook_error.webhook_result_1.
As described in the documentation, if an error happens then in the "Assistant responds" section of the dialog node editor, the "If assistant recognizes" anything_else should be used, so you can put in there The callout generated this error: <? output.webhook_error.webhook_result_1 ?>..
This will show more information. For example if I configure an API to throw an Error, I will get back:
The callout generated this error: {"response_code":400,"message":"Webhook call was not successful. Response code is [400].","response_body":{"code":"cff11d18150e8018d5e304ac3fc35c94","error":"There was an error processing your request."},"content_type":"application/json"}.
If this error happens when the Bot is being used live, then in the logs the webhook response body will be captured. If you use the Try It Out panel in the UI then the logs are not captured.
In the Assistant UI for the Skill in the Analytics tab the conversation is shown. In the "User conversations" part of the UI the text of the conversation is captured, but you will only see the webhooks error if you add output as described above.
The API can be used to fetch logs for a workspace or skill which include the webhook error details. See List Log Events in a Workspace. If you are using a Skill then you can find out the URL to use from the Assistant UI. On the Skills list page, on the particular skill click the ... menu and select View API Details. The Legacy v1 workspace URL: shows the workspace ID to use.
For example if the Legacy v1 workspace URL: is https://gateway.watsonplatform.net/assistant/api/v1/workspaces/ce13f844-c3a7-4f36-97c6-a0ac704024a6/message the URL to use to fetch logs is https://gateway.watsonplatform.net/assistant/api/v1/workspaces/ce13f844-c3a7-4f36-97c6-a0ac704024a6/logs?version=2020-04-01
In the workspace log there will be the details of the user conversation where a webhook error happened in webhook_error:
"output": {
"generic": [
{
"response_type": "text",
"text": ""
},
{
"response_type": "text",
"text": "The callout generated this error: {\"response_code\":400,\"message\":\"Webhook call was not successful. Response code is [400].\",\"response_body\":{\"code\":\"cff11d18150e8018d5e304ac3fc35c94\",\"error\":\"There was an error processing your request.\"},\"content_type\":\"application/json\"}."
},
{
"response_type": "text",
"text": "Customer email is <? context.webhook_result_1.message ?>."
}
],
"text": [
"",
"The callout generated this error: {\"response_code\":400,\"message\":\"Webhook call was not successful. Response code is [400].\",\"response_body\":{\"code\":\"cff11d18150e8018d5e304ac3fc35c94\",\"error\":\"There was an error processing your request.\"},\"content_type\":\"application/json\"}.",
"Customer email is <? context.webhook_result_1.message ?>."
],
"nodes_visited": [
"slot_2_1520179906877",
"handler_3_1520179906877",
"node_1_1520179877410",
"node_9_1530805081298",
"response_5_1604940050659",
"node_7_1520180645829"
],
"webhook_error": {
"webhook_result_1": {
"response_code": 400,
"message": "Webhook call was not successful. Response code is [400].",
"response_body": {
"code": "cff11d18150e8018d5e304ac3fc35c94",
"error": "There was an error processing your request."
},
"content_type": "application/json"
}
},
"nodes_visited_details": [
Question: how to remove an application logo.
Solution: previous solution from this answer, https://stackoverflow.com/a/57168008/1992004, is no longer working.
Google changed the format of "iconUrl" to "icon", and uses now the Base64-encoded data stream, like "icon":"iVBORw0KGgoAAAAN..., instead of the image URL, previously written as "iconUrl":"https://...".
I've tried "icon":"" and many Base64-encoded values like "icon":"IA", "icon":"Lw", and some of other - no success. I get console messages like
for "icon":""
{
"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=UpdateIconRequest.icon&error_field_value=%3CByteString#3eeee81e+size%3D0+contents%3D%22%22%3E"
}
]
}
]
}
}
or
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.identity.clientauthconfig.v1.ClientAuthConfigError",
"code": "ICON_STORAGE_FAILURE"
},
{
"#type": "type.googleapis.com/google.identity.clientauthconfig.v1.IconStorageError",
"reason": "INVALID_IMAGE"
}
]
}
}
or
{
"error": {
"code": 400,
"message": "Invalid value at 'icon' (TYPE_BYTES), Base64 decoding failed for \" \"",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "icon",
"description": "Invalid value at 'icon' (TYPE_BYTES), Base64 decoding failed for \" \""
}
]
}
]
}
}
Does somebody know, what should be inserted here to remove the logo image from the app?
Answer:
Unfortunately, there is no way for this to be done.
More Information:
Once an OAuth Application Logo has been uploaded there isn't a supported way of removing it - in the question that you linked the way that this was done is a bit hacky, inspecting the network requests and building a new request from the previous JSON object sent via the UI really shows this.
As the icon URL has changed to need a Base-64 encoded value this has been deprecated. Whether this was intentional by Google or not is hard to say, but now an empty value will always return INVALID_ARGUMENT. Any data in the value for icon will also just replace the image data and so this isn't a viable workaround, as as far as the validation process goes, image data exists and so will need to be verified.
If it's not too much of a arduous process, the only workaround here is to create a new GCP project with a new OAuth consent screen without uploading an image. Of course, you will need to reactivate all the relevant APIs and link the relevant scripts and projects to the new set-up.
Feature Request:
You can however let Google know that this is a feature that is important and that you would like to request they implement it. Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services. I would suggest using the feature request template for G Suite Add-ons as this is a component for which GCP Projects could be used.
Update: The feature request for this is viewable here, to increase visibility on this, hit the ☆ at the top of the page.
Relevant Questions:
OAuth consent screen - ability to remove application logo [Obsolete]
May 2021 - It is still possible to completely delete the consent screen (and thus allowing to create it again). See my updated answer in https://stackoverflow.com/a/57168008/1992004
When looking at the API documentation, it states it should be able to set a query parameter: includePathInProject. Using that, the relative path should be included in the response.
includePathInProject
Specify whether to return pathInProject attribute in response for BIM 360 Docs projects. pathInProject is the relative path of the item starting from project’s root folder.
true: response will include pathInProject attribute for BIM 360 Docs projects.
false (default): response will not include pathInProject attribute for BIM 360 Docs projects.
However, when I try this in Postman, I get this message:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "34a40e9d-2db2-4a32-ac9a-fc0642207266",
"status": "400",
"code": "FUNCTION_NOT_SUPPORTED",
"detail": "A360 currently does not support query parameter includePathInProject."
}
]
}
This is the request URL I'm using:
https://developer.api.autodesk.com/data/v1/projects/:project_id/items/:item_id?includePathInProject=true
project_id: a.Yna[...]zgx
item_id: urn:adsk.wipprod:dm.lineage:0P0E[...]l5A
Is there any other way or workaround to get the path of a document?
It seems that you're trying to use it for A360 projects, I see an a. prefix on your project id. This parameter applies to BIM 360 only.
Is it possible to subscribe to changes of MailboxSettings - specifically AutomaticRepliesSetting?
Trying to POST this to /subscriptions on the beta API.
{
"changeType":"updated",
"notificationUrl":"https://example.com/microsoft/notify",
"resource":"users/karel#example.com/mailboxSettings",
"expirationDateTime":"2018-05-11T08:05:26.6920740Z",
"clientState":"QUUvRXJ5beHI9VEvn6hq"
}
Getting back:
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]"
The application has admin consent for Calendars.ReadWrite, User.Read.All and MailboxSettings.ReadWrite
I can successfully subscribe to calendar changes, so nothing is wrong with the implementation.
Subscribing to the root /users/karel#example.com endpoint gives:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: InternalServerError; Reason: Internal Server Error]",
"innerError": { "request-id": "3caffc72-9507-4bb7-9eab-56e8ecaaab83", "date": "2018-05-08T09:22:16" }
}
}
This isn't supported. From the documentation:
Using the Microsoft Graph REST API, an app can subscribe to changes on the following resources:
Messages
Events
Contacts
Users
Groups
Group conversations
Content shared on OneDrive including drives associated with SharePoint sites
User's personal OneDrive folders
I am developing a Fuel chatbot that gets file's content from Google drive to build gallery.
I am using JSON API (Fuel chatbot) to get the JSON response.
My file in drive: https://drive.google.com/file/d/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/view
I want to get JSON response like:
{
"messages": [
{
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[
{
"title":"Classic White T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item100-thumb.png",
"subtitle":"Soft white cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=100",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=100",
"title":"Buy Item"
}
]
},
{
"title":"Classic Grey T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item101-thumb.png",
"subtitle":"Soft gray cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=101",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=101",
"title":"Buy Item"
}
]
}
]
}
}
}
]
}
I tried to get the content of the file by URL:
https://www.googleapis.com/drive/v3/files/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/export?mimeType=application/vnd.google-apps.file
But I got the response
Do you have any suggestion to get the JSON response ?
Consider this documentation and test again.
Your error is:
403: Daily Limit Exceeded
The Courtesy API limit for your project has been reached.
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "Daily Limit Exceeded"
}
],
"code": 403,
"message": "Daily Limit Exceeded"
}
}
Suggested action: Request additional quota.
Based from the SO post, you may do the following to get rid of your error.
Create a Google APIs Console project
On the Services pane, enable all of the APIs that your project requires.
On the API Access pane, click Create an OAuth 2.0 client ID. A dialog opens. Fill in your project's information. Click
Next
Choose the appropriate application type. Based on the tags you used for this post, I am guessing this is an iOS project so select
Installed application.
Enter your bundle ID. You don't need to enter an App Store ID until your app is listed there.
Click Create Client ID.
You will see the client ID and client secret values. You will use
these values to enable communication with your project and the Google
APIs.
If you aren't already using it, see the Google+ iOS SDK and
documentation for a full walk through. The task called "write
moments" is similar in implementation and demonstrates how to connect
to and use the Google+ REST APIs from within an iOS project that uses
the SDK.
You'll need to specify the scope of plus.me to get the profile
information.
Hope this helps.