Is there any documentation for the PHP OOP wrapper? I know I am doing
something wrong, but so far I can't find any documentation to help me
sort it out.
I am currently getting a "Invalid API key or permission token
(unrecognized login or wrong password)" error. (trying to run the
product search in the example provided on the download page for the
wrapper).
In the Ruby example, they used a md5 hash and concatenation to come up
with an API Key, but I was assuming that the php wrapper lass took
care of this. (I am also confused because they call that an API-KEY
yet there is one that we are supposed to get from the application
account- which is the one I have been using) So maybe I have that
wrong. Or, maybe it is that I simply wrote the token value from the
$_GET['t'] variable in my database and then have reused that for the
token variable required by the class.
So, since the example on the authentication page uses Ruby I'm not
sure what steps I need to do manually or what the wrapper handles. I
will be happy to read over any documentation or guides, but right now
I am pulling my hair out with this.
Thanks in advance for any help.
I'm not sure what the code above shows me... do you have to start a
session with the class? (If so their example doesn't show that).
I appreciate the efforts to get an answer. I know that I am clearly
doing something wrong, but I don't have much to go on in terms of
diagnosing it.
Thanks again for the help.
On Tue, Dec 13, 2011 at 5:21 AM, L Creek <tillm...@gmail.com> wrote:
>> > Is there any documentation for the PHP OOP wrapper? I know I am doing
>> > something wrong, but so far I can't find any documentation to help me
>> > sort it out.
--
Sandeep Shetty
Founder, Simpthings
http://simpthings.com/
http://sandeep.shetty.in/p/about.html
I think it is the only one that said it was OOP
On Dec 12, 5:03 pm, Sandeep Shetty <sandeep.she...@gmail.com> wrote:
> Which PHP OOP wrapper are you using?
>
There's two listed here:
http://wiki.shopify.com/Shopify_App_Development#.E2.80.9CI.E2.80.99m_a_PHP_developer.E2.80.9D
and then there is the older php adapter from Shopify (which is what
Harold was talking about I'm guessing).
The one your using is a fork of mine (non-OO):
https://github.com/sandeepshetty/shopify.php
I'll look into it and see if I can find the issue till Colin (the
author of the OO fork your using) kicks in.
Yes: https://github.com/cmcdonaldca/ohShopify.php/blob/master/shopify.php#L44
$sc = new ShopifyClient($shop_domain, $token, $api_key, $secret);
$products = $sc->call('GET', '/admin/products.json',
array('published_status'=>'published'));
If your using the above code then $api_key and $secret are the "API
Key" and "Shared Secret" respectively which you'll get from the
partners interface for your app. The $token is what you receive on
your return url (which you need to configure in the partners interface
for your app) when a shop installs your app, and $shop_domain is the
something.myshopify.com domain of the shop that installed your app
(which you again received on the return url). Sometimes you do not
receive the .myshopify.com domain and instead get the shops custom
domain so you should always retrieve the shops details
(http://api.shopify.com/shop.html) on installation to get the
.myshopify.com domain.
I am using the lines of code you have above. (the ones from the
example on the github page)
I am submitting the .myshopify.com domain, and the token provided by
the responding URL (from authorization redirect). I grabbed the
ApiKey and Shared Secret variables from the partner page as you
mentioned.
So I am not sure why I am getting unauthorized errors. What can I do
to try and diagnose what I am doing wrong... have no idea how to
troubleshoot this since I can't see any difference from what I (think)
I am sending versus what you have outlined.
On Dec 12, 6:05 pm, Sandeep Shetty <sandeep.she...@gmail.com> wrote:
There was a trailing space in my api-key, I didn't even notice it
until I output it in quotation marks, just to check.
Fixed that, and my products showed up.
Thank you so much for the help (I would have gone off in the wrong
direction had you not help me narrow down that if I had the right
coding, It had to be the formatting of the data I was passing)
Again... I appreciate you taking the time to help me solve my own
stupid error!
On Dec 12, 6:05 pm, Sandeep Shetty <sandeep.she...@gmail.com> wrote: