Distribution - Edit Distribution

This guide explains how to edit a distribution link in EnterMediaDB using:

  • JSON REST API
  • EnterMediaDB API UI

Both methods perform the same operation.


1. Overview

The Edit Distribution API allows you to update an existing distribution link.

This process modifies the asset associated with a distribution entry.


2. API Endpoint

The API endpoint is the URL used to run this operation via the REST API.

Endpoint:

PUT /assets/mediadb/services/distribution/edit/edit

This endpoint:

  • Processes a distribution update request
  • Updates the asset associated with the specified distribution link

3. Required Parameters

The following parameters must be included in the request body:

  • id: ID of the distribution link to edit
  • assetid: ID of the asset to associate with the distribution

These values specify which distribution to update and which asset should be linked to it.


4. Edit Distribution Using JSON REST API

Step 1: Prepare Your Data

Example:

{
  "id": "93caa502-139a-40c3-accb-5891076bb04a",
  "assetid": "102"
}

Step 2: Send the Request
curl -H "Content-Type: application/json" \
  -X PUT http://entermedia.org/assets/mediadb/services/distribution/edit/edit \
  -b "entermedia.key=YOUR_SESSION_KEY" \
  -d '{
    "id": "93caa502-139a-40c3-accb-5891076bb04a",
    "assetid": "102"
  }'
Notes
  • Replace YOUR_SESSION_KEY with your actual entermedia.key
  • Ensure your API session is initialized (see Authentication section)
  • Use -L if your server redirects to HTTPS
  • The distribution ID must already exist before it can be edited

5. Edit Distribution Using EnterMediaDB API UI

You can edit a distribution link directly in the EnterMediaDB interface.

Steps
  1. Open the EnterMediaDB API UI

    Example:
    https://emedialibrary.org/mediadb

  2. In the left sidebar, navigate to:
     DistributionEdit distribution

  3. In the request editor, enter:

{
  "id": "3456",
  "assetid": "xyz1"
}

4. Click Execute


6. Response

A successful request returns:

{
  "response": {
    "status": "ok",
    "id": "93caa502-139a-40c3-accb-5891076bb04a"
  },
  "data": {
    "id": "93caa502-139a-40c3-accb-5891076bb04a",
    "assetid": {
      "id": "102",
      "name": ""
    }
  }
}

8. What Happens After Distribution Editing

After a successful request:

  • The distribution entry is updated
  • The distribution link now references the updated asset
  • Existing distribution URLs continue to function with the new asset association

9. Troubleshooting

1. Edit request fails
  • Check that distributionid exists
  • Ensure assetid is valid
  • Verify API permissions are enabled

2. Unauthorized request
  • Ensure entermedia.key is included
  • Ensure session is initialized
  • Verify permissions

3. Distribution still points to old asset
  • Refresh the interface
  • Verify the correct distribution ID was edited
  • Allow time for cache or CDN updates if applicable