Using webhooks on dialogflow to Azure logic apps - webhooks

Hi I want to use webhooks on Dialogflow to pass data to Azure logic apps(Http Request). I need your help since this isnt working well somehow.
Here is my settings.
Then, following message is returned.
"webhookStatus": {
"code": 16,
"message": "Webhook call failed. Error: 401 Unauthorized"
If I try same command on RestAPI Testing(Chrome Extention), it succeed.
What Shal I fix? Thank you for your help!

The problem is url Azure logicapp encoding.
You have to trasform url %2F to /
You have to do this change sp param
https://prod.zone.logic.azure.com:443/workflows/XXXXXXX/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=XXXX_XXXXX
https://prod.zone.logic.azure.com:443/workflows/XXXXXXX/triggers/manual/paths/invoke?api-version=2016-10-01&sp=/triggers/manual/run&sv=1.0&sig=XXXX_XXXXX
So You can use Azure Api Management. if you do not want to traform the url
Aldo Flores
#alduar

Dialogflow's fulfillment webhook requires that your endpoint be "publicly accessible". If your webhook endpoint requires basic authentication or certian HTTP headers to be present you can configure them in Dialogflow's console where you enter your webhook URL:
If your endpoint has other access restrictions (IP filtering, etc.) you'll need to disable them for Dialogflow to be able to access your endpoint.
Source: https://dialogflow.com/docs/fulfillment#requirements

Related

azure data factory BlobEventsTrigger : set "advanced filter" programatically

I am trying to set "advanced filter" of BlobEventsTrigger programmatically.
They are reset at each deployment. I need only 3 and having 7 of them are causing the job to start twice. It is super annoying to delete them manually after each deployment.
I have tried to add a field "advancedFilters" or "blobType" to the trigger json file without success.
"typeProperties": {
"blobPathBeginsWith": "/bingofile/blobs/",
"blobPathEndsWith": "/_SUCCESS",
"ignoreEmptyBlobs": false,
"scope": "/subscriptions/bingofilesup/resourceGroups/bingofilesup/providers/Microsoft.Storage/storageAccounts/bingofilesup",
"events": [
"Microsoft.Storage.BlobCreated"
]
I've also tried az eventgrid system-topic event-subscription update but this library does not work when it comes to updating advanced filter. It asks an endpoint (which is normally a facultative argument) , and when provided the existing data factory endpoint, it fails reaching it.
I have checked the documentation about this endpoint and it is said to be the webhook endpoint .
Endpoint where EventGrid should deliver events matching this event
subscription. For webhook endpoint type, this should be the
corresponding webhook URL. For other endpoint types, this should be
the Azure resource identifier of the endpoint. It is expected that the
destination endpoint to be already created and available for use
before executing any Event Grid command.
But it does not work .
Deployment failed. Correlation ID:
95e4fab5-163e-48ab-8cb2-b23432516e53. Webhook validation handshake
failed for [webwook end point provided in the topic]. Http POST
request failed with response code Unknown. For troublehooting, visit
https://aka.ms/esvalidation.
Any observation or suggestion would be great, thanks in advance !
According to my test, the endpoint https://pmeastasia.svc.datafactory.azure.com:4443/triggerevent/BlobEventsTrigger/<> is juts a base URL. When the events are sent to data factory or update subscription, azure will generate an endpoint with the base URL to do auth. So if you want to update the subscription with other tools, I think you need to use fildder to catch the request to get the whole endpoint at first.

Getting 401/404 errors with Microsoft Azure Cognitive Services API

I followed the directions from https://learn.microsoft.com/en-us/rest/api/computervision/3.1/describeimage/describeimage but each time I fill in my endpoint, as https://[resource_name].cognitiveservices.azure.com or https://southcentralus.api.cognitive.microsot.com, I get a 404 or 401 error, respectively. I've checked to make sure the image url I specify works and loads fine withOUT a 404. Can anyone help?
You can use both hosts below to send request:
https://<your service name>.cognitiveservices.azure.com
https://<your service loaction>.api.cognitive.microsoft.com
You can find all of then on Azure Portal=>Cognitive services=>your service =>Keys and Endpoint:
You should involve key as request header:Ocp-Apim-Subscription-Key to avoid 401 error just as below:
Let me know if you have any more questions.

LinkedIn V2 API return not found when called from Azure API Management

I am trying to call LinkedIn V2 API from Azure API Management, specifically the ugcPost API:
https://api.linkedin.com/v2/ugcPosts
When the ugcPost API is called from our personal computer, the API is able to return the response successfully. However, when we attempt to call the ugcPost from Azure API Management, it responds back with status 404 (Resource not found).
{
"serviceErrorCode": 0,
"message": "Resource ugcPosts does not exist",
"status": 404
}
Has anyone faced similar issue? Is there something in the LinkedIn Developer portal that we have to tweak for this to work?
Apparently, it is an issue with the URL configuration that somehow append my base API URL causing the final URL to be incorrect (e.g. https://api.linkedin.com/v2/ugcPosts/v2/ugcPosts).
After some URL reconfiguration, it is working fine now.

Error 401 (Unauthenticated) when making a request to Google Docs API

I'm trying to request the contents of a Google doc (that I own) using the Google Docs API and the contents would be read to a website. I'm making the following request in Postman:
GET https://docs.googleapis.com/v1/documents/{documentId}?key=API_KEY
where the API_KEY is a key created in Google developer dashboard and is not restricted for now. However, I'm getting the following error:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
I have made the doc public (read-access without signing in) and enabled the Docs API in the Google developer dashboard. Further, the dashboard is registering these (failing) requests, so something is going through.The answer is probably in the error message, but to me "or other valid authentication credential" means the API key that I'm already using.
I'm asking for advice on how to make this request successfully without needing to use OAuth or server-side code.
I found a workaround answer to my problem, although it didn't solve the problem with the Docs API. I decided to request the text data from a Google Sheet instead, which works fine with
GET https://sheets.googleapis.com/v4/spreadsheets/documentId?key=API_KEY
when the sheet is public and read-only.
Yes you can open the doc programatically using a service account. You need to "share" the doc with the service account email.
Instructions on creating a service account and reading a Google doc: https://www.futurice.com/blog/read-goog-doc-using-service-account

Square Webhook API Error "Client does not exist"

I have enabled webhooks for my application, and am attempting to make the PUT request for the events I am interested in.
The response I get is a 404 with this body:
{
"type": "not_found",
"message": "Client does not exist"
}
I have attempted to issue a GET and the result is the same.
Endpoints I have tried include:
https://connect.squareup.com/v1/me/webhooks
https://connect.squareup.com/v1/BP0C3P3DS975P/webhooks
All other v1 and v2 API endpoints seem to be working.
The merchant authorized the application with these scopes: MERCHANT_PROFILE_READ PAYMENTS_READ SETTLEMENTS_READ BANK_ACCOUNTS_READ CUSTOMERS_READ ORDERS_READ
I think I've looked through the docs very carefully, but I can't seem to figure this one out.
Webhooks are enabled on a per-app basis. Please confirm you have enabled Webhooks for this specific application:
Webhooks Configuration
Also, you should submit API requests to the location-specific endpoint: /v1/{location_id}/webhooks

Resources