When I search YouTube video uploading API all the example I see is based on Oauth and its use client id and secrete key. However I have seen using api key, but code not found any were i want it will use in core php .. by curl...
So if anyone has code and suggestion please help me..
thanks.
As you can see from the documentation Videos: insert it requires authentication and authorization using the following scopes.
Authorization
This request requires authorization with at least one of the following
scopes (read more about authentication and authorization).
Scope https://www.googleapis.com/auth/youtube.upload
https://www.googleapis.com/auth/youtube
https://www.googleapis.com/auth/youtubepartner
https://www.googleapis.com/auth/youtube.force-ssl
API keys are used for accessing public data only.
Related
I'm trying to make a Tumblr App that will get the user dashboard and will be able to present it in a different way. My problem is that i have absolutely no idea how to make an authentication to the user (oauth- get the access token and all that stuff). I can't understand how to do it from their website. Please Please help me understand how to do that, I really need that help
First, there is the API docs on Tumblr.com:
https://www.tumblr.com/docs/en/api/v2
If you are using PHP, I can recommend the PHP OAuth Class on PHPClasses.org:
http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html
Along with the PHP Class mentioned above, you will also need the HTTP Client:
http://www.phpclasses.org/httpclient
Download both packages from PHPClasses.org and put them in a folder:
/yourapp/...
Go to https://www.tumblr.com/oauth/apps and register your app, make sure that the callback URL matches the url that you use for your script. (eg. http://domain.tld/folder/script.php)
Then take a look at the login_with_tumblr.php file from the OAuth Class that you downloaded, and change these values:
// your OAuth Consumer Key from https://www.tumblr.com/oauth/apps
$client->client_id = '';
// your OAuth Consumer Key from https://www.tumblr.com/oauth/apps
$client->client_secret = '';
Now load the script from the browser, it will initialize the Tumblr Oauth and authenticates you with the Consumer and Secret Key.
You now have access to Tumblr's API via PHP.
Good luck!
I'm using this code https://github.com/google/google-api-php-client the user-example.php in the examples folder, to make some tests on Google plus signin.
Everything worked well, except one thing. After the connection, i obtained this url :
http://MYURL/?code=4/vt_b0DsUU91UOYkB3ozIp-ZLITiL2irzaaUzyvtdph4.4gAL4kfDZGUVJvIeHux6iLafIxOglAI
My question is, where can i get the user email ?
Thanks
TL;DR: Fully working solution: Get Userinfo from Google OAuth 2.0 PHP API
You're using offline flow which is described in details here: https://developers.google.com/accounts/docs/OAuth2WebServer#handlingtheresponse
At this point you got code.
vt_b0DsUU91UOYkB3ozIp-ZLITiL2irzaaUzyvtdph4.4gAL4kfDZGUVJvIeHux6iLafIxOglAI
This code needs to be exchanged for access_token.
Exchanging code for access token using Google Library: https://github.com/google/google-api-php-client/blob/master/examples/user-example.php#L66
With access_token you can send api requests.
I have been trying to implement the new scope features that were recently added to the LinkedIn API. I am currently using the "simple-linkedinphp" library for as my LinkedIn oauth lib (http://code.google.com/p/simple-linkedinphp/ ).
Following the directions on the LinkedIn docs, I added the "scope" param to my request token URL as such:
const _URL_REQUEST = 'https://api.linkedin.com/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress';
However, this had little effect. I still get the same o-auth dialogue as before without any additional permissions for the e-mail address. Anyone get this working correctly in PHP yet? Any help here would be appreciated.
You need to create new Application API keys and use those to see the updated authentication screens.
Seemingly it supposed to be https://github.com/facebook/php-sdk/. However, I am suspicious either it so because getLoginUrl method generates not the type of URL that is described in http://developers.facebook.com/docs/authentication/.
So I was wondering which of these is outdated?
The PHP SDK that you linked is up to date. It is a client for the various Facebook APIs, including the Graph API, the "old" REST API, and others. Right now, getLoginUrl() does generate a URL that has been used for longer than the OAuth documentation has existed, but the end result will be the same for you. If you do have a problem with that login URL for some reason, you're free to implement authentication any way you like by replacing or extending the existing SDK logic.
Remember, APIs and SDKs are not the same thing. The PHP SDK is just one API client. Everything in the official FB docs should be considered up-to-date, as they've all been revamped this year.
OAuth based authentication and Graph Api for data are the latest ones.
http://developers.facebook.com/docs/authentication/
see this also:
http://developers.facebook.com/docs/reference/rest/
The Epi Twitter API files here do all but allow for the oauth_callback URL to be set. Does anyone know the code to add this?
There are plenty of tutorials out there that can show you how to integrate EpiTwitter into your code. What you want to do is pass
"oauth_callback" => "http://www.callbackurl.com"
to the HttpRequest() function as a parameter. I suggest looking through the EpiOAuth.php file and see if you can find where the parameters are passed (hint: look in the function arguments for $params).
Please refer this link or I suggest you to use the Abraham twitter oauth class
Otherwise do following steps:
Write your consumer key and consumer secret in secret.php
Write your Registered OAuth Callback URL in your twitter application (if testing on localhost then write http://127.0.0.1/yourfoldername )
Then run start.php and see the response