All the different systems communicate with each other using a set of APIs. Optimally, there would be a standard form of communication (REST/SOAP,etc) however each service my use a different set of technologies to implement their public API.
For example twitter has a public API that you must learn to interact w/ their system from your system. And tweetdeck may have to interact w/ twitter too and must use twitters well defined scheme to do this.
Your question is a little vague, but the flow is basic. Say for example someone wants to communicate w/ your system. You need to provide a document describing how a 3rd party may do so, and you need to impoliment that system. Like I mentioned before, there is REST - this is popular today or there is SOAP. Then the user would simply do a request to a url you define. Example user wants to create a widget on your service (REST Example):
User does HTTP post to http://myapi.com/widgets/
with the attributes for a widget inthe post body.
user wants to get all widgets: HTTP GET to http://myapi.com/widgets
would return a list of widgets.
This is the basic idea, you just need to design some authentication. Some just use basic auth and some use oath.