📖
API documentation
  • 🚀 Dashboard
  • 📅Changelog
  • 💾Deprecations
  • 🛠️Resources
    • Artist
    • ArtistRole
    • AppleArtist
    • AssetAttachment
    • Availability
    • Booklet
    • Company
    • Continent
    • Currency
    • Customisation
    • Distributor
    • DistributorPriceCode
    • DistributorProductSubgenres
    • Dsp
    • DspState
    • DspTag
    • DspUploadIdentification
    • Gender
    • ImportTask
    • ImportTask [NEW]
    • Label
    • Language
    • Offer
    • Playlist
    • Product
    • ProductGenre
    • ProductType
    • Quotas
    • Record
    • Retail
    • Role
    • Right
    • SendTask
    • SendTaskFactory
    • SpotifyArtist
    • Tag
    • Territory
    • Track
    • TrackOffer
    • TrackVideo
    • Video
    • Webhooks
  • 💡Best practices
    • JSON API documentation
    • Perform your first request
    • Make specific JSON API request
    • Manage the static resources
    • List of common HTTP status codes
    • ⁉️Timeouts and Errors
  • 🖥️Tutorials
    • Full Scenario
    • Managing artists
    • Upload a Dolby Atmos
    • Set a timed release
    • Update Scenario
  • 🔗Exports
    • Daily Trends export
  • 📡Webhooks
    • Presentation
Powered by GitBook
On this page
  1. 🖥️Tutorials

Update Scenario

PreviousSet a timed releaseNextDaily Trends export

Last updated 5 months ago

CtrlK
  • Change Product status to Draft:
  • Update the Product's featuring artist:
  • Re-activate the Product:
  • Retrieve the default Offer:
  • Change default Offer's status to Draft:
  • Update the default Offer's release date:
  • Reactivate the default Offer:
  • And, finally, send a metadata update to the relevant platforms, by creating an 'update' type of SendTask:

In some cases, there's a need to modify the metadata of an album that's already delivered to the platforms.

In this tutorial, we'll modify the album's featuring artist and change its default offer's release date.

To do this, follow these steps:

Change Product status to Draft:

response = RestClient.put(
  "https://api.idol.io/api/v2/products/214477",
  {
    "data": {
      "id": "214477",
      "attributes": {
        "status": "draft"
      },
      "type": "products"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

status = JSON.parse(response)['data']['attributes']['status']
// => "draft"

Update the Product's featuring artist:

response = RestClient.put(
  "https://api.idol.io/api/v2/products/214477",
  {
    "data": {
      "id": "214477",
      "attributes": {
        "featuring": "Album Test Featuring"
      },
      "type": "products"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

featuring = JSON.parse(response)['data']['attributes']['featuring']
// => "Album Test Featuring"

Re-activate the Product:

response = RestClient.put(
  "https://api.idol.io/api/v2/products/214477",
  {
    "data": {
      "id": "214477",
      "attributes": {
        "status": "active"
      },
      "type": "products"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

status = JSON.parse(response)['data']['attributes']['status']
// => "active"

Retrieve the default Offer:

response = RestClient.get(
            "https://api.idol.io/api/v2/offers?filter[product_id]=214477&filter[is_default]=true",
            "Content-Type": 'application/vnd.api+json',
            "Authorization": "Bearer <token>"
            )

 offer_id = JSON.parse(response)['data'].first['id']
 // => 377099

Change default Offer's status to Draft:

response = RestClient.put(
  "https://api.idol.io/api/v2/offers/377099",
  {
    "data": {
      "id": "377099",
      "attributes": {
        "status": "draft"
      },
      "type": "offers"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

status = JSON.parse(response)['data']['attributes']['status']
// => "draft"

Update the default Offer's release date:

response = RestClient.put(
  "https://api.idol.io/api/v2/offers/377099",
  {
    "data": {
      "id": "377099",
      "attributes": {
        "release-date": "2025-03-12"
      },
      "type": "offers"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

release_date = JSON.parse(response)['data']['attributes']['release-date']
// => "2025-03-12"

Reactivate the default Offer:

response = RestClient.put(
  "https://api.idol.io/api/v2/offers/377099",
  {
    "data": {
      "id": "377099",
      "attributes": {
        "status": "active"
      },
      "type": "offers"
    }
  }.to_json,
  "Content-Type": 'application/vnd.api+json',
  "Authorization": "Bearer <token>"
 )

status = JSON.parse(response)['data']['attributes']['status']
// => "active"

And, finally, send a metadata update to the relevant platforms, by creating an 'update' type of SendTask:

response = RestClient.post(
              "https://api.idol.io/api/v2/send-tasks",
              {
                "data": {
                  "attributes": {
                    "deliverable": "true",
                    "delivery-type": "update"
                  },
                  "relationships": {
                    "product": {
                      "data": {
                        "type": "products",
                        "id": "214477"
                      }
                    },
                    "dsp-upload-identification": {
                      "data": {
                        "type": "dsp-upload-identifications",
                        "id": "374"
                        }
                      }
                    },
                    "type": "send-tasks"
                  }
                }.to_json,
              "Content-Type": 'application/vnd.api+json',
              "Authorization": "Bearer <token>"
          )

 send_task_id = JSON.parse(response)['data'][id]
 // => 7434479