Get username from instagram api to use in chat bot - api

I finished to build my web app that is an chat bot that integrate with instagram chat. The intagration is working fine, now I'm trying to get approve from instagram to publish it.
I used the follow url to get user name after receive an chat in my webhook:
curl -X GET "https://graph.facebook.com/v14.0/instagram-scoped-user-id?fields=name,username,profile_pic,follower_count,is_user_follow_business,is_business_follow_user&access_token=page-access-token"
In my testes worked fine, and in docs say that I need permission "instagram_basic" to go to production.
My problem is that when I try to approve my application, I receive an erro:
"The use case of you app to this permission is invalid, or not necessary to main function of your app."
So what? They expect that my chat show the userid instead the user name on chatting between agent and user? WTF.
In search here in stack, I find:
How to get the instagram username from instagram messenger webhook_
The user #eljefedelrodeodeljefe said to use the exactly api that I'm using now.
Someone got approve for this? What's the trick or should I try use an different api?
Thank you.

Related

Spotify : 403 - User not registered in the Developer Dashboard

I'm making a react-native app with the Spotify API, I'm using the Authorization Code Flow & and I'm on Development mode with only one user added in "Users and access" on my Spotify dashboard: my tester, who is a part of my Spotify Premium Duo.
The app is working fine on my part, but my tester can't see anything related to her account. The /me endpoint is sending a 403 error with this message in the body : User not registered in the Developer Dashboard. Top Tracks / Top Artists endpoints are working fine with her Access Token.
I can't see any email on her Spotify account, but can't change anything because it is linked to her Facebook account. I'm also logged in with my Facebook but it's working fine, and I can see my details when fetching the /me endpoint with my access token.
If you ever stumbled upon this kind of error, any help will be appreciated !
Thank you in advance,
You can see your info using the /me endpoint because you're the owner of the app and automatically registered in the project's dashboard.
In order to use the /me endpoint on other Spotify accounts you have to register them in the dashboard of your project under "Users and access" in the top right corner.
Once the user is registered, the /me should return a 200 response containing all the user's info.
This is probably due to the fact that you're app is in development mode.
The mail to use if the user is logged on Spotify via Facebook, is the Facebook one I'd say.
NOTE: You have to provide the user's real name to grant access: it's case sensitive.

How to use best use Google/Facebook signin using expo AuthSession to authenticate with a custom backend API

I am working on creating an mobile app using Expo (managed workflow). I have a backend server which this app will connect to. The backend server has its own authentication with username and password and all other endpoints are protected based on a token that you would receive by signing in to the API using a /authenticate endpoint.
Now, I would like to add a 'Sign in with Google' feature to my app. From the Expo's AuthSession documentations, it looks like somehow the app can authenticate with Google. I want to use this identity to authenticate with my backend API.
I created a /api/auth/google endpoint in my API that uses passport google-oauth, redirects user to google and get authorization code sent to /api/auth/google/callback. I then use the authorization code to access Google's people API, to get the email to validate the user and respond back with a access token for my API if the Google sign in was successful. This works fine when using in a browser.
I want to do something similar for the react-native app. When I use the Google example in Expo's AuthSession, it gives me back a access_token. I have no idea how it gets an access_token because the app does not know my client secret. But still, I don't know how to use it to login to my API and get my API's token.
I have thought about using AuthSession to directly open my API's /api/auth/google, so it would redirect correctly and my backend can then send my API's token to the app. The problem with this is, when someone clicks on the 'Sign in with Google' button in the app, apple will tell you 'App name wants to use myapi.com to sign in' or something along those lines instead of Google.com. Additionally when I add more sign in options like Sign in with Facebook and Sign in with Something else, the user's phone will always say that the app wants to use myapi.com to sign in and then in turn be redirected to Google/Facebook or something else. I am not sure if this is allowed and would count as misleading the user and get rejected form the app store. I tried logging into some of the apps on my phone and clicking on 'Sign in with Google' tells the app is trying to sign in with Google.com and 'Sign in with Facebook' tells that the app is trying to sign in with Facebook.com correctly. But then I also know that the app eventually authenticates with its own API somehow. I don't know what is the right way to do that.
Can someone help? Thanks.

Hangout chat doesn't show my bot as user

I have followed the instructions as per the https://developers.google.com/hangouts/chat/how-tos/bots-develop?authuser=1
Created my agent - named as "phoebieagent".
Defined intents and entities.
Fulfilled by webhook and running a flask python API on https.
Published by bot as hangouts chat. Specified bot url to be the one
defined in step 3.
Bot status shows - "live" but in my hangouts I can't see my bot user.
Please suggest trouble shooting steps.
Thanks
Resolved it. Chat was disabled in google admin console.

Quickblox for android and web using PHP as backend

I was thinking of using the quickblox for my chat requirement.
We want to build a 1-1 chat between a user and admin. User will be logged in from the android and admin will be logged in from the web. We want the functionality for the user to chat with an admin person. Our backend code base is in PHP and both the android and web talks to the backend with rest APIs.
Some can please help me out on where should I start my development from. Can you share any sample code or tutorial to get me started with, it would be really helpful?
It may be solve like this
For PHP admin side
First you need to create the dialog for all the user
Then for selected user you will call the Retrieve_messages api for getting all the user
For sending the message you have to call Create_message
Ref : QuickBlox
For android they have their own SDK for sending and getting the message
Android SDK

Twitter API: allow authenticated user to post tweets on another user's behalf

Twitter API allows to update "the authenticating user’s current status", as explained in the documentation page.
What I'd like to achieve instead is to update another user's current status. Consider a magazine's twitter account. I'd like different people to be able to update the magazine's status. Tweetdeck allows this, but it also allows a whole lot of other things like access to Direct Messages. I only want to provide certain authenticated users an interface (similar to Twitter's post-a-tweet interface) to post status and images to the shared account.
I could not find a simple explanation of how to use Twitter API to achieve the above functionality. Could someone please help?
If you have an app that implements the status update API and it is delivered to different people and they authorize the app with the magazine's twitter account, then the app will update that status. I can show an example also with code if this is what you're asking. However the main point is that, once a user has authorized the app, she/he doesn't need to be connected with the shared login any longer because the app will do that on the magazine's behalf.
BTW, similar question here: Twitter API: post on behalf of whom?
Edit
Just to summarize the comments:
The standard OAuth authentication requires the following main steps
1) to develop an app (registered with OAuth consumer key and secret) that implements the API update status 2) to install and authorize the app: during this step the onwer will be requested to enter the credentials of the passive account in a Twitter link opened with the browser, 3) then - after a fallback - the app will store the access token and any user of the app will be able to update the status without login
Once you have developed an app that can post tweets on behalf of a passive twitter account using the standard OAuth, you could make that functionality available to the authenticated users of a website.