# Build with Labelcamp

The API allows full remote control of Labelcamp's distribution features from a third-party CMS, from product creation to distribution management on DSPs. 

This is a simple example of what can be achieved using the API. For additional scenarios, please consult the [tutorials](./tutorials/full-scenario), and refer to the [API References](./api) for a comprehensive overview of all available features.

1. **Get your products**
   <OpenPlaygroundButton
     server="https://api.idol.io/api/v2/"
     url="/products/"
     queryParams={[
       { name: "filter[upc-code]" }
     ]}
     method="GET"
   />

   ```ruby
   response = RestClient.get("https://api.idol.io/api/v2/products",
      "Content-Type": 'application/vnd.api+json',
      "Authorization": "Bearer <token>"
    )
    product_id = JSON.parse(response)['data'].first['id']
   ```
1. **Distribute it on DSP**
   <OpenPlaygroundButton
     server="https://api.idol.io/api/v2/"
     url="/send-tasks/"
     queryParams={[
       { name: "filter[product-ids]" }
     ]}
     method="GET"
   />

   ```ruby
   RestClient.post("https://api.idol.io/api/v2/send-tasks", {
     "data": {
       "attributes": { "delivery-type": "delivery", "priority": "next" },
       "relationships": {
         "product": {
           "data": { "type": "products", "id": "<product_id>" }
         },
         "dsp-upload-identification": {
           "data": { "type": "dsp-upload-identifications", "id": "<spotify_id>" }
         },
         "type": "send-tasks"
       }
     }.to_json,
     "Content-Type": 'application/vnd.api+json',
     "Authorization": "Bearer <token>"
   )
   ```

## About the API

Labelcamp API is based on REST principles. It returns responses and allows the creation and update of ressources in JSON format.

The API enables full remote control of Labelcamp’s distribution features from a third-party CMS, covering everything from product creation to distribution management on DSPs. On some resources, webhooksare available for notification of status changes.

All distributor product metadata managed in Labelcamp can be retrieved in JSON responses to be stored in other applications.

The scope of the Labelcamp API implementation can vary from a [full integration](./tutorials/full-scenario) to limited management of products metadata and assets. See our tutorials for more information. Note that [Labelcamp's user interface](https://app.labelcamp.io) also uses the API to function and therefore reflects the functionality offered by the API.

We encourage developers to review our Best Practices section to get used to [JSON API](https://jsonapi.org/) basics before making their first request, and we also recommend to implement management of [unexpected errors](./best-practices/timeouts-and-errors).

