|
| 1 | +# Getting started |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Before you start planning and developing your App, it's essential to understand what Akeneo apps do and how they fit into Akeneo PIM. |
| 6 | + |
| 7 | +### What's an Akeneo app? |
| 8 | + |
| 9 | +An Akeneo App connects Akeneo PIM with third-party solutions. They can be easily connected directly from within PIM, with a streamlined process of activation and configuration. |
| 10 | + |
| 11 | +Most Akeneo apps are built by third-party developers, not by Akeneo. |
| 12 | + |
| 13 | +You can build an app to pull Akeneo data into your App to adapt and distribute it to external services, like e-commerce platforms or marketplaces. You can also push data to enrich the Akeneo PIM with translations, ERP data, assets, data pool content, or other sources. |
| 14 | + |
| 15 | +To tailor experiences to their specific needs, Akeneo users connect Akeneo apps to integrate with external services and improve how they collect, enrich and distribute their data. |
| 16 | + |
| 17 | +<img class="img-responsive in-article" alt="What's an app schema" src="../img/apps/whats-an-app.png" style="width: 500px;"> |
| 18 | + |
| 19 | + |
| 20 | +### How apps fit into Akeneo PXM Studio? |
| 21 | + |
| 22 | +Apps integrate with Akeneo in the following ways: |
| 23 | + |
| 24 | +- using OAuth2.0 protocol to connect with Akeneo |
| 25 | +- using app catalogs to provide a consistent experience to users |
| 26 | +- connecting with our REST API to read and write Akeneo data |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +::: info |
| 31 | +For more information on Apps usage, please read our help center articles |
| 32 | +[How to connect Akeneo PIM with third parties](https://help.akeneo.com/pim/serenity/articles/how-to-connect-my-pim-with-apps.html) |
| 33 | +and [Manage your Apps](https://help.akeneo.com/pim/serenity/articles/manage-your-apps.html). |
| 34 | +:::: |
| 35 | + |
| 36 | + |
| 37 | +### Why apps over connectors? |
| 38 | + |
| 39 | +Both connectors and Apps use the OAuth standard. However, there are some significant differences. |
| 40 | + |
| 41 | +**AUTOMATIC CONFIGURATION INSTEAD OF MANUAL CONFIGURATION** |
| 42 | + |
| 43 | +***Connectors use Akeneo PIM connections to get credentials*** |
| 44 | + |
| 45 | +The user who connects Akeneo PIM with a connector must create a connection and manually configure authorizations and permissions. Then, they copy/paste generated API credentials from the PIM UI to the connector. |
| 46 | + |
| 47 | +***Apps use the Connect feature*** |
| 48 | + |
| 49 | +When a user connects Akeneo PIM with an App, they click on Connect then follow the step-by-step activation process to accept requested authorizations and set up permissions. The App receives everything it needs to interact with Akeneo PIM at the end of this process. No more manual configuration issues and more transparency! |
| 50 | + |
| 51 | +**HIGH VISIBILITY** |
| 52 | + |
| 53 | +We give your App high visibility when you publish an App on the [Akeneo App Store](https://apps.akeneo.com/). Your App is displayed ***above all connectors***. We also give high visibility to Apps to our Akeneo PIM users. To do so, we created a ***dedicated section*** to highlight them in the PIM App Store. |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +**THIS IS JUST THE BEGINNING!** |
| 59 | + |
| 60 | +Akeneo promotes Apps and will communicate about new Apps published on the Akeneo App Store. |
| 61 | + |
| 62 | +Akeneo teams are also investing in Apps by developing new features for you to ease and accelerate App development and publication in the coming years. |
| 63 | + |
| 64 | +And we are going to need your input so get ready to hear about us! 🎙️ |
| 65 | + |
| 66 | +### Next steps |
| 67 | + |
| 68 | +- Learn how to [create an app](/apps/apps-getting-started.html#create-an-app) |
| 69 | +- Read our documentation about [authorization and authentication](/apps/authentication-and-authorization.html) |
| 70 | +- Learn how to use [catalogs](/apps/catalogs.html) to retrieve product data |
| 71 | + |
| 72 | +<!------------------------------ end of the Overview ------------------------------------> |
| 73 | + |
| 74 | +## Create an app |
| 75 | + |
| 76 | +You're ready to create a new app. You want to set up your development environment so that you can start coding. |
| 77 | + |
| 78 | +In this tutorial, we provide a guide on how to implement the required parts of your App for the activation process based on OAuth 2.0 with Authorization Code. |
| 79 | + |
| 80 | +At the end of this tutorial, your App will receive an Access Token and will be able to call the REST API of a PIM. |
| 81 | + |
| 82 | +::: info |
| 83 | +Please go to our [REST API Reference page](/api-reference-index.html) to learn more about our REST API endpoints. And if you want to know more about response codes, pagination, filters, or get troubleshooting information, go to the REST API basics page. |
| 84 | +::: |
| 85 | + |
| 86 | +### What you will learn |
| 87 | +In this tutorial, we provide a guide on how to implement the required parts of your App for the activation process based on OAuth 2.0 with Authorization Code. |
| 88 | +At the end of this tutorial, your App will receive an Access Token and will be able to call the REST API of a PXM Studio. |
| 89 | + |
| 90 | +::: warning |
| 91 | +Examples in this tutorial use languages without any framework or library and, consequently, don't follow all the recommended best practices. |
| 92 | +We strongly encourage you to adapt those examples with the framework or library of your choice. |
| 93 | +::: |
| 94 | + |
| 95 | +::: tips |
| 96 | +Reminder: our documentation is [open-source](https://github.com/akeneo/pim-api-docs). |
| 97 | +Feel free to contribute with languages we're not experts at. |
| 98 | +::: |
| 99 | + |
| 100 | +### Requirements |
| 101 | +- You have a Partner account and a developer sandbox |
| 102 | +- You understand [what's an Akeneo App](/apps/apps-getting-started.html#whats-an-akeneo-app) and [how they fit into Akeneo PXM Studio](/apps/apps-getting-started.html#how-apps-fit-into-akeneo-pxm-studio) |
| 103 | + |
| 104 | +### Step 1: Expose your activation and callback URLs |
| 105 | + |
| 106 | +First, your application must expose an **activation URL**. |
| 107 | + |
| 108 | +In our example, we won't do additional steps (like authentification), so we will launch the Authorization Request immediately in this Activation URL. |
| 109 | + |
| 110 | +!!!include(content/apps/create-app/activate-php.md)!!! |
| 111 | +!!!include(content/apps/create-app/activate-nodejs.md)!!! |
| 112 | +!!!include(content/apps/create-app/activate-python.md)!!! |
| 113 | +!!!include(content/apps/create-app/activate-java.md)!!! |
| 114 | + |
| 115 | +Then, your application must expose a **callback URL**. |
| 116 | + |
| 117 | +!!!include(content/apps/create-app/callback-php.md)!!! |
| 118 | +!!!include(content/apps/create-app/callback-nodejs.md)!!! |
| 119 | +!!!include(content/apps/create-app/callback-python.md)!!! |
| 120 | +!!!include(content/apps/create-app/callback-java.md)!!! |
| 121 | + |
| 122 | +::: info |
| 123 | +You can find more information about the authorization process and code challenge in the following documentation. |
| 124 | +- [Step 2: Ask for authorizations](/apps/authentication-and-authorization.html#step-2-ask-for-authorizations) |
| 125 | +- [What's the code challenge?](/apps/authentication-and-authorization.html#whats-the-code-challenge) |
| 126 | +::: |
| 127 | + |
| 128 | +### Step 2: Get a public URL for your in development App |
| 129 | + |
| 130 | +Before proceeding to step 4 create a test App in your developer sandbox, you will need valid URLs to your App. This can be easily resolved with a tunnel to your localhost. |
| 131 | + |
| 132 | +There are several ways to create a tunnel to your localhost such as **localhost.run** or **ngrok**. We will use [localhost.run](https://localhost.run/) for its free and easy setup. |
| 133 | + |
| 134 | +#### Initiate localhost tunnel |
| 135 | + |
| 136 | +Initiate localhost tunnel using the following command: |
| 137 | + |
| 138 | +```shell |
| 139 | + |
| 140 | +ssh -R 80:localhost:8080 localhost.run |
| 141 | +``` |
| 142 | + |
| 143 | +The command above assumes that your local App is available on port 8080 but you can specify any port you want. |
| 144 | + |
| 145 | + |
| 146 | +#### Extract URL from the output |
| 147 | + |
| 148 | +If everything goes well the command will output your public URL for your local app: |
| 149 | + |
| 150 | +```shell |
| 151 | + |
| 152 | +46672a93dd64.lhrtunnel.link tunneled with tls termination, https://46672a93dd64.lhrtunnel.link |
| 153 | +``` |
| 154 | + |
| 155 | +Your local app is now available at `https://46672a93dd64.lhrtunnel.link`. You may now use it for your development. |
| 156 | + |
| 157 | +### Step 3: Get your test app credentials |
| 158 | + |
| 159 | +To get credentials for your app, you need to create a test app on your developer sandbox. |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | +To create a test App: |
| 164 | +1. Go to `Connect`, then `App Store` |
| 165 | +2. On the top right corner, click on `Create a test App` |
| 166 | +3. Fill in all the required information |
| 167 | +4. Then click on `Create` |
| 168 | +5. Copy/paste credentials in your app configuration file |
| 169 | +6. And click on `Done` |
| 170 | +7. Your test App appears on the App Store page |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +If you don't see the `Create a test App` button, please enable the `developer mode`. |
| 176 | +To do so, you need to: |
| 177 | +1. Go to `System`, then `Roles` |
| 178 | +2. Choose the role you use for your user |
| 179 | +3. In the `Permissions` tab, scroll down and search for the `Developer mode` submenu |
| 180 | +4. Select `Manage test apps` |
| 181 | +5. Don't forget to save your modifications |
| 182 | + |
| 183 | + |
| 184 | +### Step 4: Connect your test App and access its settings |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | +Connecting a test App is like connecting a published App. |
| 189 | + |
| 190 | +1. Click on `Connect` |
| 191 | +2. Your App opens in a new tab of your browser |
| 192 | +3. Launch the connection process from your App |
| 193 | +4. Follow all the activation process steps, then `Confirm` |
| 194 | +5. Your test App is now connected with Akeneo PIM! 🔗 |
| 195 | + |
| 196 | +Now that your App is connected, you can enjoy all the available App features from the Akeneo PXM Studio UI and test that your App works well. |
| 197 | + |
| 198 | +To access the settings of your connected App on Akeneo PIM, please go to `Connected Apps`, then click on `Manage App`. |
| 199 | +You can also open your App from Akeneo PIM UI, to do so, click on `Open app`. |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | +::: info |
| 204 | +To know more about the step-by-step activation process, please read our article: |
| 205 | +[How to connect an App?](https://help.akeneo.com/pim/serenity/articles/how-to-connect-my-pim-with-apps.html#how-to-connect-an-app) |
| 206 | +::: |
| 207 | + |
| 208 | +### Step 5: Use your access token to call the API |
| 209 | + |
| 210 | +At the end of this process, you receive the following response with an `access_token`: |
| 211 | + |
| 212 | +```json |
| 213 | +{ |
| 214 | + "access_token": "Y2YyYjM1ZjMyMmZlZmE5Yzg0OTNiYjRjZTJjNjk0ZTUxYTE0NWI5Zm", |
| 215 | + "token_type": "bearer", |
| 216 | + "scope": "read_products write_products" |
| 217 | +} |
| 218 | +``` |
| 219 | + |
| 220 | +You can use this token to call the Akeneo PIM REST API. |
| 221 | + |
| 222 | + |
| 223 | +### Next steps |
| 224 | + |
| 225 | +- Explore the [REST API reference](/api-reference-index.html) |
| 226 | +- Discover how to [synchronize product data with your app](/getting-started/synchronize-pim-products-6x/welcome.html) |
| 227 | +- Start building your app by populating data to test your app against, designing your user interface, and interacting with the Akeneo REST API so that your app stays in sync with changing data |
| 228 | +- Publish your app on the [Akeneo App Store](https://apps.akeneo.com/how-submit-extension-akeneo-app-store) |
0 commit comments