Is there any concept like google plus app access token - api

I am currently developing an app for Google+. Is there any way to fetch/search public data with out user authentication, I mean, using an app access token
https://www.googleapis.com/oauth2/v1/activities

Yes, see https://developers.google.com/+/api/oauth#apikey which talks about using an API Key instead of using a user login.
Quoting that page:
For Google+ API calls that do not need to identify a particular user, you can use your application API key. This is useful for server-side applications, or web applications that do not require the user to sign in with Google.
[...]
After you have an API key, your application can append the query parameter key=yourAPIKey to all request URLs. The API key is safe for embedding in URLs; it doesn't need any encoding.
You can get the API key via the new Developers Console by going to http://console.developers.google.com/ and selecting your project, then clicking on the APIs & auth tab on the left and then Credentials. There should be a section on the right Public API Access with a button to press to create a new key if one doesn't already exist.

Still no luck,
Here is the response :
Array
(
[url] => https://www.googleapis.com/oauth2/v1/activities?query=stackoverflow&maxResults=100&orderBy=recent&key=54XXXXXXX4723.apps.googleusercontent.com
[content_type] => text/html; charset=UTF-8
[http_code] => 404
[header_size] => 390
[request_size] => 262
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.813163
[namelookup_time] => 0.411874
[connect_time] => 0.454496
[pretransfer_time] => 0.605186
[size_upload] => 0
[size_download] => 9
[speed_download] => 11
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.813109
[redirect_time] => 0
[certinfo] => Array
(
)
[primary_ip] => XXX.XXX.XXX.XX
[primary_port] => 443
[local_ip] => 192.XXX.XXX.XXXX
[local_port] => 52227
[redirect_url] =>
)

The answer around the key is correct for general public access. However, the URL you are using is not correct. You want the activities list API I suspect: https://developers.google.com/+/api/latest/activities/list
GET https://www.googleapis.com/plus/v1/people/{userId}/activities/public?key={YOUR_KEY}

Related

omnipay payment wall integration -Error

I tried to implement paymentwall payment gateway integration with Laravel using omnipay library.After setting setApiType, setPublicKey and setPrivateKey and trying to call the API, its getting the response "Public key is missed or invalid" from payment wall gateway.
Actually this error is happened due to passing parameter public key as public_Key instead of public_key from the omnipay library.
The following is the response
[request:protected] => Omnipay\PaymentWall\Message\PurchaseRequest Object
(
[endPoint:protected] => https://api.paymentwall.com/api
[parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[apiType] => 0
[publicKey] => hjghjghsdfsc5464564564e56456
[privateKey] => gfh4567686786787hfjfhgfgfgh
[amount] => 10.00
[currency] => USD
[accountId] =>
[description] => test Pay
[email] => test#gmail.com
[clientIp] => 112.133.236.158
[browserDomain] => test.com
[card] => Omnipay\Common\CreditCard Object
[response:protected] => Omnipay\PaymentWall\Message\Response Object
*RECURSION*
[zeroAmountAllowed:protected] => 1
[negativeAmountAllowed:protected] =>
)
[data:protected] => Array
(
[type] => Error
[object] => Error
[error] => Public key is missed or invalid
[code] => 2111
[log] =>
)
)
Public key is missed or invalid
As I commented in the issue that you raised on github:
This is working for everyone else. Are you sure there isn't really an issue with your keys? Can you check that there are no spurious newlines, etc, in your key as provided to the library?
The correct name for the public key parameter within Omnipay is publicKey. The correct name within the paymentwall library is public_key. A check of the code appears to indicate that the parameter naming is correct. The Omnipay publicKey parameter is correctly passed to the paymentwall library as public_key.

Shopify APP API

