Difference between RSS and Web API? - objective-c

I have searched a lot on web to find a satisfactory answer but I did't get an answer.
Some says RSS is static xml while in web API we make a proper format of request and get a proper format of response
Kindly help me on this
thanks,

The reason RESTful APIs are so inconsistent across different services is because REST is not a standard, it's not a protocol. It's an architectural style. Some things to take into consideration for your API would be; what HTTP verbs to support, what URI structure to follow, how to consistently return error messages, how to handle partial selection, versioning, authentication, pagination, and so on and so forth.. There is no specific right way of doing it (it's debated often), but there are many ways that are not so great!
RSS stands for Really Simple Syndication, which is essentially a format for delivering regularly changing web content. RSS feeds allow a user to subscribe to their favorite news sources, blogs, websites, and other digital properties, and then receive the latest content from all those different areas or sites in one place, without having to repeatedly visit each individual site.

Your question sounds like "What difference is between Ford Focus and a taxi service?" Ford Focus can be one of the cars in a taxi service. But nothing more.
RSS is a standard, which describes specific format of news feed. You can have a standalone locally stored RSS-formatted file, remote stored RSS-file somewhere on a server, or you can have a web-service which constructs RSS-formatted file on the fly. It will be RSS in all three cases because RSS is something that describes internal structure of a file.
Web Service is, basically, an application which runs somewhere on a server, accepts requests, processes it according to the application's internal logic, and then provides answers. Web service can take any kind of requests and provide any kind on responses, including RSS-formatted ones.
Hope that makes things a bit clearer for you.

We will be using RSS as broadcasting channel, who ever wants to know what's happning in my Company can follow my company website's RSS feed.

Related

Is there a REST API documentation that only publishes the root URL?

I´m trying to design a REST API for my application and I read a lot about best practices and how REST is supposed to work. One of the most important topics about REST is, that the resources should be linked via references and the client should only know the root URL of the API.
But I cannot find any API documentation that really does this. Every REST API documentation I ever read on the web shows an exact description of the URLs of the possible endpoints.
Is there any API documentation out there that only shows the root URL and describes how to navigate through the resources?
One of the most important topics about REST is, that the resources should be linked via references and the client should only know the root URL of the API.
The root URL and the media types, yes. The client needs to know where to start, and also how to interpret the responses it gets.
Your primary example of a REST API would be the world wide web. You point your browser at www.google.com, and then you just follow links and submit forms until you get the result you want.
Another REST API that might be familiar is Atom Syndication / Atom Pub.
More academically, there is RESTBucks. That paper was somewhat popular, and you can find a number of sample implementations around.
Jon Moore (2011) presented a good demonstration of a hypermedia API.
Every REST API documentation I ever read on the web shows an exact description of the URLs of the possible endpoints.
Yes; bad examples are much more common than good examples.

Can client side mess with my API?

I have a website that revolves around transactions between two users. Each user needs to agree to the same terms. If I want an API so other websites can implement this into their own website, then I want to make sure that the other websites cannot mess with the process by including more fields in between or things that are irrelevant to my application. Is this possible?
If I was to implement such a thing, I would allow other websites to use tokens/URLs/widgets that would link them to my website. So, for example, website X wants to use my service to agree user A and B on the same terms. Their page will have an embedded form/frame which would be generated from my website and user B will also receive an email with link to my website's page (or a page of website X with a form/frame generated from my server).
Consider how different sites use eBay to enable users to pay. You buy everything on the site but when you are paying, either you are taken to ebay page and come back after payment, or the website has a small form/frame that is directly linked to ebay.
But this is my solution, one way of doing it. Hope this helps.
It depends on how your API is implemented. It takes considerably more work, thought, and engineering to build an API that can literally take any kind of data or to build an API that can take additional, named, key/value pairs as fields.
If you have implemented your API in this manner, then it's quite possible that users of this API could use it to extend functionality or build something slightly different by passing in additional data.
However, if your API is built to where specific values must be passed and these fields are required, then it becomes much more difficult for your API to be used in a manner that differs from what you originally intended.
For example, Google has many different API's for different purposes, and each API has a very specific number of required parameters that a developer must use in order to make a successful HTTP request. While the goal of these API's are to allow developers to extend functionality, they do allow access to only very specific pieces of data.
Lastly, you can use authentication to prevent unauthorized access to your API. The specific implementation details depend largely on the platform you're working with as well as how the API will be used. For instance, if users must login to use services provided by your API, then a form of OAuth may suffice. However, if other servers will consume your API, then the authorization will have to take place in the HTTP headers.
For more information on API best practices, see 7 Rules of Thumb When You Build an API, and a slideshow from a Google Engineer titled How to Design a Good API and Why That Matters.

WCF examples for receiving (consuming) data feeds

All the example WCF feed services that I can find are all about generating a feed. What about consuming a feed? Does anyone have any links to examples, or discussions, on a WCF service (.net 4.0 preferably) that can accept an Atom or RSS formatted data feed? I don't need to generate the feed, I need to accept it, validate it, stick the data into a variety of back end systems (DB, Solr, file system). And by accept, I don't mean I go call some service that returns Atom or RSS, I need to let people Post Atom or RSS to me.
I'm currently looking at having a service that accepts a string, then loads that string into some Syndication objects...but that seems clunky. I'm really amazed that there is no one out there needing to do this, which makes me think I'm doing something hinky.
What about a WCF Data Service (RESTful wcf) that only accepts Add, Update, Delete and not Get. I can find no example of that, and it seems like I'd be breaking some major coding standard if I did it.
Any suggestions, links, ideas, alternate designs would be helpful.
Thanks,
Ken
Re: James' request for more info. I am writing a service that will allow multiple, different, data sets to be posted to it. Similar to GoogleBase. There is a loose definition of the data, but a lot of the individual fields are dynamically defined. Other than a standard format (Atom and RSS) and 1 or 2 required fields, the rest is user defined. What I've done so far is have a Service that accepts an XElement argument. I can then determine at runtime if that XElement is RSS, ATOM, or POX, then I process accordingly. I just wasn't sure if XElement is SOAP and REST and CLR friendly all at once. I was also trying to see if there were more standard ways of doing this. If a service that emits data feeds (this is the primary example available) is like a sun, I'm writing the black hole equivalent. It's a data black hole service to help our partners keep us up to date on any changes to their data that we need to be aware of.
Not sure if you are still looking for the answer, i hope not :-)
I was looking for the same thing. Please have a look at the link below. It helped me and it may help someone else also.
http://blog.jschlesinger.net/2009/09/consume-rss-feed-with-wcf-rest-starter.html
Although in the above link the author used program.cs but it is possible to write same code in the WCF service method and expose it.

