Get amazon mws usertoken and call mws api - oauth

I'm trying to a build a web application for Amazon sellers. I don't understand how to call Amazon MWS API using oauth calling and get user MWS authtoken like Etsy API.
User Clicks Link
User Signs In
IRP Presents the Agreement
Once Agreed, the key is returned to the MWS token
I've seen several programs do this but I can't find it. There seems to be no documentation on this topic and nobody is talking about it.
How can we implemented IRP?

There is a Ruby on Rails library for that: https://github.com/machineboy2045/omniauth-amazon-mws
If you use other languages, you can translate that library and make your own library for your programming language.

Here you can find the documentation for Amazon API:
http://docs.developer.amazonservices.com/en_US/reports/index.html
and here you can download there code libraries, there is a cool PHP code included:
https://developer.amazonservices.com/gp/mws/api.html/146-6096878-3812927?ie=UTF8&group=bde&section=feeds&version=latest

Related

Stripe Create User Function in Swift

I was just wondering if there was a simple function to create a customer in the Stripe API from my app in Swift? Instead of having to create a manual HTTP post request to my server, "createCustomer.php", and then retrieve the results (This is what I do right now).
I tried to search this up on Google, but I can't seem to find anything. I simply want the user to save their card details for later user, that's why I am in need of creating a customer.
Thanks in advance!
Except for payment information tokenization (which is done via Stripe's iOS or Android SDKs in mobile apps, and Checkout or Stripe.js in web apps), all API requests must be sent from a backend server.
The reason is that aside from token creation, all other API requests must be sent using your secret API key. You cannot embed or share the secret API key with your mobile app in any way, as it would then be possible for an attacker to retrieve it and use it to issue API requests on your behalf.
This is why there is no Swift function to create a customer -- the customer creation must be done from your backend, using the server-side language of your choice.

How to integrate TripAdvisor with IOS APP?

In my app i need to integrate it with TripAdvisor API.
i searched a lot about it, i found this in there website:
https://developer-tripadvisor.com/content-api/
it's actually un useful!.
I didn't find any example or demo for this integration!
Anyone knows how to integrate with TripAdvisor in IOS? Or have any example about it?
thanks
Well, just like most APIs, you first have to get your API key from TripAdvisor. So go to the Request API Access form and fill that out (You have to sign up for Trip Advisor first, or sign in with a Facebook or Google account). They will then contact you with your API key and info.
Now that you have the key, the more interesting part takes place. You can use the app in HTTP requests in your app (Example Here) with the URL of the request you want to make. For example, if I wanted to get results for hotels with my coordinates, I would use this URL:
http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396/hotels?key=<YOUR KEY HERE>
The response would be some JSON code which you can parse with Swift's built-in JSON parser, NSJSONSerialization. With this data, you can now store and make use of what you needed from their API.
To see the full API documentation of all the requests you can do and their details, just visit the TripAdvisor API Documentation.
Hope this helps,
Gabriel

YouTube API from V2 to V3 migration

I'm still using old V2 api and now i get https://youtube.com/devicesupport.
My current request is:
https://gdata.youtube.com/feeds/api/users/{username}/uploads?alt=jsonc&max-results=15&v=2
There is no authentication required to make that call
Question:
Any idea how to achieve the same with new Google V3 API? I check documentation but didn't found answer for that.
I had the same problem with V3 api. I think you can't access videos informations without authentication anymore, but you don't need to use an OAuth to get a snippet from some video or search. I was searching a simple solution for my app, because I just want to request title, thumb and descriptions.
The new url will be:
https://www.googleapis.com/youtube/v3/videosid={VIDEO_ID}&part=snippet&key={YOU_API_KEY}
You need to access google developers console, enable youtube api and your public access key - on credentials (API KEY), so they can relate your app to all requests.
And I found this example in PHP if you need to parse JSON result:
http://www.leenooks.com/php/parsing-youtube-v3-json-with-php-examples.html
I'm still don't know all the limitations of V3, I was using V2 too, but maybe for uploads, or more control for youtube accounts you'll have to use OAuth.
I hope this will help you.

Gmail API with iOS - getting emails

I'm trying to understand how the Gmail API works. My goal is to retrieve a list of all of a user's emails in their inbox, downloaded to an NSArray.
Currently the workflow seems to be as follows:
Authorize my iOS app with OAuth 2.0 using the frameworks provided by Google. I have completed this step and my app can successfully authorize a gmail account.
Download emails:
From the documentation, it seems that this is the API call to show a list of messages:
GET https://www.googleapis.com/gmail/v1/users/userId/messages
My Question:
Would I need to write my own Objective-C wrapper to make this API call to download the messages, or would something like MailCore allow me to do this more easily? As I understand it, this API is in replace of IMAP, which is what MailCore implements.
I understand how to do this in Python, as per the example https://developers.google.com/gmail/api/quickstart/quickstart-python but I don't see how I'd port this code to Objective-C.
The basic workflow is correct and you have multiple ways to achieve what you want:
The Gmail API which is a RESTful API that can be used to access Gmail mailboxes and send mail. The API supports many of the basic operations available through the Gmail user interface like reading, composing, and sending mail. It also lets you manage labels on threads and messages and query for specific messages and threads.
You can write your own Objective-C wrapper around the API to make the correct HTTP request to the differents endpoints described in the API reference but it's a lot of work, you have to write everything you need, error management, validation, etc...
You can use the Google APIs Client Library for Objective-C recommended for accessing JSON-based Google APIs for iOS and Mac OS X applications. This API include support for many Google products including Gmail.
IMAP and SMTP protocols are supported by Gmail and include OAuth 2.0 authorization.
You can use any existing IMAP and SMTP libraries which supports SASL you want and should be compatible with the SASL XOAUTH2 mechanism supported by Gmail. You can use MailCore for example like you suggested.
It seems to me you're looking for the easiest way to interact with Gmail mailboxes so the Gmail API is the best choice for authorized access to a user's Gmail data.
I would go for the Google APIs Client Library for Objective-C so you won't have to write your own wrapper around the API and can use it out of the box.
You saw the python example code to retrieve a page of threads:
threads = gmail_service.users().threads().list(userId='me').execute()
The Google APIs Client Library for Objective-C will give you methods to do the same thing with multiple options like possibility to include the spam & trash folder in results, maximum number of results, search for a thread matching a specific query, etc.
+ (id)queryForUsersThreadsList;
All actions described in the API reference are supported by Google APIs Client Library for Objective-C.

Twitter Application using php?

I need to develope a Twitter application in php,
Requirements are that that my application should get access token from user and then using that access token, my application should be able to get backup of the twitter user tweets, followers list, timeline, messages etc.
I created an application on twitter and got the consumer key and secret.
Please tell me how i start now, and what is the best php library that will be enough for my requirements.
Thanks
The best place to start is http://dev.twitter.com
If you want to really jump into things, check out the listing of PHP libraries that you can use: http://dev.twitter.com/pages/libraries#php
Edit: I also suggest you read everything under Guidelines and Terms, Authentication, and REST API & General on this page: http://dev.twitter.com/doc

Resources