Disclaimer: I am new to working with APIs
I am working on leveraging gimbals API and am trying to figure out what exactly end points are? I realize that they link to a server, but how exactly are they used in development?
Are the endpoints used to link to specific sources of data?
I am using python(django) and it would be great to understand exactly how access and or change information on gimbals end.
PS- When looking at the gimbal api, I noticed that they have a REST api and some other mobile stuff going on. If I am building a web platform, I would only be interested in the REST API portion correct?
An endpoint in a RESTful API is generally just a URL. The URL represents some kind of resource. If it was an order processing API, the resources would be things like customers, orders, etc.
You interact with these resources by making HTTP requests of various sorts; GET if you want to know the content of a resource, POST if you want to change something, and so on. Have a look at this for basic information on REST and web APIs.
You don't need Django to interact with a RESTful API that someone else provides. All you really need is python's urllib, and maybe the json module, if they're sending the data in JSON. The REST API they provide is probably the main thing they want developers using, but if they have multiple APIs then it's hard to say which one is right for you without understanding the application better.
Related
I'm researching a way to get data from a specific app on the Apple Store with Apple Store Connect API, but I'm having a bit of trouble finding a solution.
Has anyone been able to get app information from the Apple Store? Maybe even get with Python? Example: Ratings, number of downloads
See here.
The main idea is you are going to get yourself KEY_ID, ISSUER_ID and PATH_TO_KEY if you haven't already, then make a REST call with those in the headers and payload, as the requests require a bearer token.
EDIT:
Also I am assuming this app is yours, as of writing I cannot find explicit reference in their documentation to scraping information from apps other than your own, as it targets automating workflows.
It seems like you are looking for this https://developer.apple.com/documentation/appstoreconnectapi/read_app_information.
I've searched on google and have taken a look at the facebook site for the apis, but facebook does not have an official SDK for python. I looked at the third party api for python listed on their site that could be used to communicate with facebook. After having visited their official site and github repository there is a small readme file that shows basic usage, it seems to assume that you are already connected to facebook, and the example at the end of that page shows a cookie example.
The short examples seem easy enough but there is no explaination of anything and i dont find any more documentation about anything else.. there does not seem to be any information about all available methods you can use with the api..where do the people who are using this api get the documentation to find the methods available so they are able to do work with this ?
Since i guess people are pretty tired of signing up for yet another service i would like to offer to sign in with their facebook and twitter accounts (although thats a no no for the ad people who would like to have access to the user profile in order to have targeted words/links that generate revenue). Im using django and have taken a look at the django-facebook api as well but the documentation seems to just point to the github repository which doesnt have any documenation, almost just like the other api pointed out above. Basically i dont find any documenation about how to use the apis except from the small examples.
And like always, i appericiate your time answering this, always nice to add an explaination to any code so the answer is a little more usefull, thanks.
My info might be a little bit out of date as I was working at a startup implementing a Python backend on Google AppEngine that interfaced with Facebook, used FQL, AppEngine datastore etc, about a year and half ago.
There are several third party APIs you can use, for instance, https://github.com/jgorset/facepy or https://github.com/pythonforfacebook/facebook-sdk. The reason there is no 'documentation' on the github site is because it implements access to the API that IS documented on Facebook's developer pages https://developers.facebook.com/docs/graph-api/.
But that is in a perfect world. My experience with the Facebook APIs is that they don't always do what is said on the dev pages. You don't get consistent return data, FB Realtime API not/inconsistently notifying for certain connections (music, movies, books, tv). Unfortunately, I think they have many non-documented APIs that are only available to the big app players.
Where I got my real world working info and learned how to access Facebook using Python was right here on stack overflow.
I've been deciding between Python web frameworks for a project of mine and I've really liked how lightweight, flexible, and concise CherryPy is compared to others. The only problem I'm having is I can't find any documentation on how to distinguish between data sent via GET and via POST.
For example, I don't want users to be able to provide their login credentials through a GET request (http://example.com/login?username=user&password=pass) but, according to CherryPy's tutorial, all data is sent as method parameters, no matter what HTTP method they're sent as. Is there some way to say I only want the POST data or do I have to use MethodDispatcher?
Thanks!
See the docs.
A string containing the HTTP method, such as "GET" or "POST". Set
in the "run" phase.
looks like checking cherrypy.request.method is what you want to do.
I'm sorry but I'm having some trouble implementing Oauth within my app engine python project.
I've been working from http://github.com/tav/tweetapp, but I don't think I have a strong enough grasp on this platform to understand how to implement this class within my main.py I'm building the rest of my app in.
This maybe a feeble attempt, but here is what I have so far:
twa = twitter_auth
client = twa.OAuthClient('twitter')
I've created a source folder within my project called "twitter_auth" and that contains a file within it called "twitter_auth.py" which contains the above linked library, and a file called __ init__.py (no space) which is completely empty.
I really have no idea what to do from here :/
Let me recommend taking a look at the tweepy library and some example tweepy apps. Specifically here: http://github.com/wasauce/tweepy-examples
This shows how to use oauth to authenticate a user: http://github.com/wasauce/tweepy-examples/tree/master/appengine/oauth_example/
As Hagge said, it sounds like your issue is more with the tweetapp library than with App Engine. However, if you would like to know more about OAuth on App Engine and if I may be allowed to link to myself, my two articles on the topic seem to be reasonably popular.
The tweetapp library was a an early prototype for Twitter OAuth on twitter. Tav did the heavy lifting and I deployed the site http://twitteroauth.appspot.com , using some of the tweetapp library. The actual source of that site is here (I need to update the site to point here): http://github.com/ryanwi/twitteroauth
I am still using it in production, but, it has aged and does not work for all API calls. I'd recommend trying a different, more up to date and maintained library as others have mentioned.
But, take a look at the twitteroauth source if you want to try to get a first attempt working.
These two are on Twitter's list
http://github.com/brosner/python-oauth2
http://code.google.com/p/oauth-python-twitter2/
I'm not familiar with that library, but after a quick look and seeing the warning that it is not maintained I'd search for something better. I implemented a simple Twitter connection based on Tornado's auth: see an example of how to make Twitter API calls here (and an authentication example here). In case you don't want to use tipfy, I recommend implementing the python-twitter library in your framework of choice.
How would you query Picasa from a Google App Engine app? Data API or Url Fetch? What are the pros and cons of using either method?
[Edit]
I would like to be able to query a specific album in Picasa and list all the photos in it.
Code examples to do this in python are much appreciated.
Your question is a little off, since the Data API is exposed through RESTful URLs, so both methods are ultimately a "URL Fetch".
The Data API works quite well, though. It gives you access to nearly all the functionality of Picasa, and responses are sent back and forth in well-formed, well-documented XML. Google's documentation for the API is very good.
If you only need access to limited publicly available content (like a photostream) then you can do this at a very basic level by just fetching the feed url and parsing that... but even for that you can get the same data with more configuration options via the Data API URLs.
I'm not sure what code samples you'd like... it really depends what you actually want to do with Picasa.