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
Related
I'm making API call for other developers to use, so my question might sound silly but i need the community help. So thanking in advance.
I finished an API call for a web service using this https://github.com/chriskacerguis/codeigniter-restserver. All api calls working perfectly when i test it using postman plugin for chrome.
I've forwarded my API call to an android developer and he was able to use GET methods by using direct URL. now he is asking me to provide direct URL to the POST, PUT and DELETE API call, Which i do not know how to provide.
If for example, this is my API call to use the GET method, http://example.com/api/chemists/2 using the method chemists_GET. How do i get the direct URL to this PUT API call using this method chemists_PUT. like wise chemists_POST and chemists_DELETE method.
Kindly help me.
Yoyu have ki9nd of answered it yourself... with the link you gave...
You're URL's to the endpoints will be as you have them... however you will need to implement the post functions etc as defined in https://github.com/chriskacerguis/codeigniter-restserver#responses that page also described delete and put too...
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.
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 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.
How can I make a simple search on Twitter through PHP, Java, or CURL JSON?
Fetching JSON with Curl:
curl --data-urlencode "q=query here" http://search.twitter.com/search.json
See Twitter's API Reference for more details.
Twitter has a nice REST API for searching. The docs are here:
http://apiwiki.twitter.com/Twitter-Search-API-Method:-search
To search and get JSON back it's as easy as this:
$ curl http://search.twitter.com/search.json?q=stackoverflow
{"results":[{"text":"Saturday night and I'm reading http:\/\/stackoverflow.com\/ #dorkbot","to_user_id":.......
The simplest way? http://twitter.com/#search?q=whatever - then substitute "whatever". You can use HttpClient's HttpGet for that in Java
You can add variations like "search API for user CNN" which would be
http://twitter.com/#search?q=source%3AAPI%20#cnn
If want RSS instead of HTML use (for above query)
http://search.twitter.com/search.atom?q=source%3AAPI%20#cnn
And there's the whole Spritzer API.
$curl 'http://search.twitter.com/search.json?q=ladygaga&rpp=10'
is the simplest twitter command line option ever
$curl 'http://search.twitter.com/search.json?q=ladygaga&rpp=10' > filename.ext
this "pipes" it into a previously non-existent file called filename.ext (I like to think of it as filename.txt "eating" the output).
First, you must register to be a twitter developer to gain access token, access token secret, consumer key, and consumer secret.
After that you can use OAuth to perform curl to the given REST API for search that twitter provide to us.
documentation for search API in dev twittter
Also, you could learn at my simple project on github : Integrate-Services-With-Twitter-API-cURL-PHP