How to consume Dialogflow small talk APIs in a HTML5 app? - google-api

I have a chat bot that is deployed in SAP Cloud Platform which answers using an NLP.
I want to integrate Dialogflow small talk with it using APIs.
I have created a project in Dialogflow and able to use small talk. However, I need APIs to call this small talk in a HTML5 applicaiton.
Is it possible to use small talk using APIs or is it only available with Dialogflow and if APIs are available, How to consume them?
I have tried dialogflow.projects.getAgent in Google API Explorer which gives me response but in postman I am getting following error as I am unable to generate API Key:
Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential
Please help.
Thanks

Looks like you have two questions:
How do you properly authenticate a Dialogflow v2 API request
there are two versions of Dialogflow's API: v1 and the v2 beta.
You might consider using the v1 API if you're having trouble using the v2 API as it uses much simpler client and developer access tokens. If you'd like to use v2 though, see Dialogflow's v2 authentication guide.
is there a way to get a Dialogflow agent's response via an API call
there is an API to query a Dialogflow agent and get a response back. In Dialogflow's v2 API its called detectIntent and for v1 its called query

Related

How to get the get API path and parameters of Google play developer API?

I have added a non-renewable subscription for one of my projects. We also started implementing the Google play developer API to get the subscription latest status from the Play Store. For that we have done the below steps as per this blog:
Linked the developer account to a new Google Cloud Project.
Enabled the Google Play Developer API for the Google Cloud Project.
Created a service account and created a key for the service account.
I have below clarifications related to this implementation:
I tried to Grant Access for the following permissions: But the corresponding checkmark is not clickable.
View financial data, orders, and cancellation survey responses
Manage orders and subscriptions
The 3rd step as per the blog is to Authorize an API key, but I didn't get a clear idea of that.
We are going to implement this API on the back end side as a corn job, do we need to generate a JWT token for accessing this API? Is this possible to call without a Token? I found 2 types of implementations from this blog, which one is easy and secure?
"Your application can complete these tasks either by using the Google APIs client library for your language or by directly interacting with the OAuth 2.0 system using HTTP."
From where we get the get API path and other details. I found a similar get API from AppStore like this. Is the play store providing a similar kind of get API?
We need the latest purchase status API and for that what parameters do we need to pass?

Is it possible to call external web APIs from Slack?

I want to pull some metrics daily posted in my slack channel. these metrics are located in my personal server, and to pull them via rest API a basic authentication is also required.
Does slack support this?in other words can slack do external api call in such way?
and if yes how?
To achieve this, you need to create a custom application(bot).
You can implement your custom business logic and then use slack APIs to post generated data to Slack Client.
https://slack.com/intl/en-in/help/articles/115005265703-Create-a-bot-for-your-workspace

Messaging endpoint of a Microsoft framework BOT

Does the messaging endpoint of bot need to be anonymous?
Any help is greatly appreciated.
If you are using bot framework v4 SDK and when you register a bot in the Azure portal, for example via the Bot Channels Registration, this authentication automatically performed. So, you don't need to explicitly write any code. If you want to restrict the use of bot to users belonging to your tenant you can add authentication to a bot using OAuth. Please go through this documentation for reference.
My understanding is that requests to your /api/messages endpoint include a JWT bearer token issued by the bot framework. The SDK will check this for you.
This appears to be the code where it performs the validation:
https://github.com/microsoft/botbuilder-js/blob/fc5dcc535855cf453b0ebf373121277d824ff840/libraries/botbuilder/src/botFrameworkAdapter.ts#L1180
If you're implementing without the SDK, then you will need to do the JWT verification.

Google integration in web application

I want to integrate gmail and google calendar in my web application. I can login via google and make api calls to either gmail OR google calendar API, depending on the authorisation that I request from google.
I have not found a way to request authorisation for more than one APIs simultaneously. Is this even possible? Is it possible to receive one access token in order to use it for requests against more than one of Google's APIs?
As far as I know it can be done. If you try testing it in Google Oauth 2.0 Playground and select multiple API scopes.
"scope": "https://www.googleapis.com/auth/calendar https://mail.google.com/ https://www.googleapis.com/auth/drive"
It should look like this:
Hope this helps.

Parse.com Stripe Integration - Obtaining credit card token

I'm currently building a mobile application using Ionic framework, with Parse as a back end. I'm now looking into creating a Stripe customer via Parse's Cloud Code for subscriptions, and i've found the brief documentation on Parse's site.
For obtaining the Credit Card Token, the docs refer to using the Stripe's REST API docs, but I would've assumed parse's Stripe integration would provide a method to perform this.
How can I obtain a token? Thank you.

Resources