Getting started with the Integration API
This tutorial is the place to start your journey building custom integrations using the Sharetribe Integration API.
Table of Contents
The Sharetribe Integration API is an application programming interface that provides full access to the marketplace's data. It can be used to build applications that integrate different own or 3rd party systems with the Sharetribe marketplace. For an overview of the different APIs that Sharetribe provides, read this article.
In this tutorial, you will download, set up and run an example Integration API command line script that will report some data about your Sharetribe marketplace.
To get the example script up and running, you will need to download and install some basic development tooling:
Clone the examples repository:
git clone https://github.com/sharetribe/integration-api-examples.git
Go to the cloned directory:
Install all dependencies:
Add new link, fill in an application name (for instance "My
example integration") and choose
Integration API as the API.
Once the application is created, you will see a screen listing your application's client ID and client secret. Keep that screen open, as you will need these values in the next step.
Always keep your client secret secure. Never expose it to an untrusted device or application, such as an end user's browser or mobile app.
Copy the environment configuration template file:
cp env-template .env
.env file in your favorite text editor and fill in the
SHARETRIBE_INTEGRATION_CLIENT_SECRET variables with the values you
obtained in the previous step.
You can get a summary report for your marketplace listings, users and transactions running the following example:
You should see output similar to this:
================ My Marketplace analytics ================
- 4 draft(s)
- 5 pending approval
- 70 published
- 1 closed
This month, starting from Sun Dec 01 2019:
- 3 new user(s)
- 10 new listing(s)
- 9 new transaction(s)
- Study the examples source code to get a better understanding on how to use the Integration SDK
- Read the Integration API reference documentation
- Start building your own integration. You can do so in different ways,
depending on your needs:
- Build your integration as a backend feature on top of your existing Sharetribe Web Template app
- Fork our Integration API examples repository and build on top of that