slack API users.identity not working - python

I am trying to get my python slack bot to work. I want to get the info of the user who is trying to make API calls using users.identity API. However, I was unable to make it to work.
Any tips and idea why?
This is the error I get.
Thanks in advance.

It won't work on https://api.slack.com/methods/users.identity/test. But if you create an "app/script" where you can authenticate and then request with https://slack.com/api/users.identity?token=xxx you will get a valid response for the logged in person. With User Name,User id and Team id

Related

How to use MSAL Python library to get user roles for an Azure registered application

guys. I am trying to use MSAL python library to get user roles for an application I already regigered in Azure Active Directory. Please give me enlight me how to get it done in Python code. Thank you!
I figured it out. I followed this post and eventually I foud roles in the id token claims. All I need to do is that I must incloude Groups claim in the token, by changing the application manifest.

How to fetch parameters from a GET request in Python

So I have been building a chatbot powered by RASA stack (open source).
After creating the bot, I wanted to integrate it with our web application. Now I'm able get responses from my RASA core but I'm in a problem. I'm passing a unique user_id in the GET request which i need to fetch inside a python function and call an external API to my Database. But I don't know how to fetch that parameter out from GET request. here are some details.
My GET request: (I uploaded my bot on AWS server)
http://my_ip_.amazonaws.com:5005/conversations/27/respond?q=%27Hi
So my unique id is 27 which i want to fetch inside a python function.
and the response i'm getting by this request :
[{“recipient_id”:“27”,“text”:“Hey! What can I do for you?”}]
As you can see I passed the GET request in postman and got this response from my RASA CHATBOT but I want to track this user-id 27.
So my question is how can I track this id? Or maybe you guys can suggest me another way to do it.
Thanks for your help in advance :) My first post BTW :)
[Please ask me anything if you feel this question is missing something]
So you are receiving the following data from the request:
[{“recipient_id”:“27”,“text”:“Hey! What can I do for you?”}].
If it's a list:
just use:
response = [{“recipient_id”:“27”,“text”:“Hey! What can I do for you?”}]
recepient_id = response[0]['recipient_id']
If it's a dict:
response = {“recipient_id”:“27”,“text”:“Hey! What can I do for you?”}
recepient_id = response['recipient_id']
so I solved this issue by using tracker data. Actually, I had to link tracker dictionary to my custom action file so that I can access the sender_id and other slot values.
I used:
user_id = tracker.sender_id
parameters ={}
parameters = {"user_id": user_id}
then it follows by my post request and it works! Thanks

Using Facebook Graph API to automatically delete comments in a group

I'm trying to automatically delete certain comments on posts within a facebook group which I admin.
When I try and delete it, I get this:
facebook.GraphAPIError: (#3) Publishing comments through the API is
only available for page access tokens
I happen to have a page which I have a page access token for. When I use it I get:
facebook.GraphAPIError: Unsupported delete request. Object with ID
'722227087901405' does not exist, cannot be loaded due to missing
permissions, or does not support this operation. Please read the
Graph API documentation at
https://developers.facebook.com/docs/graph-api
I've set every permission possible and have also tried to see if it's possible to get a page access token for the group I admin to no avail.
Is what I'm trying to do possible or just not supported?
Also I don't know how much it matters but I'm doing this with the python SDK.
Any help would be appreciated, thank you!

Only one user cannot log into an app via Google ID Authentication

At work we run a python application where users log in via their google account.
One user gets an "Error logging in" message on any instance, this doesn't replicate on any other instance.
The app was made by a third party and they can't tell us why this happens. Is there a debugging tool or something that comes with Google auth that could be used to trace where the failure is happening?
Thanks in advance. If any more technical details are needed please let me know. I'm not very familiar with how all this works.
If it's only one user I'd say it's fairly safe to assume the problem has something to do with that user's credentials. It's hard to say without an error log but if it were me I'd first check to make sure the information the user is entering is the same as what oauth is expecting. Good luck and hope this helps!
Worked this out. Whoever set up the user's ID originally had a capital letter in the ID - but not in the Email addr so this wasn't showing up anywhere.

Python Send to and figure out POST

Recently, I've been attempting to figure out how I can find out what an unlabeled POST is, and send to it using Python.
The issue of the matter is I'm attempting to make a chat bot entirely in Python in order to increase my knowledge of the language. For said bot, I'm attempting to use a chat-box that runs entirely on jQuery. The issue with this is it has no knowledgeable POST or GET statements associated with the chat-box submissions.
How can I figure out what the POST and GET statements being sent when a message is submitted, and somehow use that to my advantage to send custom POST or GET statements for a chat-bot?
Any help is appreciated, thanks.
You need a server in order to be able to receive any GET and POST requests, one of the easier ways to get that is to set up a Django project, ready in minutes and then add custom views to handle the request you want properly.

Categories