{"id":3732,"date":"2023-05-27T10:02:59","date_gmt":"2023-05-27T08:02:59","guid":{"rendered":"https:\/\/www.commercers.com\/blog\/?p=3732"},"modified":"2023-06-04T06:19:58","modified_gmt":"2023-06-04T04:19:58","slug":"step-by-step-guide-setting-up-magento-oauth-1-0-integration-with-postman","status":"publish","type":"post","link":"https:\/\/www.commercers.com\/blog\/step-by-step-guide-setting-up-magento-oauth-1-0-integration-with-postman\/","title":{"rendered":"Step-by-Step Guide: Setting Up Magento 2 OAuth 1.0 Integration with Postman"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Getting Started:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Magento has established itself as the leading platform for building robust and scalable online stores in the world of e-commerce. Magento provides online merchants with the tools they need to succeed in the digital marketplace with its extensive set of features and flexibility. One of the key aspects of Magento is its OAuth 1.0 Authentication Protocol, which helps ensure that different applications communicate with each other in a secure manner. In this blog post, we will use Postman, a popular API testing and development tool, to explore how to connect Magento 2 OAuth 1.0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OAuth 1.0 Understanding:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">OAuth (Open Authorization) is an open standard protocol. It provides secure and delegated access to protected resources. It allows users to grant third-party applications limited access to their resources without sharing their credentials. OAuth 1.0 uses a signature-based method to authenticate requests and is the predecessor to OAuth 2.0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Magento 2 OAuth 1.0 setup:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To get started, you&#8217;ll need a running Magento 2 installation. Here are the steps to set up Magento 2 OAuth 1.0:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a new consumer:<\/strong>&nbsp;In your Magento admin panel, navigate to <code>\"System\" \u2192 \"Extensions\" \u2192 \"Integrations\"<\/code>. Click on <code>\"Add New Integration\"<\/code> and provide the necessary details such as the integration name, callback URL and permissions.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.07.28%20AM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.14.50%20AM.png\" alt=\"Step 2\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.15.08%20AM.png\" alt=\"Step 3\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li><strong>Generate OAuth credentials:<\/strong>&nbsp;Once the integration is created, Magento 2 will generate the OAuth credentials, including the consumer key and secret. Make sure you store these credentials securely.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.18.43%20AM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.21.53%20AM.png\" alt=\"Step 2\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.22.06%20AM.png\" alt=\"Step 3\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Postman Configuration:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Postman simplifies the process of developing and testing APIs. To configure Postman for Magento OAuth 1.0, follow these steps<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install and run Postman:<\/strong>&nbsp;Download and install Postman on your system. Launch the application to continue.<\/li>\n\n\n\n<li><strong>Create a new request:<\/strong>&nbsp;Click on the <code>'New'<\/code> button in the Postman interface to create new <code>'HTTP Request'<\/code>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.34.20%20AM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Set up the OAuth 1.0 authorisation:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter the request URL: Enter the endpoint URL of the Magento API you wish to interact with.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2011.59.26%20AM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the <code>'Authorisation'<\/code> tab, select <code>'OAuth 1.0'<\/code> as the type.<\/li>\n\n\n\n<li>Enter the Magento OAuth 1.0 credentials you have previously obtained: <code>Consumer key, Consumer secret, Access token and Token Secret<\/code>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2012.01.03%20PM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li><strong>Submit the request:<\/strong>&nbsp;Click the Send button to execute the request. Postman will automatically handle the OAuth 1.0 signature generation and authentication process.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2012.07.25%20PM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">API Reference<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Get Product by sku<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  GET \/rest\/V1\/products\/{{sku}}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>{{sku}}<\/code><\/td><td><code>string<\/code><\/td><td><strong>Product sku<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2012.07.25%20PM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Get Customer by id<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  GET \/rest\/V1\/customers\/{{customer_id}}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>{{customer_id}}<\/code><\/td><td><code>int<\/code><\/td><td><strong>Customer ID<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2012.15.38%20PM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Get Order by id<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  GET \/rest\/V1\/orders\/{{order_id}}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>{{order_id}}<\/code><\/td><td><code>int<\/code><\/td><td><strong>Order ID<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/s3.commercers.vn\/commercers-blog\/Screen%20Shot%202023-05-27%20at%2012.16.53%20PM.png\" alt=\"Step 1\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For more detailed information on additional API endpoints, you can refer to the Magento documentation using the link below:&nbsp;<a href=\"https:\/\/developer.adobe.com\/commerce\/webapi\/rest\/quick-reference\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developer.adobe.com\/commerce\/webapi\/rest\/quick-reference\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting Started: Magento has established itself as the leading platform for building robust and scalable online stores in the world of e-commerce. Magento provides online merchants with the tools they need to succeed in the digital marketplace with its extensive set of features and flexibility. One of the key aspects of Magento is its OAuth&#8230;<\/p>\n","protected":false},"author":49,"featured_media":3736,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-allgemein"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/posts\/3732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/comments?post=3732"}],"version-history":[{"count":5,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/posts\/3732\/revisions"}],"predecessor-version":[{"id":3743,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/posts\/3732\/revisions\/3743"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/media\/3736"}],"wp:attachment":[{"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/media?parent=3732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/categories?post=3732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.commercers.com\/blog\/wp-json\/wp\/v2\/tags?post=3732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}