简体   繁体   中英

OAuth authentication in API to connect to ETSY

I am trying to create an API to connect to ETSY and obtain orders information. They require authentication with OAuth.

I am looking for a script that can do the OAuth step relying on an external library, and not on a pre-installed server package, as ipage.com (my current host) does not have the OAuth package installed.

Not sure where you got that code from exactly, but the correct class you want to instantiate is \\OAuth\\OAuth1\\Service\\Etsy . Each service in the library has its own class.

You don't have to look at the individual implementations for connecting users with your app. We already have abstracted that part for you. The easiest way to get you started with the Etsy service is to copy the example .

You can add your key and secret here .

Once the user has approved your app you can start making requests to the service. An example of this can be found here .

From that point on you can simply make requests by doing $etsyService->request('/whatever/you/want/to/get') by choosing the correct path from http://www.etsy.com/developers/documentation .

Probably because etsy did not return a login_url

First, try print_r($req_token) - see if that provides anything useful (like an error message)

Failing that, if $req_token is false, you may want to see if your SSL libraries are up to par. Try a phpinfo(); and check the PHP error log to see if either (1) SSL is not supported for your PHP install or (2) there is an error with the SSL connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM