Search Person Information by there email id using Graph API Facebook - asp.net

I want to Search the person basic information like email,name,address etc by passing there email id on graph API of facebook. But its not working and its returning me the message
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
I am passing url like below-
https://graph.facebook.com/search?q=EMAIL_ID&type=user&access_token=ACCESS_TOKEN
Please suggest me how can I able to search information by passing email id in graph api. and also if I logged out and then logged in back then my this access_token is not working. Do I need to get different access token each time? Please suggest.
Thanks

Related

How do I get user activity data from the Google API

I want to retrieve user activity data using the Google Analytics Reporting API. I code in PHP (not that it's relevant to this question)
I am following instructions from here: https://developers.google.com/analytics/devguides/reporting/core/v4/user-reporting
I am using the _ga client ID cookie stored in browser for the "userId", but I get the following response:
{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED", "details": [ { "#type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "service": "analyticsreporting.googleapis.com", "method": "google.analytics.reporting.v4.Reporting.SearchUserActivity" } } ] } }
This seems like I have to let the user sign into Google before I can get the desired data.
Is it possible to get this data from just the _ga cookie ID, without the user signing in?
Below is the request from the client. They say I need to use the Google Reporting API. This also seems like it can only work once signed in?
When a lead is submitted using the contact form, capture the Google Analytics ClientID (stored in the _ga cookie in the browser) as part of the submission.
Using the ClientID, interrogate the Google Analytics Reporting API for the "first interaction" (first session) user activity linked to this lead, fetching the data linked to the following variables:
Source
Medium
Campaign Name
Campaign Content
Campaign Term
Search Query
Once the data has been retrieved from the GA API (which can sometimes take up to 15 minutes to populate in the GA databases), pass the full payload, including the lead details and the marketing characteristics through to the CRM.

How to get customers orders list using their own rest api creds

I have created a new Rest API credentials for a customer.
Now I am using the following api to get the orders for that particular user.
/wp-json/wc/v3/orders
but I get the following error in the response
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 403
}
}
I have tried with both basic auth and keys in url parameter, but it's not working. If the rest api belongs to that particular user then it should return the users order but it is giving me error.
Please help
Even I am not able to get the product list with the customer's api credentials.
A few things:
The REST API doesn't belong to a customer, it's just WooCommerce functionality.
You need to create API keys for yourself - the user that will be using the REST API. Not for the customer whose information you need. If THAT customer will be using your site's REST API, he will need his own credentials.
The endpoint you're using will give you all orders. For a specific one, you need to use this endpoint: /wp-json/wc/v3/orders/<id> (replace "<id>" by an order ID).
For orders of a specific customer, you can add a customer parameter (List all orders documentation
In the Postman Authorization tab, choose "Basic Auth", enter the key and secret there, and test it with the "All orders" endpoint. That should work.

Can't reproduce payment instrument token creation action from sandbox with "Invalid profile owner" error

I want to create a token for card with given API call https://developer.cybersource.com/api-reference-assets/index.html#token-management_payment-instrument_create-a-payment-instrument as CyberSource's Intro video suggests. With default credentials that sandbox provide(testrest merchant) everything goes fine but when I use my credentials generated in https://ebc2test.cybersource.com I am always getting next error(I don't edit initial request that sandbox provides; with this exact request and default credentials CyberSource generates token and successfully returns it to API test page)
{
"errors": [
{
"type": "forbidden",
"message": "Invalid profile owner"
}
]
}
I have tried to use merchant API shared key/secret as well as user-specific credentials from the same merchant profile.
What I did wrong(may be I need to change smth in merchant profile) and what I need to do to make it work ?
We had the same problem. It was related to the profileId. The hard coded profile id isn't valid. You need to get your own profile id from customer support. From what I gather the profile id is used to reference your specific tokens. It's a discount double check if you will that the tokens you are inputting are connected to your account.
The profile id within a REST API context is assigned by CyberSource within the Gateway account and with TMS is a specific id for your TOKEN MANAGEMENT collection.

Facebook Graph API not showing shares

I need help with Facebook counts on Shareaholic wordpress plugin?
There is a post I know that should be showing shares/likes on the share bar, but nothing is showing. When I look at the URL in Facebook Debugger, I can see the URL is getting an oAuth error, although I have no idea how to fix it. I have the Facebook OGP plugin and have linked my Facebook app and most URLs work ok, but this particular one is not.
If I go here: http://graph.facebook.com/http://www.amyjbennett.com/2015/10/06/feathers-season-2-episode-9-with-heather-tollison/
you'll see I get the ID but not the shares.
But, the graph API that I found in my Facebook Developer application for this URL returns:
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104,
"fbtrace_id": "BIuSensfLPZ"
}
}
How can I get it to return without error and include the shares (which I know it has).
I think you should first get oAuth from Facebook graph login url then it will give you the access token(which is temporary generally) and save it to your database or session and use that access token to get resources of graphAPI. The following link might help.
https://developers.facebook.com/docs/facebook-login/web

How can I fetch my friend's Facebook friend list using his/her Facebook id in C#?

Is it possible to fetch my friend's friend list using his Facebook id? I am able to fetch my own friend list in a grid but now I want to fetch their friend list on the basis of their Facebook user id.
You cant. Facebook api only provide friend list info for the logged user.
If you try it you will get a message like:
{
"error": {
"type": "Exception",
"message": "(#604) Can't lookup all friends of <UID>. Can only lookup for the logged in user (<MY_UID>), or friends of the logged in user with the appropriate permission"
}
}
If you want to do it you will have to do it by yourself parsing html and that stuff, but out of the facebook Graph Api
If you require the appropriate extended permission when the users authorize your app, you can access some data of the currently logged user's friends, but that's all you get .
(http://developers.facebook.com/docs/authentication/permissions see: friends_xxxx permissions), but not his/her friends.

Resources