api - Dilemma with TripIt integration -


we trying integrate tripit our web application itinerary management. created new app , got api key & secret. want use employee's trip account , retrieve trips & create trip in account. have 1 dilemma, since using api key & secret, can able retrieve trips created in account, want retrieve trips of whoever logged in tripit account, api key.

so in scenario, ask user's trip credentials , there way can trips using api key? viable solution welcome. if clear me flow can able understand.

the (oauth) api key , secret issued application, not specific user account. means application can given permission access user's data. if you've ever worked twitter or facebook apis, tripit's api behaves same.

  1. you register application through tripit (sounds you've got step down)
  2. using sdk of choice, create endpoints in code handle various steps in oauth workflow.

here quick rundown of workflow oauth 1.0, tripit uses.

  • the user begins process of connecting tripit account application
  • your application builds request token url , sends user tripit's oauth dialog, indicating callback_url
  • the oauth dialog (on tripit's site) prompts user accept or decline permissions
  • if approved, return site (callback_url) 'signed' request token part of query string
  • a backend process, typically simple curl request, exchanges request token access token finalize process
  • you store access token associated user in database , use future requests against api

if happen using php, here open source example application take at. not save token database (just keeps in session), should able glean basic idea it.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -