I need to retrieve all the pages owned by the current user. I need the syntax. Can it be done using Graph API???
Yes. Use the /me/accounts path.
Related
I have two different objects in my API, we can call them users as tasks. I want to shape the API so users can only access tasks associated with them, but admin can access all tasks. How would I check to make sure what they are requesting matches their username? I have login working as per http://code.tutsplus.com/tutorials/building-rest-apis-using-eve--cms-22961 but I'd like to be able to create a more encompassing API.
You might resort to User Restricted Resource Access
When this feature is enabled, each stored document is associated with the account that created it. This allows the API to transparently serve only account-created documents on all kinds of requests: read, edit, delete and of course create. User authentication needs to be enabled for this to work properly.
See the relevant documentation at the link above.
I manage a domain of users and would like to be able to transfer all the documents of a user to another user. As far as I understand the best way to achieve that is to find the fileID's of all files belonging to one user and transfer them to another user. However, I have problem constructing a query.
UPDATE:
So the correct query to retrieve the list of files would be:
response = drive_service.files().list(q="'user#company.com' in owners").execute()
However, it only works for me as an admin. If I try to retrieve the list of files for any other user in my domain it returns an empty list.
Files.list will retrieve all the user's files, in this case it will get all your own files. In order for that query to work would be only if that user is also owner one(or more) of your files.
Even as an admin you cannot access users files directly.
To access other user's files, as an admin you need to impersonate the users and then perform actions in their behalf.
This is achieved by using a service account with domain wide delegation of authority.
Here you can find more information on that as well as a python example.
Hope it helps.
If you want to transfer all the files of one user into another user's Drive, the easiest way would be to use the Data Transfer API provided by Google. This way you don't have to list the files and transfer them one by one. Also you only need the admin access token and wouldn't need domain wide delegation either. You can get the official documentation here
Is it possible to delete a WorkSite user using the API?
I have the following dlls referenced.
IManage.dll
IMANADMIN.dll
IMANEXTLib.dll
I can create a user using IMANADMIN.NRTDatabase.CreateUser()
No, Worksite doesn't allow delete a user.
Only rename via DbAdmin (It's not possible do it using iManage API) to another user or disable him.
As far as I know it isn't possible to do via API
You may only forbid user to log in.
You can use the following:
IMANADMIN.NRTDatabase.DeleteUser()
i am trying to use /me/likes/pageID the same way i used pages.isFan (REST API).
But it always uses the user/page as me for which i created the access token and not the current active user.
can't get my head around this one, any help is appreciated!
thanks
[from comments] but do i really need to create an application to "just" check if the user is fan of my own page? and even ask his authorization?
Yes, you will need an app in any case.
If you run your app as a canvas or page tab app inside of Facebook, then you get the info if the current user liked the very Facebook fan page the app is running in(!) directly from the signed_request parameter.
If you want to query this infor for other pages, and/or your app is running outside of Facebook, then you have to have the user connect to your app and ask permission to read his likes first, before you can get this info.
For information on the latter case, see https://developers.facebook.com/docs/authentication/, https://developers.facebook.com/docs/authentication/permissions/#user_friends_perms, https://developers.facebook.com/docs/reference/api/user/#likes
It is easy: With the new Graph API, the owner of the access token is me. You can see this by pasting an access token into the debugger.
You should be authenticating your user and gaining an access token in their name each time they visit your site. Then use only this access token when you make your query.
This process is easiest if you use one of the Facebook SDKs.
I recently set up a Facebook application so that I might be able to send messages to people who 'like' things). I managed to figure that part out, but now I'm stumped again.
As far as I have seen, every open graph object that is created will have a reference to a app_id if the page had a fb:app_id open graph meta tag. However, I haven't seen anything in the Open Graph API that allows me to get a list of Open Graph objects associated with an app_id (this question has some insight, but doesn't provide a lot of information).
Alternatively, since I know that the pages will have a similar URL, I was investigating FQL to see if it is possible to find pages where the URL matches some pattern (either using strpos or the IN operator). No luck there either (condition fields needs to be indexed).
Lastly, I considered using the fb:admin metatag, because apparently it is possible to see which pages a user administers. In this case, I haven't figured out how to become administrator of the Open Graph object, so I am again stumped.
Is there any way, however roundabout, to get open graph objects associated with a Facebook application or user?
There's no way to get a list (from Facebook) of objects it knows are associated with a given app_id. Facebook only "knows" about your custom OG objects when it crawls them, and its only going to crawl them in when an action is taken with your OG object as a target. The best way to keep track of OG object for a given app is to track the result of OG API calls that create these actions (you'll get an fb_action_id).
Same with users. You can track which users are associated with your App in response to successful calls to FB.login or FB.getLoginStatus. You'll need to track actions taken by that user yourself.