What should a developer know before building an API for a community based website?

What things should a developer designing and implementing an API for a community based website know before starting the heavy coding? There are a bunch of APIs out there like Twitter API, Facebook API, Flickr API, etc which are all good examples. But how would you build your own API?
What technologies would you use? I think it's a good idea to use REST-like interface so that the API is accessible from different platforms/clients/browsers/command line tools (like curl). Am I right? I know that all the principles of web development should be met like caching, availability, scalability, security, protection against potential DOS attacks, validation, etc. And when it comes to APIs some of the most important things are backward compatibility and documentation. Am I missing something?
On the other hand, thinking from user's point of view (I mean the developer who is going to use your API), what would you look for in an API? Good documentation? Lots of code samples?
This question was inspired by Joel Coehoorn's question "What should a developer know before building a public web site?".
This question is a community wiki, so I hope you will help me put in one place all the things that should be addressed when building an API for a community based website.
If you really want to define a REST api, then do the following:
forget all technology issues other than HTTP and media types.
Identify the major use cases where a client will interact with the API
Write client code that perform those "use cases" against a hypothetical HTTP server. The only information that client should start with is the response from a GET request to the root API url. The client should identify the media-type of the response from the HTTP content-type header and it should parse the response. That response should contain links to other resources that allow the client to perform all of the APIs required operations.
When creating a REST api it is easier to think of it as a "user interface" for a machine rather than exposing an object model or process model. Imagine the machine navigating the api programmatically by retrieving a response, following a link, processing the response and following the next link. The client should never construct a URL based on its knowledge of how the server organizes resources.
How those links are formatted and identified is critical. The most important decision you will make in defining a REST API is your choice of media types. You either need to find standard ways of representing that link information (think Atom, microformats, atom link-relations, Html5 link relations) or if you have specialized needs and you don't need really wide reach to many clients, then you could create your own media-types.
Document how those media types are structured and what links/link-relations they may contain. Specific information about media types is critical to the client. Having a server return Content-Type:application/xml is useless to a client if it wants to do anything more than parse the response. The client cannot know what is contained in a response of type application/xml. Some people do believe you can use XML schema to define this but there are several disadvantages to this and it violates the REST "self-descriptive message" constraint.
Remember that what the URL looks like has absolutely no bearing on how the client should operate. The only exception to this, is that a media type may specify the use of templated URIs and may define parameters of those templates. The structure of the URL will become significant when it comes to choosing a server side framework. The server controls the URL structure, the client should not care. However, do not let the server side framework dictate how the client interacts with the API and be very cautious about choosing a framework that requires you to change your API. HTTP should be the only constraint regarding the client/server interaction.

Generating iTunes podcast feed with WCF

How do you make an iTunes podcast feed with WCF? Or do you know of a complete example that actually works?
I've reached the point where I corrected all errors and warnings[1] marked by feedvalidator.org and also included all the iTunes custom tags I could and iTunes still claims it's a broken feed (obviously giving no useful information about it).
[1] I haven't solved two warnings: one is that the address of the podcast is not consistent, because I'm running it on localhost, and the other that I am using namespaces for the atom embedded tags when producing an RSS, for which there's no work around using WCF.
Looks like this user was able to get it working: How do you add another namespace to WCF SyndicationFeed?
Hope that helps.
I believe WCF is a communications framework that uses SOAP, and is meant for something more like Web Services, rather than hosting an XML file. Even if it is possible, WCF is probably not the right way to do what you're trying to do.
Edit: Uninformed opinions do not make good answers. Forget I said anything!