I am currently developing an app where I have been using temboo to search a user on Facebook. I am able to get the basic results which do not need any additional permissions.
But for fields like education history, about_me etc, I need to include additional permissions to retrieve these fields.
Could you please let me know how to add these permissions to the temboo FQLinputsets?
Thanks!
I work at Temboo.
I would recommend using our OAuth Helper Choreos to go through the OAuth process, and request an additional set of permissions:
https://www.temboo.com/library/Library/Facebook/OAuth/
In the first step of the OAuth process, you'll run the InitializeOAuth choreo. This is where you can specify the permissions you need to request by passing a comma-separated list of permissions to the "Scope" input. You'll want to pass user_education_history,about_me along with any other permissions you'd like to request. Here's an example of the input set:
// Set inputs
initializeOAuthInputs.set_AppID("YOUR_FACEBOOK_APP_ID");
initializeOAuthInputs.set_Scope("user_education_history,about_me");
Then you can complete the OAuth process by running the FinalizeOAuth choreo. This will return an access token that should have the permission you need to retrieve those fields.
https://www.temboo.com/library/Library/Facebook/OAuth/FinalizeOAuth/
There is a video tutorial about the OAuth Choreos here:
https://www.temboo.com/videos#oauthchoreos
Hope this helps. Let us know if you have any other questions.
Cormac
Related
I am creating a server side for android application in DRF which will require user registration and login\logout endpoints. also obviously different permissions when a user logged in.
I followed the rest framework tutorial here - http://www.django-rest-framework.org/tutorial/1-serialization/ and this example really seeme to cover it all beside the user registration (creation).
In the tutorial they do it from the command line (and they create a superuser). I think the tutorial example is really good for my needs besides not having the registration endpoint.
My question are:
what is the difference between a regular user and a superuser?
How should I create a registration endpoint for users? I saw this example DjangoRestFramework - registering a user: difference between UserSerializer.save() and User.objects.create_user()? but I am not sure if it will work nicely because in the tutorial they create a superuser.
If it matters, my user model in actually a UserProfile model which includes the user model and added a phone_number...
Thanks a lot!
A regular user has different authorities from superuser and you should customize view for a specific user. Here is link for you to create user in django.
Hope it helps.
I've copied it from Django documentation as an answer for your first question.
One of the most powerful parts of Django is the automatic admin
interface. Best thing is that you can customise it easily.
If logged in as a superuser, you have access to create, edit, and
delete any object (models).
You can create staff user using staff flag. The “staff” flag controls
whether the user is allowed to log in to the admin interface (i.e.,
whether that user is considered a “staff member” in your
organization). Since this same user system can be used to control
access to public (i.e., non-admin) sites, this flag differentiates
between public users and administrators.
“Normal” admin users – that is, active, non-superuser staff members –
are granted admin access through assigned permissions. Each object
editable through the admin interface has three permissions: a create
permission, an edit permission and a delete permission for all the
models you had created.
Django’s admin site uses a permissions system that you can use to give
specific users access only to the portions of the interface that they
need. When you create a user, that user has no permissions, and it’s
up to you to give the user specific permission
You can do something like this for the second question you've asked.
from django.contrib.auth.models import User
from rest_framework.views import APIView
from rest_framework import status
class Register(APIView):
def post(self, request):
user = User.objects.create(
username=request.data.get('email'),
email=request.data.get('email'),
first_name=request.data.get('firstName'),
last_name=request.data.get('lastName')
)
user.set_password(str(request.data.get('password')))
user.save()
return Response({"status":"success","response":"User Successfully Created"}, status=status.HTTP_201_CREATED)
I need to verify the spam score of mobile numbers using Truecaller API .I found documentation here . In the API URL , I need to send a APPKEY , But how to get that ? there is no registration page for Truecaller API .
https://api.truecaller.com/v1.0/search.json?userKey=APPKEY&phone=NUMBER
Any help will be appreciated...
You should Read this Document for Name Search API
it Says that....
The one thing to keep in mind is that all requests to our API require
authentication. For that, you will need to use a User Key (userKey)
along with your requests. These access details basically associate,
your server, script or program with a specific application. All
requests to the API must be made over SSL (https:// not http://).
It means you have registered Truecaller developer account then Do Login and get your Access Key(USER KEY) and pass it everytime you request to access API..
But I Think Truecaller API is not accessible for public users...
Read This Article for More Details : http://www.3scale.net/2013/05/truecaller-api-search-among-over-600-million-phone-numbers-worldwide/
Why don't you try this?
callerpy
Here is the explanation from the developer:
Truecaller Name Retriever.
Since my request for the API was rejected, I commenced using python parsing libraries.
Callerpy emulates the process one would encounter if using a web-browser.
I tried it, and it works like a charm from the command line.
Intro:
So I use accountManager to get a token I need:
am.getAuthToken(account,
scope,
null,
this,
new OnTokenAcquired(),
new Handler(new OnError()));
When I use "View your tasks" as the scope (just like it described here) Android shows up a permission request and tells that my application is asking for "View your tasks".
But I need to use "oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile" as the scope. When I do so, Android does not replace these URLs with the human-readable descriptions I found here.
Question:
Is there anyway to force Android to replace the scope with a custom description or description defined by Google?
Is there anyway to declare a custom permission and use it in the manifest so Android will ask for user's permission (such as "View your email address" and "View basic information about your account") during the installation?
Is there any way achieve what I'm trying to achieve?
What I'm trying to achieve:
I just want to ask for the permission I need so users will be able to understand what kind of the permission I'm asking for.
Thanks.
Is there anyway to force Android to replace the scope with a custom
description or description defined by Google?
No it's not possible to use a custom description. When you use the Oauth2 scopes on Android versions lower than 4 (I think, I'm not sure about 3) the exact scope will be shown to the user instead of something more user friendly. On Android 4 and newer you will get a description instead so this description seems to be part of Android itself.
Is there any way achieve what I'm trying to achieve?
You could try to use Google play's GoogleAuthUtil instead of the account manager for this as it gives a much better user experience. For a comparison between using the account manager and GoogleAuthUtil see: In a nutshell what's the difference from using OAuth2 request getAuthToken and getToken
I want to read my friends posts (feeds?, all posts but for a specific user only) from his user wall.
I need all (posts, feeds, statuses) that i see when i look at his page directly from the website.
I use the android sdk and i tried the graph api and rest method.
My app is registered and i have logged in facebook to get the access token (permission: read_stream)
but i dont get that infos that want to.
Please help.
Thx.
How about testing your Graph API call in the Graph API Explorer?
https://developers.facebook.com/tools/explorer/
In my case, I could get my first 10 friends' feed (wall) with the url https://graph.facebook.com/me?fields=friends.limit(10).fields(feed)
Note that I used field expansion of the Graph API.
http://developers.facebook.com/docs/reference/api/field_expansion/
You need them to actually use your app and grant full permissions via the graph API.
You cannot simply 'grab a friends wall'. You must do that via your app and it needs the permissions to do so from the user in question.
I'm studying on an android app with using facebook api. I have two activity, first one is to select friends and second one is to send somethings friends wall . I'm getting permission in first activiy but second activity is also requires permission . How can I make first permission in second activity , too .
Is it suitable doing facebook object static?
Permissions are associated with a particular Facebook App (you pass the App ID and App Key to the Android Facebook SDK). Hence, if you use the same Facebook App details in both activities, they both will be having the same permissions.
Peace be upon you,
Acquiring friends' info requires curtain permissions. e.g.
session.requestNewReadPermissions(new NewPermissionsRequest(FacebookLogin.this, Arrays.asList("friends_birthday", ...)));
However, publishing requires different permissions. e.g.
session.requestNewPublishPermissions(new NewPermissionsRequest(FacebookLogin.this, Arrays.asList("publish_actions")));
I recommend that you ask for permissions on need basis. e.g. by adding permission request command in the implementation of a Button.