IBM Conversation API - What should be a endpoint URL and Parameters - watson-conversation

I try to access IBM conversation using Postman tool but getting 404 (Resource not found) error.
EndPoint : https://gateway.watsonplatform.net/conversation/api/v1/workspaces/883c7704-02c4-41fc-b8a0-aea1d0325c5a/message?version=2016-09-20
my workspace id = 883c7704-02c4-41fc-b8a0-aea1d0325c5a
Is there anything wrong in endpoint or parameter?.
How to pass version?

Your endpoint looks correct if you're trying to send a message to conversation: https://www.ibm.com/watson/developercloud/conversation/api/v1/?curl#send_message
Try changing the version to the most updated: version=2017-05-26

Related

Telegram API 404 error on messages.hideAllChatJoinRequests

Telegram api has a messages.hideAllChatJoinRequests method, but when calling it, the api gives an error
{"ok":false,"error_code":404,"description":"Not Found"}
I try to call it like this:
https://api.telegram.org/botMYTOKEN/messages.hideAllChatJoinRequests
What am I doing wrong?
Tried adding parameters to the request

LinkedIn Access Token Being Used

I've successfully secured my access token for the LinkedIn API. However, when I try to use it to gather user information (currently just my own so I know that the profile has all public settings) using this code:
requestURL = 'https://api.linkedin.com/v2/people/(id:{my_linkedin_id})'
headers = {'Authorization': 'Bearer' + ' ' + access_token}
a = requests.get(requestURL,headers=headers)
could someone elaborate on any steps I might be messing?
When I run this code I keep getting a
<Response [404]>
You have 404 as response and in LinkedIn documentation you can see that:
404 Resource Not Found
This error occurs when your application tries to call an API or fetch
an entity that does not exist. For example, the API to get a friend’s
profile is /v2/people/id={personId}, not /v2/person/id={personId}. In
some cases (Ads, for example), a 404 error is returned when attempting
to access a restricted API. See 403 Access Denied and contact your
partner technical support channel if you continue to see the error.
I think you need too check if your link to resource is good.

Return custom error from appengine behind Google Cloud Endpoints

I am using flask and python 3.6 as a backend service that is deployed to App Engine in GCP. This backend is sitting behind Google Cloud Endpoints deployed in Cloud Run. Endpoints takes all my 404 messages and just returns 404 Not Found. I want to send a more informative error message with the 404 code. Is there any way to do so using my current setup? Thanks
You can create a custom 404 html page:
#app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
Then, you need to create 404.html file.
You can use the Python Endpoints library to send HTTP error codes with a custom message as follows:
message = 'No entity with the id "%s" exists.' % entity_id
raise endpoints.NotFoundException(message)
You can find more info in the docs

RStudio & RGoogleAnalytics giving Error: redirect_uri_mismatch

I am trying to connect to google analytics from R through Analytics API. Following is my code.
library(RGoogleAnalytics)
oauth_token <- Auth(client.id = "clientID", client.secret = "clientSecret")
When I run above command it gives me following error in browser
Error: redirect_uri_mismatch
The redirect URI in the request, http://localhost:1410/, does not match the ones authorized for the OAuth client.
I have following settings in google developer console
Authorised JavaScript origins : http://localhost:1410
Authorised redirect URIs: http://localhost:8080/oauth2callback
Please help.
You will need to update your redirect URIs to the same port.
http://localhost:1410/oauth2callback
If that does not work, create a new client secret json file. Use "other" as the application type;

send grid & parse 502 Bad Gateway with nginx

I am trying to migrate my parse application over to digital ocean and followed this guide :
https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04
Everything works perfectly fine until I get to the very end Test Parse Server ( Executing Example Cloud Code ) section
I tested the cloud code for the sample cloud code that was provided in the tutorial :
Parse.Cloud.define('hello', function(req, res) {
res.success('Hi');
});
so I got a Hi back in my browser as well as in postman.
See image here : https://cloudup.com/cH2dbBx1KTo

Then I test the function that uses sendgrid's service to send emails (http://blog.parse.com/announcements/introducing-the-sendgrid-cloud-module/), my cloud code file looks like this :
see image : https://cloudup.com/cD6MNRP3Tft
and now I try to run my post request from postman and I get an error even on my hello function that was working before
See image : https://cloudup.com/cIkwJ6552_5
So I look around and figure out that its an issue with my sendgrid import
var sendgrid = require("sendgrid");
sendgrid.initialize(“xxxxxx”, “xxxxx.”);
in these lines.
does anyone have any experience with digital ocean cloud code and send grid emailing service please help me out I will be grateful as this is the last step left and I will be done with my migration :)
cheers
Tanzeel
you have to specify server URL in parse config file. It is required and could be the reason why you cant run cloud code.
"PARSE_SERVER_URL": "http://localhost:1337/parse"
The url has be the same what you are using. There is also error in Nginx config in that tutorial, I explained it here https://serverfault.com/questions/765627/cannot-post-get-over-ssl/766428#766428
So I looked up at pm2 and to see real-time logs the command is
pm2 logs
at first when I ran the command I saw some errors, maybe they were there from before :
Then I tried the hello cloud function from postman app to test for its output in pm2 logs and I got the following :
Next I try to run my sendMail sendgrid function and I find out the the api-key I had used in my sendgrid function was throwing an error
ReferenceError: XXXXXXXXXXXX is not defined
So I went back to my cloud code and used quotes around my api-key parameter and passed it as a string in my send grid initialize function. Then I retry and get
[Error: The provided authorization grant is invalid, expired, or revoked]
So I went back to my sendgrid account and made sure that the api-key I was using was the correct one and it seemed to be just fine. I tested again and got the same error again so I decided to generate a new api-key just in case.
So I realize that I was not using the api-key but instead API KEY ID :
When we create a new api-key on sendgrid they give us the actual api key once and they ask us to store it in some secure place :
We can only display the key above one time. Please store it somewhere safe because as soon as you navigate away from this page, we will not be able to retrieve or restore this generated token.
So after I used an actual api-key I was able to send emails 😃
But one small issue still remains and I am not sure if its because of postman that I am using to run cloud code or something in the parse server or nginx that is still returning me with a 502 Bad Gateway as a response
But when I look at the logs for my parse server I do see a
parse-wrapper-0 { message: 'success' }
but it never gets back to me in my postman and instead I am getting a 502 error not sure why but the emails are being sent succesfully :)

Resources