Edit Content (REST)

Overview

Content metadata can be edited using the REST API located at /content_api

Request URL

/content_api/[id]/edit?program_code=[program_code]&program=[program]&episode_code=[episode_code]&episode=[episode]&description=[description]&expected_duration=[expected_duration]&expected_filename=[expected_filename]&location=[location]&contributor=[contributor]&import_datetime=[XXXX-MM-DD]&delete_datetime=[XXXX-MM-DD]&api_key=[api key]

Ex. http://myserver:3000/content_api/452/edit?program_code=01&program=a1test&episode_code=009&episode=e1&description=mydescription&expected_duration=30&expected_filename=AAx&location=here&contributor=mycontrib&import_datetime=2011-04-20&delete_datetime=2012-04-20&api_key=f1815f1f2011e32b6309

api_key is generated on the users tab which is accessible from the config tab. This is required as of version 3.16.

 

Parameters

Parameter Type Required Max Length Description
id Integer Y The id of the content file to edit.
program_code String 64 The content file’s program code. If this is an unattached content file (no physical file yet) that is part of a sequence then either program or program_code is required depending on the “Use program and episode codes” configuration setting. The same applies to episode or episode code
program String 254 The content file’s program code. If this is an unattached content file (no physical file yet) that is part of a sequence then either program or program_code is required depending on the “Use program and episode codes” configuration setting
episode_code String 64 The content file’s episode code. If this is an unattached content file (no physical file yet) that is part of a sequence then either episode or episode_code is required depending on the “Use program and episode codes” configuration setting
episode String 254 The content file’s episode. If this is an unattached content file (no physical file yet) that is part of a sequence then either episode or episode_code is required depending on the “Use program and episode codes” configuration setting
description String The content file’s description. Can be any valid block of text
expected_duration Integer If this is an unattached content file, must be greater than 0
expected_filename String 255 If this is an unattached content file, must be specified
location String 32 If this is an unattached content file, must be specified if the system is configured to require location for unattached content
contributor String 64
import_datetime Date/Time Must be a valid ISO date/time
delete_datetime Date/Time Must be a valid ISO date/time
api_key String Y Must be a valid api key

Code Examples

See URL example above.

Return

The success status of the operation will be output onto the screen. ‘true’ for success and ‘false’ for an error or invalid data.

Facebooktwittergoogle_pluslinkedin

One Comment

  1. John Hauser says:

    can this be used to update only a field or two for a file that has already been imported and attached?

    in the following example, i am trying to set the “program” and “contributor” fields for content with an id of “554”.

    No matter what i try, I always receive “false” as the return value.

    the actual value of the api key is copied from the server’s user configuration page and the entire command is on one line:

    wget ‘http://192.168.11.180:3000/content_api/554/edit?program_code=&program=Where the Ocean Meets the Sky&episode_code=&episode=&description=&expected_duration=&expected_filename=&location=&contributor=Bogus Johnny&import_datetime=&delete_datetime=&api_key=xxxxxxxxxxxxxxx’ -O 554.txt

    –15:18:12– http://192.168.11.180:3000/content_api/554/edit?program_code=&program=Where%20the%20Ocean%20Meets%20the%20Sky&episode_code=&episode=&description=&expected_duration=&expected_filename=&location=&contributor=Bogus%20Johnny&import_datetime=&delete_datetime=&api_key=leftoutofwebpost
    => `554.txt’
    Connecting to 192.168.11.180:3000… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 5 [text/html]

    100%[===========================================================================================================>] 5 –.–K/s

    15:18:13 (1003.87 KB/s) – `554.txt’ saved [5/5]

    access@megatrans:~/psg$ cat 554.txt
    false