$shopify = shopify\client( $shop, $app_settings->api_key, $shop_data->access_token, false );
$products = $shopify('GET', '/admin/products.json', array('published_status' => 'published'));`
I am getting the following response by printing the $shopify:
Closure Object
(
[static] => Array
(
[base_uri] => https://4f4b14c3eb5464ae238dd6cf4b88bce6:c2608b7067c5bf96028876023114b68c#pilibaba.myshopify.com/
[oauth_token] => c2608b7067c5bf96028876023114b68c
[private_app] => 2f996f1bd2a0f4fb343703555c89a234
)
[parameter] => Array
(
[$method_uri] =>
[$query] =>
[$payload] =>
[&$response_headers] =>
[$request_headers] =>
[$curl_opts] =>
)
)
after that accessing the $product i am getting the following error.
Fatal error:
Uncaught phpish\shopify\CurlException: [3] malformed in /*****/shopify_app/shopify_app.php on line 36 thrown in /******/shopify_app/shopify.php on line 67
Is it a problem with my access token? as i do have all the store permission while installing the app.
I did research for this error by didnt find any help either from shopify support team.
change keys of your url:
apikey = c2608b7067c5bf96028876023114b68c
access_token = 4f4b14c3eb5464ae238dd6cf4b88bce6
https://c2608b7067c5bf96028876023114b68c:4f4b14c3eb5464ae238dd6cf4b88bce6#pilibaba.myshopify.com/admin/shop.json

Oauth Client Creation Rails

I'm working with rails to create a client for the Fitbit API (very similar to twitter api) on Rails.
In my device.rb file
def fitbit_data
#client = Fitgem::Client.new (
:consumer_key => 'bb1', #I understand the security issues here and will change it for production
:consumer_secret => '81f',
:token => oauth_token,
:secret => oauth_token_secret,
:user_id => uid
)
end
It says that my syntax is wrong and asks for a ')' after :consumer_key. How do I get the syntax correct?
Note: this answer is applicable for Rails 4.1.4 and Fitgem 0.10.0.
I think the issue here is that to initialize a client, you have to pass in a hash. Additionally, I do not believe it's necessary to specify a user_id key. See my code below:
$client = Fitgem::Client.new ({ :consumer_key => ENV["FITBIT_CONSUMER_KEY"],
:consumer_secret => ENV["FITBIT_CONSUMER_SECRET"],
:token => ENV["OAUTH_TOKEN"],
:secret => ENV["OAUTH_SECRET"] })
Let me know if this helps.

$facebook->getSignedRequest(); return the correct value in iframe while return null on my server side

i am building a fan gate for my site to give out some coupon.
here is my code:
<?php
require_once 'facebook.php';
$app_id = "xxxxxxxxxxxxxxx";
$app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
print_r($_REQUEST);
$signed_request = $facebook->getSignedRequest();
echo "<pre>";
print_r($facebook->getSignedRequest());
echo "</pre>";
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
$like_status = $signed_request["page"]["liked"];
print_r($facebook);
?>
I find that the return value of $facebook->getSignedRequest(); is different when i am visiting my apps via apps.facebook.com/xxxxxxxxxxxxxxxxxxxxxx/ and when i am visiting www.coupon.mysite.com/facebook/index.php
via apps.facebook.com/xxxxxxxxxxxxxxxxxxxxxx/:
Facebook Object ( [appId:protected] => 15255288xxxxxxxx [appSecret:protected] => XXXXXXXXXXXXXXXXXXXX[user:protected] => [signedRequest:protected] => Array ( [algorithm] => HMAC-SHA256 [issued_at] => xxxxxxxxxxxxx[user] => Array ( [country] => hk [locale] => en_US [age] => Array ( [min] => 21 ) ) ) [state:protected] => [accessToken:protected] => [fileUploadSupport:protected] => )
via www.coupon.mysite.com/facebook/index.php:
Facebook Object ( [appId:protected] => xxxxxxxxxxxxxxxxxxx[appSecret:protected] => xxxxxxxxxxxxxxxxxx[user:protected] => [signedRequest:protected] => [state:protected] => [accessToken:protected] => [fileUploadSupport:protected] => )
so the fan gate wont work because $facebook->getSignedRequest(); always return null in my server side. I have do the searching for this problem for some days already and still dont understand what is the problem.
Any help is very much appreciated.
^ ... continue from the comments:
First of all, if you do this, your users will hate you; secondly, that plugin is bit of a scam - all it does is uses cookies to store if user has liked a page - but if you delete your cookies, you will be locked out of the content because you won't be able to like the page again. Furthermore, it won't work without Javascript.
All the plugin does is it hooks into the "like" action when user clicks on the like button via
FB.Event.subscribe('edge.create', function(href, response){});
facebook graph api determine if user likes url

AWeberApi - could not get Subscribers email

I run this code
print_r($list->subscribers);
You can see at the result I pasted below that there is no subscriber name and email... I tried all the sample codes i could find in the web and all of them have the same result.
Now my question is, how to get the emails of all the subscribers aside from the code I used above?
[last_followup_sent_link] => https://api.aweber.com/1.0/accounts/6023076/lists/20746327/campaigns/f105556951
[city] =>
[http_etag] => "d6a652460dae642a0732ecf75003de4t05be96f66a1-7c14178a7fa0b2a2b7fb74be93ff058ac477ea43"
[ad_tracking] => my_web_form
[dma_code] =>
[last_followup_message_number_sent] => 1
[last_followup_sent_at] => 2011-11-17 04:52:19-05:00
[latitude] =>
[is_verified] => 1
[status] => subscribed
[area_code] =>
[unsubscribed_at] =>
[self_link] =>
[unsubscribe_method] =>
[resource_type_link] => https://api.aweber.com/1.0/#subscriber
[subscription_method] => signup form
[subscribed_at] => 2011-11-17 04:51:41-05:00
[region] =>
[longitude] =>
[verified_at] => 2011-11-17 04:52:19-05:00
[country] =>
The problem is that you did not grant access to subscriber info in your app. Choose Edit -> Permission Settings, put a check mark in the Request Subscriber Info box then choose save permission settings and then choose save. If done correctly, you should be back at the apps page and it will now be displaying the additional permissions.
You will have to reset the key/secret and then get a new Oauth token and secret as well. When that takes place and it asks for permission, you should see a box above the login credentials detailing the request for personal subscriber details. If you don't see it, something is wrong.
Once completed you should see all subscriber data including email address.