private apps authentication help

nisha_surf
Shopify Partner
2 0 0

I trying to authentication of my private apps. I got the api key. How do I get the access token? I tried passing the url with parameters(client_id and scope).

But I am getting the error: 
{"error":"invalid_request","error_description":"The Shopify API application does not support oauth"}.

My questions

1.This authentication which I am doing here, Is this right?.

2 I want to build my apps with php, as I know that. Does using rails or any other languages saves time in developing  apps.

3.Any other suggestion if you could give to help me here with shopify apps development. Thank you all.

0 Likes
hj
Shopify Partner
202 0 25

Hi,

1. Private apps don't require an OAuth access token for authentication, you can use a api-key, password combination. For PHP take a look at sandeepshetty's shopify_api library. He also describes how to use the API with private apps:

// For private apps:
// $shopify = shopify_api\client($shops_myshopify_domain, NULL, $api_key, $password, true);

2. You need to distinguish between Ruby and Rails, Ruby is a programming language, Rails is a framework build in Ruby. Ruby's focus is on simplicity and productivity. Rails focus is on convention over configuration.

Personally I think Ruby is a lot cleaner (easier to read) and more powerfull than PHP. Using a framework (like Rails) will you save you a lot of time, because the framework will handle things like persistence, rendering, session-handling, etc.

Using a framework will 'always' save time. But of course getting to know a new framework (and/or a programming language) will cost time. 

3. Well beside the suggestion "I can develop an App for you": both the API documentation and the wiki have a lot of information on developing Apps.

HJ

0 Likes
nisha_surf
Shopify Partner
2 0 0

@hj Thanks :) .. I have started using sandeep's adapter. I want to see of the api calls i made is successful or not..I tried adding a new product. It's getting added up. How do I check the response??

Also if you know any exculsive tutorial for shopiy apps with php,please suggest!!

 

thanks again..

Btw this is the code I am using.

  try
    {
        // All requests accept an optional fourth parameter, that is populated with the response headers.
     $newproduct = array
        (
            "product"=>array
            (
                "title"=>"nisha title",
                "body_html"=>"nisha",
                "vendor"=>"Vendo",
                "product_type"=>"Test nisha"
            )
        );
     
  // All requests accept an optional fourth parameter, that is populated with the response headers.
  $recurring_application_charge = $shopify('PUT', '/admin/products.json', $newproduct, $response_headers);
      

 

    }
    catch (ShopifyApiException $e)
    {
        $err = $e->getInfo();
        echo $err;
        // If you're here, either HTTP status code was >= 400 or response contained the key 'errors'
    }

Thanks again!!! This code works, I want to know if this is successful!! Thank you..

0 Likes
hj
Shopify Partner
202 0 25

Sorry I'm not a PHP expert. You can also use CURL to do some basic API requests, take a look at this Gist.