Storymarket supports grouping of collected content into packages (which can have their own pricing and rights schemes).
Packages (managed via Storymarket.packages) are fairly similar to other content types (see Content APIs). The difference is that packages have a set of content “inside” the packages, so when uploading packages you’ll need to provide that data. Like all related objects, you can provide related data as either instances of the appropriate content object or as IDs. For example:
>>> api = storymarket.Storymarket(STORYMARKET_API_KEY)
# Grab a few objects to create a package with.
>>> text1 = api.text.get(123)
>>> text2 = api.text.get(456)
>>> vid1 = api.text.get(444)
# Make the package.
>>> api.packages.create({
... 'title': 'My Content Package',
... 'tags': ['hi'],
... 'org': api.orgs.all()[0],
... 'category': api.categories.get(123),
... 'text_items': [text1, text2, 789],
... 'video_items': [vid1],
... 'audio_items': [111, 222]
... })
As you can see, each type has its own key in the creation dict – audio_items, data_items, text_items, photo_items, or video_items – and each item in those lists can be an int or an instance.
Detailed reference for the package classes follow:
Get a list of all content resources of this type.
Return type: | A list of instances of appropriate ContentResource subclasses (e.g. Audio, Video, etc.) |
---|
Create a new resource of this type.
Parameters: | data – The data for the object to create. This could be an instance of the resource class, or a dictionary of simplified data. |
---|---|
Return type: | The created resource class. |
Get a single content resource of this type.
Parameters: | resource – The resource instance or its ID. |
---|---|
Return type: | An instance of an appropriate ContentResource subclass (e.g. Audio, Video, etc.) |
Update an existing resource.
Parameters: |
|
---|---|
Return type: | None |