Tutorial - Create a Dispatch

Dispatch your Content



This is part of the tutorial series: Control Access to your Distributed Content:

  1. Intro
  2. Upload your Content
  3. Dispatch your Content
  4. Recap

Create a Destination

The first thing we need to do when dispatching content is to answer the question: where is this going? That’s where destinations come in. A destination is just an entity that holds dispatches, with some additional features for convenience. A typical example of a destination might be a company you’d like to sell your content to. For the sake of this guide, lets say we want to sell our content to two companies.

In order to create our destinations, we can use the CreateDestinations endpoint. There are a number of things which are configurable about a destination, but for now we’ll just focus on the requirements.

This method takes a JSON POST body, and the minimum required object looks like this (we’re creating two destinations at the same time here, but you don’t have to):

Also, notes is actually optional, but quite useful.

{
  "destinations": [
    {
      "id": "company_abc",
      "data": {
        "name": "Company ABC"
      }
    },
    {
      "id": "company_xyz",
      "data": {
        "name": "Company XYZ"
      }
    }
  ]
}

Submitting that, you should get a 204 - No Content, and our destinations should be ready. If you’d like, you can check that for yourself by calling GetDestinations.

Dispatch your Content into a Destination

Now that we’ve got two destinations set up, let’s dispatch our previously imported Golf course into them. For that, we’ll use CreateDispatches. This method is perfect for dispatching a single course into multiple destinations. Again, we’ll focus only on the most important data here.

The JSON POST body for us will look like this:

{
  "dispatches": [
    {
      "id": "company_abc-my_course_id",
      "data": {
        "destinationId": "company_abc",
        "courseId": "my_course_id",
      }
    },
    {
      "id": "company_xyz-my_course_id",
      "data": {
        "destinationId": "company_xyz",
        "courseId": "my_course_id"
      }
    }
  ]
}

You’ll note that here we’re expected to create our own identifier for the dispatch, and inside the data object, we simply provide the identifiers we previously provided when creating the course and destination.

Again we should see 204 - No Content as the response, which means our content is now dispatched into our two destinations.

Download the Dispatched Packages

From here we need to actually download the dispatched zip packages, which can then be passed on to Company ABC or Company XYZ, and imported into the LMS of their choice. To obtain those dispatch packages, we’ll use GetDispatchZip.

Unfortunately for those of you following along with our interactive API docs, this method has a known bug with actually downloading the zip package. Luckily the API reference supplies you with the appropriate curl command to run. Just make sure you add the --output flag in order to save the file. My curl command looked like this (with authorization header omitted):

curl -X GET "https://cloud.scorm.com/api/v2/dispatch/dispatches/company_abc-my_course_id/zip?type=SCORM12" -H  "accept: application/zip" --output company_abc-course_dispatch.zip

After running that method you should have a zip package ready for import into Company ABC’s LMS. We’ll need to run this method again with the second dispatch ID to obtain Company XYZ’s package. You can just repeat the steps above to do so.

Controlling Access

Now that we have our zip packages handed out to our customers, we have a number of access controls we can consider. These are all meant to keep you in ultimate control of your content.

At the destination level you have the following options: - See how many registrations a destination has generated with GetDestinationDispatchRegistrationCount, and reset that count from time to time (license renewal time for instance) with ResetDestinationDispatchRegistrationCount - Enable/Disable all dispatch packages in a destination with SetDestinationDispatchEnabled. If disabled, all distributed dispatches will no longer launch.

At the dispatch level you have options such as: - Set a registration cap, expiration date, and toggle enabled disabled status all from UpdateDispatch

The values for dispatches here can also be set at the time of dispatch creation for convenience.


Next up: Recap