3

Best title I could come up with, but to clarify, this is the situation:

I am working on a short url-like service which lets users 'log in' with their Twitter account and post stuff. Now this service could be included in applications such as Tweetdeck and the like.

My question is.. how would I make such a connection? What would be the flow to let another app know some sort of token that can be used with my Twitter-app?

Gerben Jacobs
  • 4,515
  • 3
  • 34
  • 56

2 Answers2

1

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.

eggie5
  • 1,920
  • 18
  • 25
  • My problem is.. how do I check that when Tweetdeck says "I have user @raffi here and he wants to make this text into a tweet" that it really is @raffi? – Gerben Jacobs Jun 20 '11 at 15:03
  • so you wanna make a plugin for the tweetdeck app? You want to be able to run some code when somebody post to twitter w/ tweetdeck? – eggie5 Jun 20 '11 at 15:45
  • Not specifically tweetdeck, but other apps should go through me. To make things a little bit clearer: I've made a 'longer tweet' service. And I know twitlonger.com is intergrated in other apps, I want this too. But how should one do this? – Gerben Jacobs Jun 20 '11 at 21:19
  • @Gerben Jacobs: I think I still don't exactly know what you need. You're mentioning the security issues: The user's credentials will get passed to the twitter API at the login. Your service would then either establish an encrypted connection (SSL) or exchange authenticy tokens with the user. A lot of frameworks support authentication ([e.g. Play! framework](http://www.playframework.org/)). To integrate the service into another app, there's no way around writing a plugin for such an app which is the bridge between the app and the service. – Manuel Leuenberger Jun 24 '11 at 09:41
1

Have you looked into Twitter's OAuth Echo implementation? Quoting:

There are four parties involved in this interaction:

  • the User who is using Twitter through a particular, authorized Twitter application
  • the Consumer, or the Twitter application that is attempting to interact with the 3rd party media provider (e.g. the photo sharing site)
  • the Delegator, or the 3rd party media provider; and
  • the Service Provider a.k.a. Twitter itself.

In your case, your service is the Delegator. More info on the documentation.

Arvin
  • 2,272
  • 14
  • 10