tripit / api

TripIt's API Documentation and Support Forum
http://www.tripit.com/developer
Other
47 stars 16 forks source link

The Most Basic Of Requests #240

Open dxfan227 opened 5 years ago

dxfan227 commented 5 years ago

Hello Everyone!

Preface: NOT A DEVELOPER

I am building a MagicMirror. What is that you may ask, essentially it is a "kiosk" hosted on a raspberry pi that displays relevant daily information ( Calendar, Traffic, Bus Schedule) it's then put behind a 2 way mirror to give it a mirror effect and then hung on a wall. NEAT RIGHT?

So I would like to figure out a way to have this display my Upcoming Trips in TRIPIT. Basically just the location and dates. Pretty strait forward.

There are some "plugins" that can be used on the magic mirror that I think might be able to do this, I'm just a little bit lost on connecting the two pieces together. I hope this is not too stupid.

The first plug in will allow me to basically parse a JSON file for the appropriate array. Would this be doable? How do I generate the .json url?

https://github.com/timdows/MMM-JsonTable

I have create an "app" in the trip it developer page.

Thank you

arnpoirier commented 5 years ago

Hi, Yes, it is definitely possible to have access to data in JSON format. For that, you would need to make an API call and then Tripit will respond to your request with data in JSON. You need first to authenticate following the instructions: http://tripit.github.io/api/doc/v1/index.html#authentication_section Once authenticated, you can make an API call that will return you data. As an example, you could create a trip in Tripit and try to pull the data using the API with the GET end point: http://tripit.github.io/api/doc/v1/index.html#method_list I hope this helps.

dxfan227 commented 5 years ago

This is all very new to me so I guess I’ll start question by questions.

Regarding authentication for this, do I need to contact TripIt for the Oauth to be turned on for my account or can I just use my account as is?

On Oct 1, 2019, at 11:58 AM, Arnaud Poirier notifications@github.com wrote:

Hi, Yes, it is definitely possible to have access to data in JSON format. For that, you would need to make an API call and then Tripit will respond to your request with data in JSON. You need first to authenticate following the instructions: http://tripit.github.io/api/doc/v1/index.html#authentication_section http://tripit.github.io/api/doc/v1/index.html#authentication_section Once authenticated, you can make an API call that will return you data. As an example, you could create a trip in Tripit and try to pull the data using the API with the GET end point: http://tripit.github.io/api/doc/v1/index.html#method_list http://tripit.github.io/api/doc/v1/index.html#method_list I hope this helps.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tripit/api/issues/240?email_source=notifications&email_token=AEJ6ZEUTH2KJ4F767WNU4K3QMOMUTA5CNFSM4I3NML32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEACLS2A#issuecomment-537180520, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJ6ZEUAC5YQFPAHAEZBU4LQMOMUTANCNFSM4I3NML3Q.

arnpoirier commented 5 years ago

You can just use your account as is. At the following link http://tripit.github.io/api/doc/v1/index.html#authentication_section, you should go straight to OAuth instead of using the Web Authentication method.

dxfan227 commented 5 years ago

Sigh.

To obtain a request token POST the following request parameters to the URL:

https://api.tripit.com/oauth/request_token This just returns: 401102.100000consumer key not present in request

When I put it into web browser.

On Oct 1, 2019, at 12:43 PM, Arnaud Poirier notifications@github.com wrote:

 You can just use your account as is. At the following link http://tripit.github.io/api/doc/v1/index.html#authentication_section, you should go straight to OAuth instead of using the Web Authentication method.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

arnpoirier commented 5 years ago

It is not going to work directly from a browser, you should use something like Postman instead (https://www.getpostman.com/)

Here is a screenshot of a successful oauth request. You should have got a consumer key and secret when you created an app in Tripit. Postman auto generated timestamp and nonce for me.

2019-10-02_1135
dxfan227 commented 5 years ago

Ok vey.

I’ll give it a shot when I get back to my work station. Thank u

David Ruiz

On Oct 2, 2019, at 5:12 PM, Arnaud Poirier notifications@github.com wrote:

 It is not going to work directly from a browser, you should use something like Postman instead (https://www.getpostman.com/)

Here is a screenshot of a successful oauth request. You should have got a consumer key and secret when you created an app in Tripit. Postman auto generated timestamp and nonce for me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dxfan227 commented 5 years ago

So I used postman with the parameters you mentioned….and it returned an OAuth Token

I am now on step 2

https://www.tripit.com/oauth/authorize?oauth_token=&oauth_callback= I place the token instead of into browser and I get this:

Access Request Failed Please go back to the application or website where you began the process and try again.

arnpoirier commented 5 years ago

You can try an URL like https://www.tripit.com/trips for the oauth_callback.

https://www.tripit.com/oauth/authorize?oauth_token=&oauth_callback=https://www.tripit.com/trips