cancel
Showing results for 
Search instead for 
Did you mean: 

how to integrate API of product

SOLVED

how to integrate API of product

Hello there,

 I am new at Magento and I want to know that how to start with Magento and how to integrate the API of product. And is necessary to install the Magento admin panel. Please, let me clear the things related to Magento and how to get integrate the API.

And if we install the magento admin panel then with that we have to add php and apache in our system.

Any response related to this is very useful for me.

Thank You.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to integrate API of product

Hi @harshita_chouhan

 

I think you still have some misconfiguration with the Ubuntu !!

 

Refer below links for the same

 

https://www.mageplaza.com/kb/magento-2-404-page-not-found.html

 

https://magento.stackexchange.com/questions/133679/404-not-found-error-for-admin-page

 

https://stackoverflow.com/questions/40190874/magento2-admin-404

 

Might be one of link ,  helps you !! 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

35 REPLIES 35

Re: how to integrate API of product

Hi @harshita_chouhan

 

Welcome to the community forums.

 

This community forums is a very good platform to ask the questions and try to help others.

You can also find related information on StackExchange and you can start diving into the http://devdocs.magento.com/


You can get idea about already reported/existing issue from Github: https://github.com/magento/magento2/issues

 

Coming back to your questions related to magento - yes if you would like to use API of Magento , then you must need to install magento.

 

Second thing if you would like to install magento then -  yes you required complete LAMP/WAMP server setup/technologies to install this , Refer this link how to install magento 2 - http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html

 

If you want to know about how to use Rest api , magento itself have very good article on devdocs refer this link - https://devdocs.magento.com/guides/v2.2/get-started/rest_front.html

 

Also to know all the touch points of magento 2 rest api , magento have platform called swagger where all the touch points related to magento 2 defined refer this link - http://devdocs.magento.com/swagger/

 

Hope this helps !! Smiley Happy

 

 

 

if issue solved,Click Kudos & Accept as Solution

Re: how to integrate API of product

Hello @Manthan Dave,

Thanks for your response,

          Yes your solution based on the further installation of Magento, and for that the php, apache and mysql these installation is necessary.

But in the Artificial Intelligence is grow up now. And for integrate the API for products we have to install all this things is just a waste of time. 

So please can you tell us that, Is there any way to configure Magento ONLINE and we have to integrate the URL for products. 

Don't take me otherwise,  I need to confirm that if we install all these things in our system and in future if we have to integrate the products of another seller than again we have to install all this things. 

So please if there is any online site to integrate magento products than give us a clear and valid solution by which we integrate the products of one or more seller. 

And if it is not available so give me a description by which I understood that we have to Integrate the other seller product and order in single installation.

 

Thank You Again,

Any Suggestion Regarding this is very helpful :-) 

 

Re: how to integrate API of product

Hi @harshita_chouhan

 

okay i understand your concern !! but AKAIK there is no online site from where you can directly use magento 2 rest api and integrate with your AI tool.

 

i understand the situation you mention , but you can do one thing like on your stand alone server (Which is separate) not related to AI tool , you can install magento 2 there and used magento 2 rest api into AI.

 

if new seller come then you don't need to install everything again in it , Magento itself have multi-site concept in it so you can use that as well , or you can create custom code for seller so you can use seller wise inventory as well. there are couple of third party market place module available  also multi ware house kind of stuff available so you can choose any of them based around your business nature.

 

Even though you found some magento 2 demo online , but you can't use its product as every one have needed their own inventory and catalog , if you don't want to installed anything Magento does provide - Magento Cloud Commerce service with different packages so you can look for that as well.

 

Hope this is helpful for you Smiley Happy

 

 

if issue solved,Click Kudos & Accept as Solution

Re: how to integrate API of product

Hello @Manthan Dave,

Thanks for response,

So, if I get install Magento after that i can integrate the API related to products and orders.

And the Authentication Token is also get from Magento, when its installation is done. 

Could you please give me the step wise detail, in Magento from where I got the Authentication Password for access any API .

Thanks Again,

I appreciate for your quick response... :-)

Re: how to integrate API of product

Hi @harshita_chouhan

 

Indeed !! that is correct , after installation of magento 2 - you will get Authentication token for your rest API.

 

you can get magento 2 , API token from two ways , here i am sharing a link with you which is written by magento itself for how to use api and get the access token - http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html

 

if my answer details is helps you click on kudos button and accept as solution

 

if issue solved,Click Kudos & Accept as Solution

Re: how to integrate API of product

Hello @Manthan Dave,

I have done all the installation which is necessary for the Magento. Now, could you please tell me that the "Encryption key" which i get from the Magento admin panel , how i used it for integrate API. I used Sublime editor and meteor framework than how I integrate the API.

Give the structure format for URL and how I add HTTP header in my code to integrate the APIs.

 

Thank You

Re: how to integrate API of product

Hi @ashish_kumar6

 

Glad to know that you have successfully installed magento 2 !!

 

to access the rest api first you need to get the admin token first.

 

below is the code the get the admin access token 

 

//Authentication rest API magento2.Please change url accordingly your url
$adminUrl='http://127.0.0.1/magento2/index.php/rest/V1/integration/admin/token';
$ch = curl_init();
$data = array("username" => "wsuser", "password" => "password123");                                                                    
$data_string = json_encode($data);                       
$ch = curl_init($adminUrl); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string))                                                                       
);       
$token = curl_exec($ch);
$token=  json_decode($token); 
echo $token;
exit;

 

Refer this link for more details - http://devdocs.magento.com/guides/v2.2/get-started/order-tutorial/order-admin-token.html

if issue solved,Click Kudos & Accept as Solution

Re: how to integrate API of product

Hello @Manthan Dave,

 I want to know that if I was not install the magento2 in my system and regarding magento2 not done any type of installation like(apache2, php7.0, mysql-server) but I have the URL and Token which I taken from someone else.

So, here I want to confirm that if I don't install magento2 than I integrate the API of products and orders in my PC by the token and URL which I get from someone.

It will give 400 error. Is it because I have not been install magento2..?

Please clear my doubt.

Thank You,

Regards Har**bleep**a

Re: how to integrate API of product

Hi @harshita_chouhan

 

Yes , now you are correct !!

 

Suppose if i have installed magento 2 on my server and if i share URL with access token to you - and give full permissions to that access token user.

 

Then definitely you can get/access products , catalogs etc.

 

There is no issue occurs with that. 

if issue solved,Click Kudos & Accept as Solution